Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Module Localization in DNN

I don't know much about the localization process in DNN. The question is that how can you localize a new module?

Is it possible to include localization files with every module separately? What solutions can you come up with?

like image 963
Manoochehr Avatar asked Apr 29 '11 08:04

Manoochehr


1 Answers

Localization of a module is pretty easy thanks to DotNetNuke.

Wherever your .ascx (View) file is, the App_LocalResources folder should always accompany it, on the same level. There should also be a corresponding .ascx.resx file in that folder.

view.ascx
App_LocalResources
- view.ascx.resx

Once you have that structure in your module. DNN will pick the file up immediately.

To use that resource strings in the resx. Simple tack on the ResourceKey property to the end of your asp controls. e.g.

<asp:Label ID="lblExample" runat="server" ResourceKey="lblExample" />

You should have a lblExample.Text in your resx file which matches up with that label. Note that it adds .Text to it automatically.

If it's not showing up, there are a few things to check

  1. LocalResourceFile property in code. What location is it pointing to?
  2. set ShowMissingKeys=true in web.config and you'll see what resource strings you're missing.
like image 71
karbonphyber Avatar answered Sep 23 '22 23:09

karbonphyber