获取可用(语言)resx 文件的列表
许多程序都有社区,在应用程序发布后向其添加语言。
因此,在程序的设置窗口中,人们可以看到可用语言的下拉列表。 那么,人们在使用 resx 文件进行本地化时如何编码呢? 我在网上搜索了一遍又一遍,但找不到任何答案。
一切都运行良好,但现在,我需要制作一个可用语言的下拉列表。 为了明确起见,我不想每次有人为该程序创建一种新语言时就发布一个新版本..因为如果我必须制作一个可供选择的语言的硬编码列表,那就是我必须做的。
如何获取可用 resx 文件的列表?
Many many programs have communities that adds languages to the application after it got released.
So, in the settings window of a program, people can see a dropdown list of available languages. Well how do people code this while using resx files for localization? I've searched the web over and over again, but couldn't find any answer.
everything is working well, but now, i need to make a dropdown list of available languages. To make it clear, i do not want to release a new version every time someone created a new language for the program.. because that's what i have to do if i have to make a hardcoded list of languages that are available to pick.
How do i get a list of available resx files?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好吧,即使您可以获得一个列表(我可以通过检查文件系统来猜测),根据您实现本地化的方式,它可能不准确(可能没有提供翻译)您正在寻找的特定 .resx)。
我建议最好的方法是在某个地方(或数据库)的 .config 中。 这样您就可以独立于 .resx 系统禁用语言; 这是不可避免会出现的事情。
Well, even if you could get a list (and you can I guess, by inspecting the filesystem), depending on how you implemented your localisation, it may not be accurate (may have not provided a translation for the specific .resx you're looking for).
I'd suggest the best way to do this is in a .config somewhere (or database). That way you can disable languages independantly of the .resx system; which is something that will inevitably come up.
您可以以编程方式列出应用程序中可用的文化。 此处描述了该方法
You can programatically list the cultures available in your application. The approach is described here