.net error Culture name 'az-az' is not supported. Parameter name: name
i am trying to implemnet different languages to my site and so far there was no problem with my setup.
I create Language.en.resx,Language.nl.resx etc and put them in App_GlobalResources folder. Then with code blewlo i allow users to set their prefered language
protected override void InitializeCulture()
{
if (string.IsNullOrEmpty(site_language))
{
System.Globalization.CultureInfo ci = new System.Globalization.CultureInfo("en-GB");
System.Threading.Thread.CurrentThread.CurrentCulture = ci;
System.Threading.Thread.CurrentThread.CurrentUICulture = ci;
}
else
{
this.UICulture = site_language;
this.Culture = site_language;
base.InitializeCulture();
}
}
But this doesn't work with Azerbeycani Language. When i create Language.az.resx and set it via az-AZ i get error saying
System.ArgumentException
Culture name 'az-az' is not supported. Parameter name: name System.ArgumentException: Culture name 'az-az' is not supported. Parameter name: name at System.Globalization.CultureTableRecord..ctor(String cultureName, Boolean useUserOverride) at System.Globalization.CultureTableRecord.GetCultureTableRecord(String name, Boolean useUserOverride) at System.Globalization.CultureInfo..ctor(String name, Boolean useUserOverride) at System.Web.HttpServerUtility.CreateReadOnlyCultureInfo(String name) at System.Web.UI.Page.set_UICulture(String value) at SiteBasePage.InitializeCulture() at ASP.mobile_default_aspx.__BuildControlTree(mobile_default_aspx __ctrl) at ASP.mobile_default_aspx.FrameworkInitialize() at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) 开发者_JS百科at ASP.mobile_default_aspx.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
i have checked http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(VS.71).aspx and noticed there is no az-Az but az-AZ-Latn. Problem is when i use az-AZ-Latn to set language i get same erorr.
I have seen and tried http://support.microsoft.com/kb/939949 but it doesn't apply/work
Anyone had smilar problems?
Have you tried the new culture name az-Latn-AZ
as described in the KB article?
Is it possible that your app is truncating the culture name?
I ask only because my console apps have no problem using that culture:
var name = "az-Latn-AZ";
var sc = CultureInfo.CreateSpecificCulture(name);
Console.WriteLine(sc.NativeName);
Console.WriteLine(42.ToString("C", sc));
Prints:
Az?rbaycan-ili (Az?rbaycanca) 42,00 man.
精彩评论