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

Add the ability to localize the application #246

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from

Conversation

grumlu
Copy link

@grumlu grumlu commented Dec 17, 2024

Following a feature request on Discord, to add Chinese language to the app, I looked into how to support different languages.

I have added a localization for French as well.

Changes are in

  • Localizable.xcstrings file for French translation
  • SettingsView to support localization on Defaults.Toggle and LaunchAtStartup.Toggle
  • generic in enums to support adding localization there also

For now there is apparently no conflicting keys, however in the future it may be interesting to refactor the code to add "backend" names to each string depending on where they're used.

@grumlu grumlu changed the title Add the ability to localise the application Add the ability to localize the application Dec 17, 2024
@grumlu
Copy link
Author

grumlu commented Dec 18, 2024

I have updated all the strings to use a key instead of the English translation.
This allows to be more precise in the translation in different context.

The French translation has also been updated to match this change and fix some display issues.

@grumlu
Copy link
Author

grumlu commented Dec 19, 2024

@theboringhumane , are you setting up some AI review bot? 🤩

@theboringhumane
Copy link
Member

@theboringhumane , are you setting up some AI review bot? 🤩

I built it lol

@grumlu
Copy link
Author

grumlu commented Dec 19, 2024

@theboringhumane , are you setting up some AI review bot? 🤩

I built it lol

It seems to be an authentication / pipeline issue for Cori, right? Or did I do something wrong?

@theboringhumane
Copy link
Member

Yes action was for that only.

@richardkunkli
Copy link
Member

The app is already localizable, no need to change texts, Xcode handles it.

@grumlu
Copy link
Author

grumlu commented Dec 22, 2024

The app is already localizable, no need to change texts, Xcode handles it.

One commit earlier does the translation in French without changing all the texts.
However, the same text in two different contexts uses the same translation in this case.
This doesn’t work in all languages. The context matters and the translation would be then different.

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.

4 participants