Search code examples
localizationinternationalizationdotnetnukedotnetnuke-module

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?


Solution

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