Implement multi-language software menus

Source: Internet
Author: User

Most of the current software has a trend of multi-country development. To write a software program, consider the use of other non-local users. The most important thing is to make menus multilingual.

First, you need to prepare the properties file. Several files must be prepared in several languages.

For example, resources_en.properties in English, resources_zh.properties in Chinese, resources_ja.properties in Japanese, and so on.

The content is saved as the text to be displayed in the menu. For example, in an English property file, there is a definition: settings = settings, which must also have the corresponding definition: settings = xxx. XXX is a character obtained by converting Chinese or Japanese to Unicode, for example, "/u80fd/u530d ".

The content of the locale and resourcebundle classes is mainly used in the encoding process. In this way, the program automatically corresponds to the required attribute file, obtains the value of a specific string, and then displays menus in different languages. Let's take a look at the JDK and try to write code segments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.