From 574b29ebdd1d7689221b88b6fea06f18ac1f454a Mon Sep 17 00:00:00 2001 From: Steve Ruiz Date: Sun, 26 Jun 2022 08:33:08 +0100 Subject: [PATCH] Update translation.md --- guides/translation.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/guides/translation.md b/guides/translation.md index 596d7209a..28e187092 100644 --- a/guides/translation.md +++ b/guides/translation.md @@ -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!