Update translation.md

This commit is contained in:
Steve Ruiz 2022-06-26 08:33:08 +01:00 committed by GitHub
parent 026177a1e1
commit 574b29ebdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,15 +27,17 @@ Rename the new file to the [language code](https://gist.github.com/wpsmith/76048
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'
import en from './en.json'
import eo from './eo.json' // +
import ar from './ar.json'
import eo from './eo.json' // <-- import here
export const TRANSLATIONS = {
export const TRANSLATIONS: TDTranslations = [
// Default language:
{ code: 'en', label: 'English', messages: en },
// Translations:
{ code: 'ar', label: 'عربي', messages: ar },
{ code: 'eo', label: 'Esperanto', messages: eo }, // +
} as const
{ code: 'eo', label: 'Esperanto', messages: eo }, // <-- add an entry here
]
```
That's it!