Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Portuguese language support #5949

Closed
jeanregisser opened this issue Nov 25, 2020 · 0 comments · Fixed by #5945
Closed

Portuguese language support #5949

jeanregisser opened this issue Nov 25, 2020 · 0 comments · Fixed by #5945
Assignees

Comments

@jeanregisser
Copy link
Contributor

Expected Behavior

App should be available in Portuguese.

Current Behavior

Portuguese is not available as a language.

@jeanregisser jeanregisser self-assigned this Nov 25, 2020
@jeanregisser jeanregisser changed the title Portuguese language Portuguese language support Nov 25, 2020
@nityas nityas added feature Feature requests Priority: P2 Major labels Dec 1, 2020
@mergify mergify bot closed this as completed in #5945 Dec 23, 2020
mergify bot pushed a commit that referenced this issue Dec 23, 2020
### Description

Portuguese is here 🇧🇷!

### Other changes

- Lazy load locale data (only the data for the currently selected locale is loaded in memory)
- Only include the `date-fns` locales we actually use in the final bundle. Bundle size went from **9.6MB** to **8.98MB** (~6.45% smaller)!

**bundle size before / after** (using `npx visualize-bundle`)
<img width="50%" alt="Screenshot 2020-12-22 at 17 14 01" src="https://user-images.githubusercontent.com/57791/102909971-12f9ed00-447a-11eb-9a2c-29953937691e.png"><img width="50%" alt="Screenshot 2020-12-22 at 17 07 15" src="https://user-images.githubusercontent.com/57791/102910001-1c835500-447a-11eb-9825-703b89867ca9.png">

- Centralize all locale data config in `locales/index.ts` (name, strings and date-fns locale) so we don't need to modify different places in the code when adding a new language.
- Fix whole translation strings logged during i18n init (debug mode was on for some reason). Hopefully this should help app startup performance.
- Remove isolated translations for currencies in `base` project.
  - It's fine to have some repetition and gives better context to the translator.
  - Also the current solution didn't work well with different plural rules.
- Add simple test for i18n.ts

### Tested

<img src="https://user-images.githubusercontent.com/57791/100229244-3e91c200-2f24-11eb-889a-ee81ea7e395f.png" width="50%" /><img src="https://user-images.githubusercontent.com/57791/100229260-43567600-2f24-11eb-8252-cc86097daaa6.png" width="50%" />

### Related issues

- Fixes #5949

### Backwards compatibility

Yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants