Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.

3 weeks 2 days ago #4246 by Mike9000
Hi everyone, Cloud Diagnostics just reported this exception coming from I2 used on Android with a Thai (th) system language.
(I have English, Spanish and German enabled)
System.Globalization.DateTimeFormatInfo.set_Calendar (System.Globalization.Calendar value) (at <00000000000000000000000000000000>:0)
System.Globalization.CultureInfo.get_DateTimeFormat () (at <00000000000000000000000000000000>:0)
System.Globalization.CultureInfo.GetFormat (System.Type formatType) (at <00000000000000000000000000000000>:0)
System.Globalization.DateTimeFormatInfo.get_CurrentInfo () (at <00000000000000000000000000000000>:0)
System.DateTimeParse.ParseExactMultiple (System.String s, System.String[] formats, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles style) (at <00000000000000000000000000000000>:0)
I2.Loc.LanguageSourceData.Import_Google (System.Boolean ForceUpdate, System.Boolean justCheck) (at <00000000000000000000000000000000>:0)
I2.Loc.LocalizationManager.AddSource (I2.Loc.LanguageSourceData Source) (at <00000000000000000000000000000000>:0)
I2.Loc.LocalizationManager.RegisterSourceInResources () (at <00000000000000000000000000000000>:0)
I2.Loc.LocalizationManager.UpdateSources () (at <00000000000000000000000000000000>:0)
I2.Loc.LocalizationManager.InitializeIfNeeded () (at <00000000000000000000000000000000>:0)
I2.Loc.LocalizationManager.get_CurrentLanguage () (at <00000000000000000000000000000000>:0)
I2.Loc.Localize.OnLocalize (System.Boolean Force) (at <00000000000000000000000000000000>:0)
LoadScene+<ClosePopup>d__2.MoveNext () (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <00000000000000000000000000000000>:0)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

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

3 weeks 1 day ago #4247 by Mike9000
More exceptions over night, all coming from thai language users. Any idea how I can combat this? On a quick look, this seems to come from the module that checks for when to update from the Google sheet? Any idea if disabling this is enough to put a stop to this?

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

3 weeks 1 day ago - 3 weeks 1 day ago #4248 by Frank
It looks like the DateTime.TryParse is not working correctly for the Thai culture information as it requires a different date format than what google sents back.

You can solve that issue by replacing the DateTime.TryParse in
Assets/I2/Localization/Scripts/LanguageSource/LanguageSourceData_Import_Google.cs line 120

	if (DateTime.TryParse( sTimeOfLastUpdate, out TimeOfLastUpdate ))
		double TimeDifference = (DateTime.Now-TimeOfLastUpdate).TotalDays;
		switch (updateFrequency)

	if (DateTime.TryParse( sTimeOfLastUpdate, CultureInfo.InvariantCulture, DateTimeStyles.None, out TimeOfLastUpdate ))
		double TimeDifference = (DateTime.Now-TimeOfLastUpdate).TotalDays;
		switch (updateFrequency)

I will add that change to the plugin and release a new version as soon as posible.

Thanks for reporting this issue.

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
Last edit: 3 weeks 1 day ago by Frank.
The following user(s) said Thank You: Mike9000

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

Time to create page: 0.233 seconds
Template by JoomlaShine