Skip to content

Conversation

@tom-anders
Copy link
Collaborator

@tom-anders tom-anders commented Jul 24, 2024

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

Copy link
Contributor

@veloce veloce left a 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

@veloce
Copy link
Contributor

veloce commented Jul 25, 2024

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.

@veloce
Copy link
Contributor

veloce commented Jul 25, 2024

@tom-anders
Copy link
Collaborator Author

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

Done (but I have no way to test it)

@tom-anders
Copy link
Collaborator Author

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.

@veloce
Copy link
Contributor

veloce commented Jul 26, 2024

Yes the de-CH is not available from lichess website, I guess we should remove it then. Same for zh (I left it as a fallback, but I guess we can remove it) and tt-RU.

They need to be removed from the update-arb-from-crowdin and the constants.dart.

@HaonRekcef
Copy link
Contributor

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.

@tom-anders
Copy link
Collaborator Author

tom-anders commented Jul 26, 2024

@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 gsw-CH to the crowdin script to support this...? (and also to constants.dart)

@HaonRekcef
Copy link
Contributor

@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?

Yes, correct.

@tom-anders tom-anders force-pushed the changeLanguage branch 2 times, most recently from a00ad85 to 7cf770c Compare July 26, 2024 21:50
@veloce
Copy link
Contributor

veloce commented Jul 27, 2024

One small conflict to solve @tom-anders , then I'll take care of testing and merging it :)

@tom-anders
Copy link
Collaborator Author

One small conflict to solve @tom-anders , then I'll take care of testing and merging it :)

Done, thanks!

@tom-anders
Copy link
Collaborator Author

Whoops, missed two conflicts, now they should all be fixed actually

Copy link
Contributor

@veloce veloce left a comment

Choose a reason for hiding this comment

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

LGTM!

@veloce veloce merged commit 23bad51 into lichess-org:main Jul 29, 2024
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.

Add an option to choose the language

3 participants