- Forum
- Plugins
- I2 Localization
- Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.
Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.
4 years 1 month ago #4246
by Mike9000
Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture. was created 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)
(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)
<ClosePopup>d__2:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Please Log in or Create an account to join the conversation.
4 years 1 month ago #4247
by Mike9000
Replied by Mike9000 on topic Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.
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.
4 years 1 month ago - 4 years 1 month ago #4248
by Frank
Are you
Give I2L
5 stars!
Are you
Please lets us know how to improve it!
Replied by Frank on topic Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.
Hi,
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
from:
to
I will add that change to the plugin and release a new version as soon as posible.
Thanks for reporting this issue.
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
from:
try
{
if (DateTime.TryParse( sTimeOfLastUpdate, out TimeOfLastUpdate ))
{
double TimeDifference = (DateTime.Now-TimeOfLastUpdate).TotalDays;
switch (updateFrequency)
to
try
{
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.
Frank
Are you

Are you

To get the betas as soon as they are ready,
check this out
Last edit: 4 years 1 month ago by Frank.
The following user(s) said Thank You: Mike9000, combatsheep
Please Log in or Create an account to join the conversation.
- combatsheep
- Offline
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
3 years 10 months ago - 3 years 10 months ago #4305
by combatsheep
I tryed it, but get 2 errors.
How can I fix it?
Thanks.
<Added>
When I added "using System.Globalization;" to "LanguageSourceData_Import_Google.cs", these two problems were solved, but I still get the error "at System.Globalization.DateTimeFormatInfo" of the main subject and it is not solved.
<Added>
I solved it by link.xml!
Replied by combatsheep on topic Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.
if (DateTime.TryParse( sTimeOfLastUpdate, CultureInfo.InvariantCulture, DateTimeStyles.None, out TimeOfLastUpdate ))
[Error] The name 'CultureInfo' does not exist in the current context
Compiler.Compiler() at LanguageSourceData_Import_Google.cs
[Error] The name 'DateTimeStyles' does not exist in the current context
Compiler.Compiler() at LanguageSourceData_Import_Google.cs
How can I fix it?
Thanks.
<Added>
When I added "using System.Globalization;" to "LanguageSourceData_Import_Google.cs", these two problems were solved, but I still get the error "at System.Globalization.DateTimeFormatInfo" of the main subject and it is not solved.

<Added>
I solved it by link.xml!

Last edit: 3 years 10 months ago by combatsheep.
Please Log in or Create an account to join the conversation.
- Forum
- Plugins
- I2 Localization
- Bug: ArgumentOutOfRangeException: Not a valid calendar for the given culture.
Time to create page: 0.215 seconds