Recently I built a business ordering system for my unit. Since there are business offices in several countries around the world, the ordering system uses a multi-language interface. I implemented the multi-language by using the resource files of ASP.NET2.0. In fact, as far as I know, in addition to the resource file method, building multiple tables in the database to perform a regional culture mapping is also a way to solve internationalization (friends who are interested in this method can try it themselves)
Now I summarize the relevant knowledge used to achieve internationalization as follows:
Before summarizing the knowledge about globalization, let’s first understand a noun: expression syntax. Expression syntax format: <%$ ... %>
It is a new declarative expression syntax added to ASP.NET 2.0 that can replace values into the page before parsing the page.
ASP.NET expressions are a declarative way to set control properties based on information calculated at runtime.
ASP.NET expressions are mainly used in: connection strings, application settings, resource files, etc.
The basic syntax of ASP.NET expressions is as follows:
<%$ expressionPrefix: expressionValue %>
In fact, the implementation is relatively simple and only requires the following steps:
1. Create a global resource table
2. Store variables representing the current culture in the session, such as "en-us", "zh-cn"
3. Create the base class PageBase for all pages and override the InitializeCulture function
4. Text value on the page, expression syntax assignment
Expand