Here's how to help translate William278.net (this site) into different languages. The site files are located on GitHub. To get started, clone the site
git clone https://github.com/WiIIiam278/william278-site
Please note "joke" language translations are not accepted. English text on this site can be in either British/American English (I still accept PRs for typo corrections in English of course!).
Interface locales can be found in locales/en.json
. To create new locales for a language:
en.json
to get started)
locales/zh-cn.json
"language-zh-cn": "汉语"
locales
section of nuxt.config.js
{ code: 'zh-cn', iso: 'zh-cn', file: 'locales/zh-cn.json', dir: 'ltr' },
Additionally, you can translate the index page and docs homepage if you wish:
/content/index/
(e.g. /content/index/zh-cn.md
). Copy the contents of en.md
and translate accordingly./content/docs/home/en.md
(e.g. /content/docs/home/zh-cn.md
)Then submit a pull request!
The most valuable part of translating the site is to allow for international translations of project documentation.
Project docs for each language are located on each project repo within /docs/<language_code>/...
(English-language locales are in the root directory).
To create locales for a language, you'll need to git clone
the project repository and:
/docs/
and create a folder for the language
/docs/zh-cn/
/docs
directory. Do not change the file names!__Footer.md
.---
header section (see below)Home.md
file, please add your name under a Translation Credits
section.
Home
and in the __Sidebar.md
(e.g. MCBBS, etc.) ✅
Warning:Documentation file names must be the same! To change the name of the locale, you may simply add a---
header section (as below)
For each doc file, you should add a documentation header supplying a localized file name and locale. Add this to the top of each file, leaving a one-line space.
---
title: 'Translated Page Title'
locale: 'zn-cn' # replace this with your lang code
---