一个字符串,在code在一个localresource文件后面翻译 [英] Translation of a string in code behind in a localresource file

查看:129
本文介绍了一个字符串,在code在一个localresource文件后面翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的本地资源文件的VisualStudio(的.resx和.fr.resx)的每一页。 控件所有在.aspx页面中的文本,现在可以翻译。

I created local resource files with VisualStudio (.resx and .fr.resx) for each page. All the text of controls in the .aspx page can be translated now.

但我也是在这个loacal资源文件翻译在我的code字符串后面? 如果是的话,我怎么能读code值身后走出我的本地.resx文件在我App_LocalResources文件映射?

But can I also translate strings in my code behind in this loacal resource file? If yes, how can I read the value in code behind out of my local .resx files in my App_LocalResources map?

推荐答案

您可以试试......

you can try...

乌斯只需调用GetLocalResourceObject方法在你的当前页面:

ust simply call the GetLocalResourceObject method on your current page:

GetLocalResourceObject("yourkey").ToString();

GetGlobalResourceObject("MyGlobalResources", "HelloWorldString").ToString();

这篇关于一个字符串,在code在一个localresource文件后面翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆