Switch between English and Chinese in Android program

Source: Internet
Author: User
  • The start of the project did not take into account the English switch This is a very bad start. Until the completion of the basic project is not aware of the Chinese and English support.
  • It is best to plan the UI layout before the start of the project, and so on, after all, an English word is a lot longer than Chinese characters, and finally fill in the English words are often to adjust the UI and words to shorthand, this is a very confusing operation.

No way, the pit is still to be filled, write today in Android Studio how to achieve a project in English switch.

  • Start by creating new > Android Resource Directory under the res path.

  • Pop-up dialog box select Local

  • Select the region on the right, select the language to create, language: 中文版, Regin:us---OK.

  • After creation, switch to Project view, view the values there are two copies, Values-en-rus for the placement you just created, the following is the English strings created.
    • Values
    • Values-en-rus

  • File ready, then how to implement the program in English and Chinese switching it?
    In the project creation, the Languageutil implements the switching operation of the language.

Switch between English and Chinese in Android program

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.