-
-
Notifications
You must be signed in to change notification settings - Fork 310
feat: add setting to change language #884
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this.
There's something I wanted to do for iOS: since the OS allows changing the language in the app settings (available from iOS settings app), I think it is better to not allow the users to change the lang from the app.
So instead of pushing the language selection screen, on iOS it should open the settings app at the language section of lichess mobile app.
Looks like this package supports this: https://pub.dev/packages/app_settings
|
Just to let you know this change: 0ba3029 According to the flutter doc this is how locales should be defined. For the languages names map, I think you can use the hardcoded map from lichobile, but I'm not sure it has all the langs. I think you can find one in the Lila repo too, but I don't know where. |
|
Here is the lang list from Lila: https://github.com/lichess-org/lila/blob/master/modules/i18n/src/main/LangList.scala @tom-anders |
Done (but I have no way to test it) |
|
Apparently, some language code combinations are still missing from the lila list namely de-CH (added a translation for that myself), but also zh and tt-RU. Not sure we're to get the correct translations for those. |
094828c to
2043792
Compare
|
Yes the They need to be removed from the |
|
As far as I know, there is no mapping to the Swiss German language (DE-ch) because it is unusual for websites to have a Swiss German translation. Due to the many different accents, there are basically no standardized spelling or grammatical rules in the language. That's why it was decided that people with DE-ch as their browser setting will see the German translation by default. However, there is an option to select the Swiss German translation in the settings. In my opinion, this is a good solution, and maybe we can do the same for the app. |
|
@HaonRekcef Thanks for the insight! https://github.com/lichess-org/lila/blob/27d6d15bb531a2ba5d85ec6e765e98415b3ce7c4/modules/i18n/src/main/LangList.scala#L45C1-L45C43 would be the relevant line, right? @veloce I think then we simply add |
Yes, correct. |
a00ad85 to
7cf770c
Compare
|
One small conflict to solve @tom-anders , then I'll take care of testing and merging it :) |
7cf770c to
2ea1387
Compare
Done, thanks! |
2ea1387 to
be8c175
Compare
|
Whoops, missed two conflicts, now they should all be fixed actually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Closes #448
Not sure how to translate language codes to their localized name...? Looks like lichobile simply has a hardcoded map (see src/i18n.ts), do we just want to copy/paste that?
language.webm