Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

CultureNotFoundException problem about culture info in IOS

huangjinshehuangjinshe USMember ✭✭✭

My culture name is : ug-CN,
But every time I create the culture : new CultureInfo("ug-CN"); it will throw exception: CultureNotFoundException.

For found out my culture name, I change the language in IOS 9.3( iphone 5s) simulator and Open my Xamarin.Form project check it:

string cultureName = NSLocale.CurrentLocale.LocaleIdentifier; // get the value in AppDelegate class

but it show me cultureName is : ug-Arab_CN

So I tried:
new CultureInfo("ug-Arab_CN");
new CultureInfo("ug-Arab-CN");
new CultureInfo("ug_Arab-CN");
new CultureInfo("Arab-CN");
new CultureInfo("ug-Arab");

always show me : System.Globalization.CultureNotFoundException: Culture name xx-xx(culture name) is not supported.

Is that a Xamarin Bug or what?
Is there anyone know about that? Thank you.

Answers

  • huangjinshehuangjinshe USMember ✭✭✭

    It's very helpful if we could register a new culture based one of the culture if our culture name not exists in the system or not support.

Sign In or Register to comment.