Android wrong locale resolution for ES-EC language - android

I have the next localization in my app:
values
values-es
values-es-rMX
When I have locale of the device set to es_EC (Ecuador), I see strings from MX folder!
But accordingly to this tutorial, I should see strings from base ES folder (actually, this is the goal).
Why is it happening and how can I get correct app behavior?
I'm using an emulator with API level 28.

Okay, the answer is on another StackOverflow question, the reason is the same, this is intended behavior for Android system.

Related

For Xamarin.Forms localization, do I need to implement ILocalize?

In Xamarin help page https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/text?tabs=windows, for "Displaying the Correct Language", it suggests to define interface ILocalize then use DependencyService to get some locale info.
However, My Xamarin.Forms Android app could just pick the right language resource file according to the locale settings of the device, and display rightful language.
So translations are working fine without ILocalize and the implementations. Do I really need ILocalize and the implementations?
No need of DependencyService, Xamarin.Forms automatically recognizes it and gets the appropriate resource file. Docs needs to be updated, an issue was opened for the same

Android N multi-locale support not working as intended

While developing an app, I tried use Android N multi-lingual support. As explained on developers site. It seems that it will automatically pick the resources using resource resolution mechanism.
But it doesn't seem to be working or could it be that I am missing something?
Here is the complete scenario :
Device as Portugese(pt_PT) and German(de_DE) as preferred language list respectively.
Locales supported by app are placed in corresponding resource folder:
a. values (default)
b. values-de
c. values-es
So according to explanation provided on developers site it should pick locale from "values-de" directory. But it shows the default one.
Could someone give me an idea of what might be going wrong??
Ineteresting that this issue reproduces in sample project. But all works as intended if I remove "appcompat-v7" from compile dependencies. I don't know why for now and I'll keep digging.
UPDATE:
adding appcompact-v7 really fix the problem. watch this tutorial to understand why:
https://blog.egorand.me/a-curious-case-of-multiple-locales/
I was facing this issue and found out that removing alternative resources the app does not need resolves the issue.
android {
defaultConfig {
...
// Keeps language resources for only the locales specified below.
resConfigs "de", "es"
}
}
Check out Google Developer documentation here
You need to add android:configChanges="locale" in AndroidManifest.xml

Keep showing res/values-zh/strings.xml instead of res/values-en even when my phone's locale is English

Have an issue that my application keep showing res/values-zh/strings.xml instead of res/values-en even when my phone's locale is English or any other undefined locale(language).
Here is my main activity java class and it is showing English but we get the result on phone in Chinese
Here is default values strings
Would be much appreciated if someone have any idea on this issue as i had following the android studio documentation and the localization is not working properly and i could not find out the reason for quite long time. Kindly let me know if further info needed, thanks !
What version of Android do you use?
Is it Android N? Android N allows the user to configure a list of languages. If the first language is not supported, and the second is Chinese, then you will get Chinese UI (if Chinese strings are available, of course)

Android not using/finding my Hebrew localization.

I'm working to localize my app for a number of language. Spanish is working great but Hebrew isn't showing up.
What confuses me is if I put the contents of my Hebrew strings folder in the Spanish folder(values-es) it works great. Spanish in my Hebrew folder(values-he) does not work though...
Any thoughts would be greatly appreciated.
Hebrew is locale like 'iw', and also 'he'.
As the #klausw mentioned in his answer:
you better store duplicate copies in both values-iw/ and values-he/
just to make sure it works in all devices.
rogcg is right for most Android devices, but apparently the Samsung Galaxy S2 incompatibly uses locale "he" for Hebrew and ignores values-iw/. If you want to be compatible with those devices too, you need to store duplicate copies in both values-iw/ and values-he/. See also https://stackoverflow.com/a/8573059/405214.
Bear in mind that as of Summer 2021 bundle (.aab) file is required instead of the .apk file. This change brings optimization to many things but some language related problems as well: if your device does not support a specific language, it will not be downloaded from the Play Store.
Check the solution here.

Android Custom font shows up blank on some phones

I'm using a custom font for a Japanese quiz app on Android. I tried it on a friend's phone at a cookout, and the font did not show up (it shows up on mine and others). The font is delivered with the apk. I don't have access to the logcat, and unfortunately forgot to check the phone model, although I think it's kind of a budget version. Has anyone had this problem this, or have any ideas what might cause it?
well, if you use delivered font with APK and got unexpected results, its generally rendering issue with Android system .. with other words, Android System cannot render all characters correctly. you need to know that earlier versions of Android don't support all Unicodes as well as later but off cause with more supported characters . if you want to test that on emulator, try to test your app with version 1.6.
I got similar issue with Arabic characters ..
I can help you with those guides:
1- try to check the characters you are using, and be away from rare characters.
2- try a different common font if its available.
3- If you built your own font, try to rebuild it again and use supported ID of glyphes. as I told you Android doesn't support all Unicode characters (supports based on ID). and its different from version to another.
4- check and detect unsupported characters ( you can do that by measuring length of character and compare it with pre-measured length of that character) then insert it as image with suitable dimension.
5-you can use webview instead of TextView/EditText ..
I hope that will help you ..
good luck,

Categories

Resources