I've been searching on SO on how to do i18n support on my little application...
我一直在搜索如何在我的小应用程序上支持i18n ...
I know that Microsoft offers 'culture' classes, but you have to re-compile your application to include any new string you add. So, all I'm trying to do is to put all my strings in a external file and offers users the choice to translate the app without the need to recompile.
我知道Microsoft提供了“文化”类,但您必须重新编译应用程序以包含您添加的任何新字符串。因此,我所要做的就是将所有字符串放在外部文件中,并为用户提供翻译应用程序的选择,而无需重新编译。
Is there an easy way to handle this ? Use XML, or INI-like ? any Tutorial available ? P.S: Trying to do this on C#... Don't bother if other languages
有一个简单的方法来处理这个?使用XML,还是INI?任何教程可用吗? P.S:尝试在C#上做这个...如果其他语言不要打扰
2 个解决方案
#1
1
Here is a nice blog post from Scott Hanselman which contains several good resources: http://www.hanselman.com/blog/ASPNETInternationalizationGlobalizationAndLocalizationWhew.aspx
以下是来自Scott Hanselman的精彩博文,其中包含几个不错的资源:http://www.hanselman.com/blog/ASPNETInternationalizationGlobalizationAndLocalizationWhew.aspx
Generally speaking I can say that you will want to keep your resources external to your binaries (using something like a .resource file), which will allow you to add/edit resources without a recompile. I've not done much myself, so I'm a bit rusty on the whole thing.
一般来说,我可以说你希望将资源保存在二进制文件外部(使用.resource文件之类的东西),这样你就可以在不重新编译的情况下添加/编辑资源。我自己也没多做,所以整个事情我都有点生疏了。
Hope this is helpful.
希望这有用。
#2
0
if you include a new string in your app, you have to recompile it anyway, do you not?
如果你在你的应用程序中包含一个新字符串,你必须重新编译它,不是吗?
if you add languages often, resource files and/or satellite DLLs are probably your best bet
如果您经常添加语言,资源文件和/或附属DLL可能是您最好的选择
failing that, you can write your own provider. Here are some links I found useful, your mileage may vary:
没错,你可以写自己的提供者。以下是我发现有用的一些链接,您的里程可能会有所不同:
http://en.csharp-online.net/Localization_Like_the_Pros
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=211
http://www.codeproject.com/KB/aspnet/DeclarativeGlobalization.aspx
用于网页的MS工具包
#1
1
Here is a nice blog post from Scott Hanselman which contains several good resources: http://www.hanselman.com/blog/ASPNETInternationalizationGlobalizationAndLocalizationWhew.aspx
以下是来自Scott Hanselman的精彩博文,其中包含几个不错的资源:http://www.hanselman.com/blog/ASPNETInternationalizationGlobalizationAndLocalizationWhew.aspx
Generally speaking I can say that you will want to keep your resources external to your binaries (using something like a .resource file), which will allow you to add/edit resources without a recompile. I've not done much myself, so I'm a bit rusty on the whole thing.
一般来说,我可以说你希望将资源保存在二进制文件外部(使用.resource文件之类的东西),这样你就可以在不重新编译的情况下添加/编辑资源。我自己也没多做,所以整个事情我都有点生疏了。
Hope this is helpful.
希望这有用。
#2
0
if you include a new string in your app, you have to recompile it anyway, do you not?
如果你在你的应用程序中包含一个新字符串,你必须重新编译它,不是吗?
if you add languages often, resource files and/or satellite DLLs are probably your best bet
如果您经常添加语言,资源文件和/或附属DLL可能是您最好的选择
failing that, you can write your own provider. Here are some links I found useful, your mileage may vary:
没错,你可以写自己的提供者。以下是我发现有用的一些链接,您的里程可能会有所不同:
http://en.csharp-online.net/Localization_Like_the_Pros
http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=211
http://www.codeproject.com/KB/aspnet/DeclarativeGlobalization.aspx
用于网页的MS工具包