Brought from: http://salearningschool.com/displayArticle.php?table=Articles&articleID=1145&title=.Net:%20Globalizing%20Web%20Applications
Three ways of globalizing web-applications
- Create one for each culture/language - usually the web-interfaces. Redirect to a web-site built based on the current culture
- Write one web-application but detect current culture, then change the user interface (texts, date time formats) to represent the current culture - dynamically
- Satellite Based: Use resource files to keep culture specific messages. One resource file for one culture. Resource files will be in the format: key = value/message. Use the keys in the user interfaces. The keys will be replaced with the messages/values as stored in the resource files - based on current culture.
- Best Approach: Satellite Based
- Current culture: as set in the browsers/operating systems - or give culture/language change option on a button click
- How to detect current culture: Use CultureInfo, Calendar, and comparison classes
- Setting culture in the web.config file: Use the globalization element of the web.config file. You can set properties for each culture
- Satellite Based
- set the id and runat attributes for all the user-interface elements that require translation
- create a fallback resource file to keep default strings (key=value) (displays by default or no culture is set or culture is not recognized)
- create resource file for each culture that you want to support
- Use the ResourceManager class to load the resource files
- write code to detect the user's current culture.
- Write code to load strings from the resource files and display them
- Example:
using System.Globalization using System.Threading using System.Resources protected ResourceManager gStrings = new ResourceManager( "JustEtcWebAppsCS.strings", typeof(Satellite).Assembly); .. .. .. head1.InnerHtml = gStrings.GetString("satellite.head1");
From: http://sitestree.com/?p=3706
Categories:.Net Web Applications
Tags:
Post Data:2016-07-16 09:15:49
Shop Online: <a href='https://www.ShopForSoul.com/' target='new' rel="noopener">https://www.ShopForSoul.com/</a>
(Big Data, Cloud, Security, Machine Learning): Courses: <a href='http://Training.SitesTree.com' target='new' rel="noopener"> http://Training.SitesTree.com</a>
In Bengali: <a href='http://Bangla.SaLearningSchool.com' target='new' rel="noopener">http://Bangla.SaLearningSchool.com</a>
<a href='http://SitesTree.com' target='new' rel="noopener">http://SitesTree.com</a>
8112223 Canada Inc./JustEtc: <a href='http://JustEtc.net' target='new' rel="noopener">http://JustEtc.net (Software/Web/Mobile/Big-Data/Machine Learning) </a>
Shop Online: <a href='https://www.ShopForSoul.com'> https://www.ShopForSoul.com/</a>
Medium: <a href='https://medium.com/@SayedAhmedCanada' target='new' rel="noopener"> https://medium.com/@SayedAhmedCanada </a>