Kr0oked / Compass

Simple and beautiful compass for Android
GNU General Public License v3.0
314 stars 45 forks source link

Wrong language code change #44

Closed FTno closed 1 year ago

FTno commented 1 year ago

Refer to pull request https://github.com/Kr0oked/Compass/pull/41

I spotted that the language code in the repository has been wrongly changed from nb (values-nb) to nn (values-nn folder). The pull request was nb and is not the same as nn that is another written language form in Norway.

(nb is the most used officially written language form in Norway, nn is far less used)

Kr0oked commented 1 year ago

The norwegian translation puzzles me. I made the change because I could not get the app to show the norwegian translation when trying to make screenshots of the translated app.

I added 'nb' to the resourceConfigurations array in the build.gradle, the translation was still in ' values-nb' folder and I setup the system to use 'Norsk bokmål - Norge'. But the app still showed English strings.

Then I tried to use 'no' the Norwegian macrolanguage code in all the places. So I moved the stuff to ' values-no' and added ' no' in the build.gradle. But neither with 'Norsk bokmål - Norge' nor ' Norsk nynorsk' I got a translated app.

Then I had a look at another opensource app that has a lot of translations and saw they had a norwegian translation, but as 'nn'. So I tried out this setup and finally then with 'Norsk nynorsk' as system language I got a translated app showing up.

Do you have any idea why I could not get 'nb' to work? Also the per-app language selection does not work for all the variants https://developer.android.com/guide/topics/resources/app-languages . It was never possible to select Norwegian as language there.

FTno commented 1 year ago

I have translated several apps and they all work fine with 'values-nb' folder on a norwegian (nb) android phone, and also 'values-nb-rNO' works fine. I have also corrected some that used 'values-no' because that is not supported by android and thus doesn't work.

A few examples: https://github.com/yuriykulikov/AlarmClock/tree/develop/app/src/main/res/values-nb https://github.com/SimpleMobileTools/Simple-Calendar/tree/master/app/src/main/res/values-nb-rNO https://github.com/sky-map-team/stardroid/tree/master/app/src/main/res/values-nb

By the way I decompiled the apk file (1.11.2) with apktool, and could not find any norwegian 'values' folder!

Kr0oked commented 1 year ago

I finally found the problem. I forgot to make an entry in the app/src/main/res/xml/locales_config.xml . I fixed it in the latest commit dbf132b70eef5e281626e8d68039295dfa2aebda . Thanks for opening the issue and doing some investigations. By the way, you could also add appropriate translations in the fastlane/metadata/android directory, then we will get an Norwegian app store entry.