Skip to content

15. Support for multiple languages

Ilkka Seppälä edited this page Jul 7, 2020 · 7 revisions

Overview

We have multiple ways how the user can approach the repository:

  1. Browse the Github repository directly https://github.com/iluwatar/java-design-patterns
  2. Use the web site https://java-design-patterns.com

At the moment everything is in English but we need to add translations for several other languages. For scenario 1) the user can browse to the correct language file and for scenario 2) we will provide a language selector component in the top navigation.

For general discussion about internationalization see https://github.com/iluwatar/java-design-patterns/issues/1245

Technology selection

We have been evaluating https://gitlocalize.com/ and decided to use that for translations.

organization rules of translated files

at the moment,there are two ways to organize translated files.

append language code

As we known, the most file name is "README.md", So, It's very clearly that name the translated files through filename and language code, and then separate by "_". And the translated file is as same as the directory of original file. For example, the simplified Chinese files should like this:

README_zh-CN.md, And the directory structure:

  • etc
  • src
  • README.md
  • README_zh-CN.md
  • README_fr-BE.md
  • pom.xml

Create a directory named after the language code

the translated file still use the original name,just put it in a directory named after the language code.

  • etc
  • src
  • zh-CN
    • README.md
  • fr-BE
    • README.md
  • README.md
  • pom.xml

Language code

See this page to find information about language code (tags).https://en.wikipedia.org/wiki/Language_localisation

Contribute

It' s a very huge task to translate the whole repo into several languages. Join us if you interested in this repo. Translate docs in your language so that more people can get to known this repo.