|
1 | 1 | # Contributing
|
2 | 2 |
|
3 | 3 | ## Translating
|
| 4 | +> [!NOTE] |
| 5 | +> For each missing/empty translation string, there will be a warning in the console. |
| 6 | +
|
4 | 7 | For translations, the target language of this site is English, so you should base your translations off of that.
|
5 | 8 |
|
6 | 9 | under [/src/Assets/L10N](/src/Assets/L10N) there are JSON files for the existing supported languages.
|
7 |
| -For adding your own, copy the en-us.json file and rename it with the correct locale code for the targeted language. (e.g Japanese would be `ja.json`) |
| 10 | +For adding your own, copy the [en-us.json](/src/Assets/L10N/en-us.json) file and rename it with the correct locale code for the targeted language. (e.g Japanese would be `ja.json`) |
8 | 11 |
|
9 |
| -To have the language work on the site, go to [main.ts](/src/main.ts#L29) and add a new line. |
| 12 | +To have the language work on the site, add the language translation to the JSON file, then go to [main.ts](/src/main.ts#L29) and add a new line. |
10 | 13 | The line should look like this (using Japanese as an example):
|
11 | 14 | ```register('ja', () => import('./Assets/L10N/ja.json'));```
|
12 | 15 |
|
13 | 16 | Which boils down to:
|
14 |
| -```register('locale-code', () => import('./Assets/L10N/locale-code.json'));``` |
| 17 | +```register('language-code', () => import('./Assets/L10N/language-code.json'));``` |
| 18 | + |
| 19 | +To find a list of Language Codes using Firefox, go to `about:preferences`, search `language`, and choose `Choose your preferred language for displaying pages`, then find your language and look at the code (in the square brackets) |
| 20 | + |
| 21 | +You can also find the language code of the currently used Navigator language by opening devtools and typing `console.log(navigator.language);`. |
| 22 | + |
| 23 | +After verifying that the translations show correctly, and following the [guidelines](#guidelines), you can add yourself to [the credits](/src/App.svelte#L80) and then make a pull request to submit the translation. |
15 | 24 |
|
16 |
| -For each missing/empty translation string, there will be a warning in the console. |
| 25 | +### Guidelines |
| 26 | +1. Do not translate "`Project Lodestone`" |
| 27 | +2. Do not translate the Edition names unless an edition had official translations that clearly show how it's meant to be translated. |
17 | 28 |
|
18 |
| -After verifying that the translations show correctly on the site, you can add yourself to [the credits](/src/App.svelte#L80) and then make a pull request to submit the translation. |
|
0 commit comments