Unciv icon indicating copy to clipboard operation
Unciv copied to clipboard

Move multiplayer turn notification translations to our translation system

Open Azzurite opened this issue 3 years ago • 6 comments

Currently, the Android multiplayer turn notifier background worker uses Android-specific translation files in android/res/values-*. This is because the turn notifier is basically a separate application - not sharing any state with the main Unciv application. And since the Translations do have state, it "couldn't" be used so far by the turn notifier, as it would result in NPEs.

The correct solution though is what I did with the Gdx.files recently - which is affected by the same problem. To create the Translations class within the turn notifier, same as it is being created in UncivGame. and then use that freshly created instance.

Azzurite avatar Jun 04 '22 13:06 Azzurite

A minor question is how expensive it is to create the Translations class freshly. If it takes several seconds or something like that, then it might make sense to create a generator (like for fastlane translations) instead and keep using the Android-specific translation files.

Azzurite avatar Jun 04 '22 13:06 Azzurite

several seconds

From a desktop log ~ 67ms on my (maybe faster than average) desktop box, for the configured language, provided all dependencies are already loaded (like the settings), and GC doesn't need to clean up while doing it. Corresponds to 15fps :upside_down_face: .

SomeTroglodyte avatar Jun 05 '22 10:06 SomeTroglodyte

I've noticed that regardless of what language I have selected (in-game) I still get the translated notifications. I think values-__ are chosen depending on system language

ofetios avatar Jun 10 '22 08:06 ofetios

I mean, yeah, that's how Android-specific translations work. Always uses your system language by default, need to add special handling if you want something else.

Azzurite avatar Jun 10 '22 11:06 Azzurite

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 15 days.

github-actions[bot] avatar Mar 14 '24 21:03 github-actions[bot]

Will need someone to actually look into this before I personally think it's closable. @yairm210 might disagree, though. Actually, while this doesn't fix the problem of "it follows android's set language", is there a way to at least have a github action to update these strings based on translations, or is that more hassle than it's worth?

SeventhM avatar Mar 18 '24 17:03 SeventhM