You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
1.7 KiB

  1. # How to translate the QMK docs into different languages
  2. All files in the root folder (`docs/`) should be in English - all other languages should be in subfolders with the ISO 639-1 language codes, followed by `-` and the country code where relevant. [A list of common ones can be found here](https://www.andiamo.co.uk/resources/iso-language-codes/). If this folder doesn't exist, you may create it. Each of the translated files should have the same name as the English version, so things can fall back successfully.
  3. A `_summary.md` file should exist in this folder with a list of links to each file, with a translated name, and link preceded by the language folder:
  4. * [QMK简介](zh-cn/getting_started_introduction.md)
  5. Once you've finished translating a new language, you'll also need to modify the following files:
  6. * [`docs/_langs.md`](https://github.com/qmk/qmk_firmware/blob/master/docs/_langs.md)
  7. Each line should contain a country flag in the format `:us:` followed by the name represented in its own language:
  8. - [:cn: 中文](/zh-cn/)
  9. * [`docs/index.html`](https://github.com/qmk/qmk_firmware/blob/master/docs/index.html)
  10. Both `placeholder` and `noData` objects should have a dictionary entry for the language folder in a string:
  11. '/zh-cn/': '没有结果!',
  12. ## Previewing the translations
  13. Before opening a pull request, you can preview your additions if you have Python 3 installed by running this command in the `docs/` folder:
  14. python -m http.server 9000
  15. and navigating to http://localhost:9000/ - you should be able to select your new language from the "Translations" menu at the top-right.
  16. Once you're happy with your work, feel free to open a pull request!