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

UI shows incorrect language #1527

Closed
ghost opened this issue Apr 14, 2023 · 19 comments
Closed

UI shows incorrect language #1527

ghost opened this issue Apr 14, 2023 · 19 comments
Assignees
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Apr 14, 2023

UI shows incorrect language in some cases.

Language settings:

  • zh-TW: It shows the en language
  • zh-HK: It shows the zh language

Technical information

  • Device: ASUS Zenfone 6 (2019)
  • OS: OmniROM 13
  • OpenTracks version: v4.3.0, v4.3.1
@ghost ghost added the potential bug A bug that could not (yet) be reproduced label Apr 14, 2023
@dennisguse
Copy link
Member

IIRC that is the default behavior for missing translations in the regional specific locales.
First check zh-tw, then zh and then fallback to default (on Android this is en-us).

@ghost
Copy link
Author

ghost commented Apr 14, 2023

I note an untranslatable string named settings_layout_reset_key was translated in values-zh-rTW/strings.xml.
Is this the reason?

@dennisguse
Copy link
Member

Actually, those should not be translated as they are purely technical. I will remove these translations.

@dennisguse
Copy link
Member

Since you are on Android 13, how do you set the language?

PS/ settings_layout_reset_key is now in the correct file and cannot be translated anymore.

@ghost
Copy link
Author

ghost commented Apr 18, 2023

To set the language as zh-TW:

  1. Going to "App info\Language" on OpenTracks.
  2. Choose "中文 (台灣)", that is "Chinese (Taiwan)".

Screenshot

@ghost
Copy link
Author

ghost commented Apr 18, 2023

This issue started in v4.3.0.
In the old version 4.2.2, I got the correct language that same the system setting.

Btw, I saw settings_layout_reset_key on Weblate is still translated.

@dennisguse
Copy link
Member

@elastic-rock this seems to be an effect of #1468.
Any ideas?

@dennisguse
Copy link
Member

@elastic-rock ping

@elastic-rock
Copy link

elastic-rock commented Apr 24, 2023 via email

@dennisguse dennisguse added bug Something isn't working and removed potential bug A bug that could not (yet) be reproduced labels Apr 25, 2023
@dennisguse dennisguse self-assigned this Apr 25, 2023
@elastic-rock
Copy link

#1540 (comment)

@dennisguse
Copy link
Member

@nthtimes could you check that this fixing your issue?
Nightly is already available and F-Droid might take some days as usual.

@ghost
Copy link
Author

ghost commented May 1, 2023

Now, it is correctly shows my language by system or manually specify.
But I found that all the regional option are getting the same translation, the Traditional Chinese (Hong Kong) seems to show zh-TW translation.

@dennisguse
Copy link
Member

dennisguse commented May 1, 2023

So, now it gets dirty.

I did some digging into when things started going wrong.

I compiled the APK for different versions and checked the included locales resources.asc/strings

  • v4.3.4 does include 92 locales (no country-specific locales)
  • v4.3.4 as deployed via PlayStore includes 91 locales: af, am, ar, as, az, be, bg, bn, bs, ca, cs, da, de, el, en_001, en_AU, en_CA, en_GB, en_IN, en_XC, es, es_419, es_US, et, eu, fa, fi, fr, fr_CA, fr_CH, ga, gl, gu, hi, hr, hu, hy, in, is, it, iw, ja, ka, kk, km, kn, ko, ky, lo, lt, lv, mk, ml, mn, mo, mr, ms, my, nb, ne, nl, or, pa, pl, pt, pt_BR, pt_PT, ro, ru, si, sk, sl, sq, sr, sr_Latn, sv, sw, ta, te, th, tl, tr, uk, ur, uz, vi, zh, zh_CN, zh_HK, zh_TW, zu
  • v4.3.0 does include 44 locales (no country-specific locales)
  • v4.3.0 (with manually naming all country-specific locales): these get included into resources.asc/strings
  • v4.2.2 does include 92 locales (everything is included)

In the repo, we have 54 locales...

So, all the configuration for Android 13's per app language support (included in v4.3.0) some leads to omit locales (especially country-specific locales).
Autogenerating these config files as it is done in v4.3.4 (Android build tools 8.1.0) seems to work.

@dennisguse dennisguse reopened this May 1, 2023
@dennisguse
Copy link
Member

... but all that does not explain why the wrong regional locale is shown now.

@dennisguse dennisguse pinned this issue May 1, 2023
@dennisguse
Copy link
Member

@nthtimes could you check if this is still broken for you using the v4.3.5?

@ghost
Copy link
Author

ghost commented May 17, 2023

This is still broken in the v4.3.5.
I did try different region locale (they are zh_HK, zh_TW), and still getting same translation.

@dennisguse
Copy link
Member

I just tested this using an Android 13 emulator and replaced zh, zh_HK, and zh_TW with a locale I can distinguish.
When doing this I get three different localizations.

The regions I get shown are these (screenshot below).
I translated the screenshot using Google Translate and all looks good.

Don't really know what else to test :/

image

@ghost
Copy link
Author

ghost commented May 19, 2023

Screenshot_20230520-045107
Screenshot_20230520-045130
Screenshot_20230520-050423_1

After changing into the zh_hk translation, it seems good, but not.
I think I got the zh_tw translation, because the zh_hk translation has no any the translated strings in About OpenTracks.

@dennisguse
Copy link
Member

In Weblate, we have three flavors of Chinese:

First, I don't know why Weblate is mapping zh_Hans to zh-rTW.
Second, Android will use zh aka zh_Hant as fallback if a translation is zh-rHK is missing.
Some more infos here: https://developer.android.com/guide/topics/resources/multilingual-support

I am really at a loss here on how to continue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants