【发布时间】:2012-08-28 03:05:57
【问题描述】:
这是在 VSTO Word Addin 中实现本地化的正确方法吗?现在我只是遵守命名约定,将当前文化附加到它搜索的资源文件中。我已经阅读了足够多的不同材料来混淆,一种方法是使用 Resgen.exe 然后 Al.exe 生成 .dll 但我不明白为什么,它能够更新语言而无需重新编译?
System.Resources.ResourceManager resMgr;
System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
try
{
// somehow I feel this isn't how it was meant to be? but it works
resMgr = new System.Resources.ResourceManager("MyAddin.MyLocalisation." + ci, Assembly.GetExecutingAssembly());
string title = resMgr.GetString("MyTitle");
}
【问题讨论】:
标签: c# .net localization vsto