GetLanguageIndex
9 years 1 week ago - 9 years 1 week ago #1369
by vash
GetLanguageIndex was created by vash
Hello,
I am using I2 Localization 2.6.5 a2 and Unity 5.3.4f1
I have a list of languages ( English, German and Spanish ). GetSupportedLanguage(SysLanguage) works perfectly for English and German but for Spanish thefrom the GetLanguageIndex method returns a value greater than 8K.
I've added
in GetLanguageIndex and the result is:
I2Loc System language: ‎Spanish versus available language: Spanish Compare index: 8123
When I change the game language from within the comparison result is 0 and the language is changing correctly.
What am I missing?
Thanks for the help
Edit:
I've changedtoAnd it apparently works.
Will do further tests on more languages, but what are the implications of using Compare versus CompareOrdinal within I2 Localization?
I am using I2 Localization 2.6.5 a2 and Unity 5.3.4f1
I have a list of languages ( English, German and Spanish ). GetSupportedLanguage(SysLanguage) works perfectly for English and German but for Spanish the
string.Compare (mLanguages [i].Name, language, System.StringComparison.OrdinalIgnoreCase)
I've added
Debug.LogError ("I2Loc System language: " + language + " versus available language: "
+ mLanguages [i].Name + " Compare index: "
+ string.Compare (mLanguages [i].Name, language, System.StringComparison.OrdinalIgnoreCase));
in GetLanguageIndex and the result is:
I2Loc System language: ‎Spanish versus available language: Spanish Compare index: 8123
When I change the game language from within the comparison result is 0 and the language is changing correctly.
What am I missing?
Thanks for the help
Edit:
I've changed
string.Compare(mLanguages [i].Name, language, System.StringComparison.OrdinalIgnoreCase)
string.Compare (mLanguages [i].Name, language)
Will do further tests on more languages, but what are the implications of using Compare versus CompareOrdinal within I2 Localization?
Last edit: 9 years 1 week ago by vash. Reason: Possible fix.
The following user(s) said Thank You: hex
Please Log in or Create an account to join the conversation.
9 years 1 week ago - 9 years 1 week ago #1370
by Frank
Are you
Give I2L
5 stars!
Are you
Please lets us know how to improve it!
Replied by Frank on topic GetLanguageIndex
Hi,
Can you please email me a copy of your I2languages.prefab to try reproducing that issue on my side?
My bet is that there is a weird character (maybe not printable character) or space in the name stored in the prefab.
I'm using OrdinalIgnoreCase to make the comparison case insensitive.
This will also do the trick:
Thanks,
Frank
Can you please email me a copy of your I2languages.prefab to try reproducing that issue on my side?
My bet is that there is a weird character (maybe not printable character) or space in the name stored in the prefab.
what are the implications of using Compare versus CompareOrdinal within I2 Localization?
I'm using OrdinalIgnoreCase to make the comparison case insensitive.
This will also do the trick:
(mLanguages [i].Name.ToLower() == language.ToLower())
Thanks,
Frank
Are you

Are you

To get the betas as soon as they are ready,
check this out
Last edit: 9 years 1 week ago by Frank.
Please Log in or Create an account to join the conversation.
Time to create page: 0.215 seconds