[英]Can any one give me Dotnetnuke module localization with example
please any one can provide me a good example of dotnetnuke module localization....i am new to DNN...thanks.. 请任何人都可以为我提供dotnetnuke模块本地化的好例子....我是DNN的新手......谢谢..
Edit : I have googled a lot haven't found any good example 编辑 :我google了很多没有找到任何好的例子
first add your language to DNN (in DNN6 go to Admin -->languages and add your language) your module have App_LocalResouces folder .this folder have resx files.for localization you must use this files. 首先将您的语言添加到DNN(在DNN6中转到管理员 - >语言并添加您的语言)您的模块具有App_LocalResouces文件夹。此文件夹具有resx文件。对于本地化,您必须使用此文件。 for every resx file you must add a new resx file for your language.
对于每个resx文件,您必须为您的语言添加新的resx文件。 for example if your culture name is "fa-IR", and you have a resx file with name "Edit.ascx.resx", you should make a copy from this file and change name of this copy to "Edit.ascx.fa-IR.resx" .
例如,如果您的文化名称是“fa-IR”,并且您有一个名为“Edit.ascx.resx”的resx文件,则应从该文件复制并将此副本的名称更改为“Edit.ascx.fa” -IR.resx“。 and then translate this new resx file items to your language if you want to add items to this resx file you should use resoursekey element in your ascx file for example:
然后,如果要将项目添加到此resx文件,则应将此新的resx文件项目翻译为您的语言,您应该在ascx文件中使用resoursekey元素,例如:
<asp:Label ID="lblExample" runat="server" resourcekey="lblExample">
and then in both resx files add lblExample key and its value if you want use value of this controls in your code add this to your code 然后在两个resx文件中添加lblExample键及其值,如果你想在代码中使用这个控件的值将它添加到你的代码中
string lblMessage;
lblMessage = Localization.GetString("lblExample", this.LocalResourceFile);
you can replace "this.LocalResourceFile" with address of your resx file 你可以用你的resx文件的地址替换“this.LocalResourceFile”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.