1
我试图让本地化在我的应用程序中工作。我的解决方案中有我的ui资源文件,名为“ui.resx”和“ui.de.resx”。但是,我的实现中的某些内容不正确,我很难过。C#本地化和资源文件
ResourceManager res_man;
CultureInfo culture;
string exception;
private void myForm_Load(object sender, EventArgs e)
{
culture = CultureInfo.CreateSpecificCulture("de");
res_man = new ResourceManager("MyApp.ui.resx", typeof(myForm).Assembly);
doTheThing();
}
private void doTheThing()
{
try
{
BTN_save.text = ui.SAVE;
//Do code here
}
catch(Exception e)
{
exception = e.toString();
}
}
当我运行程序时,它出现了错误和异常写着:
“异常:System.Resources.MissingManifestResourceException:找不到适合指定区域性或中性文化的资源确保“ui.resx.resources”在编译时正确嵌入或链接到程序集“myProgram”中,或者所有需要的附属程序集均可加载并完全签名。“
我改变了行,所以它包括 新的ResourceManager(“myApp.ui.resx”,typeof(myForm).Assembly); 它仍然是错误的。 – Dan
@dan从第一个参数中删除.resx并传递“MyApp.ui” –
@Dan让我知道它是否解决了问题。 –