Traditional Chinese doesn't fallback as expected

More
3 years 9 months ago - 3 years 9 months ago #4225 by SweatyChair
I have set up two Chinese languages as:


When an Android phone is set to Traditional Chinese (Hong Kong), opening the app first time it fallbacks to Simplified Chinese incorrectly.

Traditional Chinese (Taiwan) is working as expected though.

I2 Localization.2.8.13f1
Unity 2019.4.20f1

Always remember you're unique, just like everyone else.
Last edit: 3 years 9 months ago by SweatyChair.

Please Log in or Create an account to join the conversation.

More
3 years 9 months ago #4228 by Niroan
I can confirm this not working on 2020.1.14f1!
My entire apps turn into chinese and because the text mesh pro bug its not changing the fonts to chinese and i get TOFU chars all over my app.

Please help us fix this issue, my entire app is now TOFU chars...

Please Log in or Create an account to join the conversation.

More
3 years 9 months ago #4241 by SweatyChair
Sadly the developer seems absent for 2+ weeks and hope he is fine and will take a look on this matter soon...

Always remember you're unique, just like everyone else.

Please Log in or Create an account to join the conversation.

More
3 years 9 months ago - 3 years 9 months ago #4242 by SweatyChair
Finally, I found the issue, when "zh-HK" couldn't be found, it simply falls back to the FIRST Chinese, in my case is "zh-CN": LanguageSourceData_Languages (line 55):
public int GetLanguageIndexFromCode( string Code, bool exactMatch=true, bool ignoreDisabled = false)
		{
            for (int i = 0, imax = mLanguages.Count; i < imax; ++i)
            {
                if (ignoreDisabled && !mLanguages[i].IsEnabled())
                    continue;

                if (string.Compare(mLanguages[i].Code, Code, StringComparison.OrdinalIgnoreCase) == 0)
                    return i;
            }

			if (!exactMatch)
			{
                // Find any match without using the Regions
                for (int i = 0, imax = mLanguages.Count; i < imax; ++i)
                {
                    if (ignoreDisabled && !mLanguages[i].IsEnabled())
                        continue;

                    if (string.Compare(mLanguages[i].Code, 0, Code, 0, 2, StringComparison.OrdinalIgnoreCase) == 0)
                        return i;
                }
			}

			return -1;
		}

GetLanguageIndexFromCode ( "zh-HK", false, true ) returns "zh-CN"


A workaround (may not cover all the cases) is always put Chinese (Tranditional) before Chinese (Simplfied):



A code fix should be, put cases that return the correct fallback, e.g. zh-HK, zh-MO to zh-TW; zh-SG to zh-CN as described here .

Always remember you're unique, just like everyone else.
Last edit: 3 years 9 months ago by SweatyChair.

Please Log in or Create an account to join the conversation.

Time to create page: 0.186 seconds
Template by JoomlaShine