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

feat: added fr-FR #20

Merged
merged 7 commits into from
Aug 12, 2024
Merged

feat: added fr-FR #20

merged 7 commits into from
Aug 12, 2024

Conversation

jzu
Copy link
Contributor

@jzu jzu commented Aug 5, 2024

Description

Added the French language. The …/fr-FR/translation.json file has ~95% French sentences. I have tested a few menu entries, and they seem to work, but inconsistencies could appear (e.g. "Click on X", and X has a different label) even though I tried to avoid it.

Changes

Added a translation.json, and edited models.ts, useLanguages.ts, and localization/init.ts in order to have French appear in the UI.

Testing

Tested in Chrome / Developer mode

Checklist for the author

Tick each of them when done or if not applicable.

  • I've covered new/modified business logic with Jest test cases.
  • I've tested the changes myself before sending it to code review and QA.

@jzu jzu changed the title Added fr-FR feat: added fr-FR Aug 5, 2024
@ryanml
Copy link
Contributor

ryanml commented Aug 7, 2024

@jzu - thank you for these translations! We'll be reviewing this change and will provide an update once we've done so.

gergelylovas
gergelylovas previously approved these changes Aug 8, 2024
Copy link
Contributor

@ryanml ryanml left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jzu - please take a look at the formatting failures regarding the translation files here: https://github.com/ava-labs/core-extension/actions/runs/10279108667/job/28528137098?pr=20

You can verify this locally by running yarn scanner. Thank you!

"For your security, please create a name and password.": "Pour votre sécurité, veuillez créer un nom et un mot de passe.",
"Forgot Password?": "Mot de passe oublié ?",
"Forum": "Forum",
"French": "Français",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should just need to add this as "French": "French", to the english translation file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but are you sure? yarn scanner still displays a truckload of errors (same number of lines) even after adding "French": "French", to en/translation.json. Same, after adding "French": "Französisch", to de-DE/translation.json. By the way, I was wondering about it, and with this setup a new language should be added in all existing translation files (I can do it for de, es, ru, but zh, hi, ko, ja? no way). Plus it doesn't scale: imagine 30 languages, and adding a 31st. A small redesign of this part seems in order.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are correct, adding new languages will have this issue. In the past we did not have this problem since the number of supported languages was constant. We will re-consider and update the process here. Thank you for the suggestion.
In the meantime, can you please run yarn scanner and commit the changed translation files with the new item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All translation.js files are now updated, but I still get a humongous amount of error messages when running yarn scanner, beginning with:

i18next-scanner: Unable to parse Trans component:
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
(...8600+ lines...)

Copy link
Contributor Author

@jzu jzu Aug 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok. Cloned upstream on another machine (without fr-FR), and yarn scanner gives the exact same errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Yes those errors you see are the scanner not being able to parse some of the typescript files. It's not ideal however despite what it looks like, it does it's job.

@gergelylovas gergelylovas merged commit 26399f6 into ava-labs:main Aug 12, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants