locked
Add new language after web site was published on server RRS feed

  • Question

  • User1485056917 posted

    Hi,

    I have developped an web site using ASP.Net 2.0 including many languages (englisg, french, german, spanish, italian). This web site is delivered to many sites (web site used in intranet). For some sites, they want to add a new language (deutch for example). I cannot deliver an new version including this new languages, so I have to add languages dynamically on site.

    Do you know what will be the best solution to add this new language dynamically on site?

    My first idea was to develop a small tool to browse all ressources in App_GlobalResources.dll, ask user to enter the translations and create a new DLL. Do you know how can I browse for resources? I try the following code, but it does not work:

    ResourceManager rm = new ResourceManager("App_GlobalResources.dll", Assembly.GetExecutingAssembly());
    ResourceSet rs = rm.GetResourceSet(CultureInfo.InvariantCulture, true, true);
    string s = rs.GetString("Text1");

    I have the following error: "Could not find any resources appropriate for the specified culture or the neutral culture". I'm sure that the DLL contains the resources because the web site is well displayed.

    Any idea to help me?

    Thanks a lot

    Francois

    Thursday, May 19, 2011 3:30 AM

Answers

  • User377791177 posted

    localization doesn't need any coding except for the language selector (dropdown,image buttons showing country flag etc... ) and UICulture setting. rest of the things r done by .NET framework. so after that you only need to declare your controls this way

    <asp:Label runat="server" id="Label1" meta:resourcekey= "Label"/>

    and have individual language resource files

    page.aspx.en-GB.resx

    Label.Text="Hello";

    page.aspx.fr.resx

    Label.Text="bon jour";

     

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, May 19, 2011 6:02 AM