简体   繁体   中英

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..

Edit : I have googled a lot haven't found any good example

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. for every resx file you must add a new resx file for your language. 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" . 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:

  <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

  string lblMessage;
  lblMessage = Localization.GetString("lblExample", this.LocalResourceFile);

you can replace "this.LocalResourceFile" with address of your resx file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM