|
5 | 5 | The following tasks are required to add a new language. |
6 | 6 | [See available code here](https://github.com/angular/angular/tree/master/packages/common/locales). |
7 | 7 |
|
8 | | -- Copy production into the configurations section of angular.json to create production build settings for the language. |
9 | | -- Add rewrites for the language to the `rewrites` of `firebase.json`. |
10 | | -- Add languages to the languages in `xliffmerge.json` (And do `yarn i18n`). |
| 8 | +- Add word transration file in `src/assets/i18n/[lang-code].json`. |
11 | 9 | - Add languages to `langages`, an array of `tools/utils.ts` files. |
12 | | -- Let's make build environment for language in `build:ssr` in scripts of package.json. |
13 | | -- Register localeData of the language to be added to `app.module.ts` using `registerLocaleData()`. |
14 | | -https://angular.io/guide/i18n#i18n-pipes |
15 | | -- Add a language to the languages propety of `src/app/shared/footer/footer.component.ts`. |
| 10 | +- Register langage code of the language to be added to `translocoConfig()` in `src/app/app.module.ts`. |
16 | 11 | - Make a target language directory by copying `en-US` in the content directory. And then run `yarn build-content`. |
17 | 12 |
|
18 | 13 | Hooray! Now you can choose a new language. |
19 | 14 |
|
20 | 15 | ## Do translation |
21 | 16 |
|
22 | | -There are two types of translation: translation of the application using angular i18n and translation of the main content composed of markdown. |
| 17 | +There are two types of translation: translation of the application using [transloco](https://netbasal.gitbook.io/transloco/) and translation of the main content composed of markdown. |
23 | 18 |
|
24 | 19 | ### Application translation |
25 | 20 |
|
26 | | -Please read the [angular i18n](https://angular.io/guide/i18n) documentation once. |
| 21 | +Please read the [transloco](https://netbasal.gitbook.io/transloco/) documentation once. |
27 | 22 |
|
28 | | -Translate the app by editing `src/locale/messages.[language code].xlf`. |
29 | | -It is difficult to edit xlf file manually, so use something like a tool. |
30 | | - |
31 | | -Tool Example: https://poedit.net/ |
| 23 | +Translate the app by editing `src/assets/i18n/[lang-code].json`. |
32 | 24 |
|
33 | 25 | ### Translation of content |
34 | 26 |
|
35 | | -Translation of content is editing files in the `content/[target lang]` directory. |
| 27 | +Translation of content is editing files in the `content/[lang-code]` directory. |
36 | 28 |
|
37 | 29 | You don't have to make all the files at once. but when it's missing it will be displayed in original English. |
38 | 30 |
|
|
0 commit comments