Disable auto localization of scripts

More
3 years 1 week ago #1886 by maciek
New version of i2 localization automatcly localize also in scripts parsing

for example I'm using double.Parse that need to use ALWAYS en-US cultureinfo. But I2 localize overwriting this, and my double.Parse doesn't work because it use for example "," instead of "."

How to disable this auto localization for scripts?

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

More
3 years 1 week ago #1887 by Frank
Hi,
Last week I released a new alpha with a change that solves the issue.
The problem is that plugin is automatically setting the CurrentCulture based on the language. That setting affects everything that is localizable.

If you download the latest from the beta folder (2.6.9a1) that feature is disabled by default and can be enabled (if you need it by dragging the EnableAutoCultureInfo script into your startup scene)

If you don't want to update to the latest just yet, you could change the function SetLanguageAndCode in LocalizeManager.cs line 108
by this one:
		public static void SetLanguageAndCode( string LanguageName, string LanguageCode, bool RememberLanguage = true, bool Force = false )
		{
			if (mCurrentLanguage != LanguageName || mLanguageCode != LanguageCode || Force)
			{
				if (RememberLanguage)
					PlayerPrefs.SetString ("I2 Language", LanguageName);
				mCurrentLanguage = LanguageName;
				mLanguageCode = LanguageCode;
                                IsRight2Left = IsRTL (mLanguageCode);
                                LocalizeAll(Force);
			}
		}

that disables the cultureInfo setting.

Hope that helps,
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

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

Time to create page: 0.122 seconds
Template by JoomlaShine