Update translation.md

This commit is contained in:
Steve Ruiz 2022-06-25 20:37:00 +01:00 committed by GitHub
parent 3cba9712fd
commit 3b0f9b143e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,9 +20,11 @@ Want to add a new language to our translations?
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
import ar from './ar.json'
@ -30,10 +32,12 @@ import en from './en.json'
import eo from './eo.json' // +
export const TRANSLATIONS = {
{ code: 'ar', label: 'عربي', messages: ar },
{ code: 'en', label: 'English', messages: en },
{ code: 'ar', label: 'عربي', messages: ar },
{ code: 'eo', label: 'Esperanto', messages: eo }, // +
} as const
```
That's it!
Submit your branch as a PR on Github.