我创建了一个 CustomCulture 类表单 CultureInfo。
这是我的代码:
public class CustomCulture : CultureInfo
{
私人字符串 _parent;
私有字符串_name;
私有字符串_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;
}
……
我想要实现的是,比如我创建一个自定义文化en-AU-abc,当前页面可以使用本地资源文件Default.aspx.en-AU-abc.resx,
但我无法让它工作,当前页面总是加载 Default.aspx.resx