Last post May 19, 2011 06:02 AM by shashankgwl
May 19, 2011 03:30 AM|drouhne|LINK
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
May 19, 2011 06:02 AM|shashankgwl|LINK
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