What’s your opinion for the best possible way to build asp.net multilingual localized web application (only UI localization of string resources). Especially this two things:
- How to store resources? Xml files, resx files or something else?
- How to handle URL’s? I don’t want to keep language parameter in query string all the time so I need to use URL rewriting maybe?
/BR
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Have you looked into the localization support in ASP.NET? It uses resource assemblies and sets the default resource based on the browser’s settings. You can also override the setting by setting the culture and uiculture settings for the thread handling the request.
If you don’t like using the resource assemblies (which do require a project rebuild when you want to make changes), you can also create a custom resource provider for ASP.NET (this link uses MS Access as an example, you can try to customize it for SQL or some other provider).
http://asp.net has some tutorials to get you started, like this one.
Method 2
Use Data Driven ASP.NET Localization Resource Provider as described in http://www.west-wind.com/presentations/wwdbresourceprovider/
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0