Can't create language versions like PT_PT, PT_BR

More
9 years 1 month ago - 9 years 1 month ago #560 by iseeall
This may be a bug in the I2 Localization plugin.
I'm trying to add Brazilian Portuguese AND Portugal Portuguese as separate languages because the are pretty different. This works fine until I export the spreadsheet to Google Docs and import the strings back manually from the Spreadsheet (or the strings are imported at game launch if "Always" is set for "Auto Update Frequency"). It seems that when the plugin attempts to read strings from Google Docs, it fails to distinguish between languages which have the same name (e.g. "portuguese") but different versions of it ("Portugal", "Brazil").
Same for Traditional/Simplified Chinese, Mexico/Spain Spanish.
My best guess is that this bug is caused by the fact that somewhere in the plugin the languages are stored by just their 2-letter code or something, and the country part is ignored. Which results into duplicate languages - and the second one is thrown out.

Could you please look into the issue?

For now, I can go with just 1 country per language: leave only Brazilian Portuguese and Simplified Chinese, because they are more important than Portugal Portuguese and Traditional Chinese. But in the long run this should be fixed, because Taiwan has more downloads on GooglePlay than mainland China, while on AppStore it's reversed -> which makes it important to support both Chinese versions: Traditional AND Simplified.
Last edit: 9 years 1 month ago by iseeall.

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

More
9 years 1 month ago #563 by Frank
Hi,
Thanks for reporting this issue. It seems that when importing spreadsheet data from either google or a CSV file, it was just checking the language Name and not the code.
A fix for this has been added to 2.4.4f2 which I will be release later today.

You can also fix it manually by modifying the I2\Localization\Scripts\Google\LanguageSource_Import_CSV.cs line 68 from:
				GoogleLanguages.UnPackCodeFromLanguageName(Tokens[i+LanguagesStartIdx], out LanName, out LanCode);

				int LanIdx = GetLanguageIndex(LanName);

				if (LanIdx < 0)
				{

to this:
				GoogleLanguages.UnPackCodeFromLanguageName(Tokens[i+LanguagesStartIdx], out LanName, out LanCode);

				int LanIdx = -1;
				if (!string.IsNullOrEmpty(LanCode))
					LanIdx = GetLanguageIndexFromCode(LanCode);
				else
					LanIdx = GetLanguageIndex(LanName);

				if (LanIdx < 0)
				{

That will fix it for both Google and CSV files.

Thanks
Frank

Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
The following user(s) said Thank You: iseeall

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

More
9 years 1 month ago #564 by iseeall
Great, thanks for the quick reply and fix. I'll update the plugin tomorrow and add the extra languages I needed.

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

Time to create page: 0.218 seconds
Template by JoomlaShine