With the rapid popularization and development of software applications, the application software is faced with the problem of supporting multinational multi-language internationalization, and the Windows based batch files are widely used, however, as a general-purpose scripting language, batch scripts do not provide a kind of systematic and multi-language internationalization support. This paper first introduces the programming language and the international standardization of the efforts to multi-language problems; Secondly, the flexible architecture design of universal multi-language support solution is given. Thirdly, the paper gives the lightweight and flexible architecture of the batch file, which is a universal multi-language support solution. And the general steps of building a batch-processing software system supporting multi-language based on the solution, and finally making some summary and prospect.
Background
The rapid development and expansion of software applications, and gradually penetrate into all walks of life, more and more countries and regions to recognize the importance of computer software, a large number of applications used in day-to-day living and work. Small to a music playback software, large to the operating system, are widely used. However, a large number of computer software applications are facing a very serious problem, internationalization issues. As countries have different languages, and different areas of the same country have different language habits, such as Chinese mainland and Taiwan, but because of the different language habits, the mainland uses Simplified Chinese, the Taiwan region uses traditional Chinese. For an application to be a good localization effect, you should take into account the user's language habits, such as Windows XP system including Chinese Simplified XP system, Chinese Traditional system, English system and so on. Any Cross-border software will encounter such a problem, the solution and implementation of this problem is called internationalization, the so-called internationalization is internationalization, referred to as i18n.
A batch script is a script that is directly supported on Windows. With its simplicity, convenience, rapid and widespread direct application or indirect application to a large number of software applications, however, as a common scripting language does not provide a system of multi-language internationalization support, greatly restricting the use of this simple, convenient language, This paper proposes an efficient multi-language support solution for batch scripting languages.
Internationalization support for the Java language
The Java language provides a Java.util.Locale class for multilingual environment processing, and Locale objects represent specific geographic, political, and cultural areas. Operations that require Locale to perform their tasks are called locale-sensitive operations that use Locale to tailor information to the user. For example, displaying a numeric value is a locale-sensitive operation that should be formatted according to the customs/traditions of the user's country, region, or culture. Use the constructor method in this class to create the Locale:
Locale(String language)
Locale(String language, String country)
Locale(String language, String country, String variant)
The language language parameter is a valid ISO language code. These codes are lowercase two-letter codes defined by ISO-639.
ISO Language code for table one language parameter
english Name of Language |
all 中文版 Names |
all French the Names |
iso 639_2 |
iso 639_1 |
chinese |
chinois | TD style= "BORDER:0;PADDING:0;" >chi/zho
zh |
english |
english |
anglais |
eng |
french |
french |
français |
fr |
The country country/region parameter is a valid ISO country/region code. The code is an uppercase two-letter code defined by ISO-3166.
Table two language parameters ISO country/region code
Country names |
ISO 3166-1-alpha-2 Code |
The |
CN |
TAIWAN, Province of |
TW |
UNITED STATES |
US |
UNITED Kingdom |
GB |
FRANCE |
FR |
Based on the ISO language code and country/region code we can use a "language-country" format, such as the Chinese language habits can be expressed as "ZH-CN", Chinese Taiwan's language habits can be expressed as "ZH-TW" and so on.
The Java language makes full use of Locale objects to process and design language habits. Most of the applications based on JAVA language make full use of this feature for multi-language architecture design. For example, the Struts framework, in the context of multilingual processing, combines the features of WEB applications to fully use the multilingual nature of JAVA, and multilingual processing follows the logic that if a user chooses a language custom Locale, the information is stored in the user's session and read again first to check session information. Then, the language habit Locale in the conversation is mapped to the information file, if the session information does not exist, the Request object is used to read the system Locale information of the client browser, and then the information is parsed, then the corresponding language habits can be mapped into the corresponding language habits file.