Hi all,
I created a CustomCulture class form CultureInfo.
Here is my code:
public class CustomCulture : CultureInfo
{
private string _parent;
private string _name;
private string _description;
public CustomCulture(string parentCulture, string myCultureName) : base(parentCulture)
{
_parent = parentCulture;
_name = myCultureName;
_description = String.Format("custom culture({0})", _name);
}
public override string Name
{
get
{
return _parent + "-" + _name;
}
}
public override CultureInfo Parent
{
get
{
return new CultureInfo(_parent);
}
}
public override string EnglishName
{
get
{
return _description;
}
}
public override string NativeName
{
get
{
return _description;
}
}
}
public partial class _Default : System.Web.UI.Page
{ private DefCulture.CustomCulture abc = new DefCulture.CustomCulture("en-AU", "abc");
protected override void InitializeCulture()
{
Thread.CurrentThread.CurrentUICulture = abc;
}
....
What I want to achieve is, for example, if I create a custom culture en-AU-abc, the current page can use local resource file Default.aspx.en-AU-abc.resx,
but I couldn't get it work, the current page always loads Default.aspx.resx