e0e1373468
* Update prettier to latest * Add format command * Create .prettierignore * Add prettier plugin sort imports * Update prettier config * Update prettier config * Update .prettierignore * Fix @babel/parser conflict https://github.com/trivago/prettier-plugin-sort-imports/issues/156 * Revert "Update .prettierignore" This reverts commit 282e5b838376f16b3df7f4c1f99f1106baaffea4. * Revert change for apps/www/pages/v/[id].tsx * Sort imports Moves the third party imports to the top, "~" imports in middle, and "./" at last * Sorting of the specifiers in an import declarations * [www] use path vs "../" * [core] use path "~" vs "../" * [tldraw] use path "~" vs "../.../" * [tldraw] use path "~" vs "../" * [tldraw] Cleanup * Update prettier config * Last use path "~" vs "../.../" * [www] Fix order of the third party imports * Clean prettier config
48 lines
1.4 KiB
Markdown
48 lines
1.4 KiB
Markdown
# Translation
|
|
|
|
Thanks for your interest in translating tldraw! This file has instructions for updating a translation or creating a new translation.
|
|
|
|
## Update an Existing Translation
|
|
|
|
Want to update or correct an existing translations?
|
|
|
|
Create a new branch on Github.
|
|
|
|
Open the language file in `packages/tldraw/src/translations`
|
|
|
|
Make whichever changes you like.
|
|
|
|
Submit your branch as a PR on Github.
|
|
|
|
## Add a New Translation
|
|
|
|
Want to add a new language to our translations?
|
|
|
|
Create a new branch on Github.
|
|
|
|
In the `packages/tldraw/src/translations` folder, duplicate the `main.json` file.
|
|
|
|
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'
|
|
import en from './en.json'
|
|
// import here ↲
|
|
import eo from './eo.json'
|
|
|
|
export const TRANSLATIONS: TDTranslations = [
|
|
// Default language:
|
|
{ code: 'en', label: 'English', messages: en },
|
|
// Translations:
|
|
{ code: 'ar', label: 'عربي', messages: ar },
|
|
{ code: 'eo', label: 'Esperanto', messages: eo }, // <-- add an entry here
|
|
]
|
|
```
|
|
|
|
Translate the messages in the new file from English to your language.
|
|
|
|
That's it!
|
|
|
|
Submit your branch as a PR on Github.
|