使用资源文件在 ASP.NET 中进行本地化
我正在 asp.net 中开发一个双语 Web 应用程序,在尝试使用资源文件实现双语系统时遇到了拦截器。我在“asp.net特殊文件夹App_GlobalResources”中有三四个资源文件,即
common.resx 页面.resx reports.resx
所有文件都包含我在应用程序中使用的相应键值对。现在,我在同一文件夹中还有另一组法语资源文件,后缀为“_fr”。
当用户单击页面中的更改语言时,我希望应用程序使用 _fr 后缀资源文件。这可行吗?
I am developing a bilingual web application in asp.net and ive ran into a blocker while trying to implement the bilingual system using a resource file. I have three four resource files in the "asp.net special folder App_GlobalResources" namely
common.resx
pages.resx
reports.resx
All the files contains respective key value pairs which i ve used in my application. Now i also have another set of resource files in the same folder for french with suffix "_fr".
When a user clicks change language in the page i want the application to use the _fr suffix resource files. Is this doable?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
将自动选择具有给定文化的资源文件。您只需重写
InitializeCulture()
页面方法即可。Resource file with given culture will be selected automatically. You just have to override the
InitializeCulture()
page method.检查一次。它可能对你有帮助
全球化和本地化网站
Check this once. It may help u
Globalizating and localizing WebSite