Update translation.md
This commit is contained in:
parent
3cba9712fd
commit
3b0f9b143e
1 changed files with 7 additions and 3 deletions
|
@ -22,7 +22,9 @@ Create a new branch on Github.
|
||||||
|
|
||||||
In the `packages/tldraw/src/translations` folder, duplicate the `en.json` file.
|
In the `packages/tldraw/src/translations` folder, duplicate the `en.json` file.
|
||||||
|
|
||||||
Rename the new file to [language code](https://gist.github.com/wpsmith/7604842) for that language. For example, if you were making an Esperanto translation, name the new file `eo.json`. 4. In the `packages/tldraw/src/translations/translations.ts` file, import your file and create a new entry in to the `TRANSLATIONS` array like this:
|
Rename the new file to the [language code](https://gist.github.com/wpsmith/7604842) for that language. For example, if you were making an Esperanto translation, name the new file `eo.json`.
|
||||||
|
|
||||||
|
In the `packages/tldraw/src/translations/translations.ts` file, import your file and create a new entry in to the `TRANSLATIONS` array like this:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import ar from './ar.json'
|
import ar from './ar.json'
|
||||||
|
@ -30,10 +32,12 @@ import en from './en.json'
|
||||||
import eo from './eo.json' // +
|
import eo from './eo.json' // +
|
||||||
|
|
||||||
export const TRANSLATIONS = {
|
export const TRANSLATIONS = {
|
||||||
{ code: 'ar', label: 'عربي', messages: ar },
|
|
||||||
{ code: 'en', label: 'English', messages: en },
|
{ code: 'en', label: 'English', messages: en },
|
||||||
|
{ code: 'ar', label: 'عربي', messages: ar },
|
||||||
{ code: 'eo', label: 'Esperanto', messages: eo }, // +
|
{ code: 'eo', label: 'Esperanto', messages: eo }, // +
|
||||||
} as const
|
} as const
|
||||||
```
|
```
|
||||||
|
|
||||||
|
That's it!
|
||||||
|
|
||||||
Submit your branch as a PR on Github.
|
Submit your branch as a PR on Github.
|
||||||
|
|
Loading…
Reference in a new issue