Hello, Iām working on localizing my custom DNN module (C#, ASP.NET).
š Iām following the standard approach:
I created App_LocalResources/View.ascx.resx
and View.ascx.fr-FR.resx
The files contain a key:
<data name="msg" xml:space="preserve">
<value>Congrats !!</value>
</data>
My code:
string resourceFile = this.TemplateSourceDirectory + "/App_LocalResources/View.ascx";
string message = Localization.GetString("msg", resourceFile);
lblMessage.Text = message ?? "Key not found";
or
lblMessage = Localization.GetString("msg", this.LocalResourceFile);
fr-FR
(I forced it in code for testing).ā
The resource files are in the right folder.
ā
The key exists and matches exactly.
ā
The file name matches (View.ascx.fr-FR.resx).
ā **But Localization.GetString always returns null.
What I checked:**
The LocalResourceFile
is correct: /DesktopModules/MyModule/App_LocalResources/View.ascx
I cleared the DNN cache and restarted the app pool
File encoding is UTF-8
Permissions on the .resx file are OK
My question:
ā” Does anyone have a working example where Localization.GetString
reads App_LocalResources successfully without modifying the web.config (i.e. without re-enabling buildProviders for .resx)?
ā” Could there be something else blocking DNN from loading the .resx files (for example, a hidden configuration or DNN version issue)?
Thanks for your help!