- Spanish
- French
- Hindi
- Dutch
- Chinese
Translations are provided directly within the plugin and are available in /src/i18n/lang/[language].
To create a new translation, follow this checklist:
- Create a new folder using the languages ISO 639-1 language code format.
- Copy the
index.tsfile from/src/i18n/lang/eninto your new folder. - Run
yarn translate. This should automatically translate the files using Google translate. You might encounter errors for obscure languages. You should then take a look at the generated translations to confirm the correctness of the translation. - Import the file and add to the
resourcesvariables using the ISO code.
const resources = {
en: {
translation: enTranslations,
},
fr: {
translation: frTranslations,
},
//Add here
}- Add to the
languagesvariable
export const languages = [{
title: 'English',
code: 'en',
},
{
title: 'French',
code: 'fr',
},
//Add here
];- Build the plugin and confirm that the translations are correct
We use the VSCode extension i18n-ally to handle translations.
https://github.com/lokalise/i18n-ally
For the extension to work, requires these settings:
# .vscode/settings.json
{
"i18n-ally.localesPaths": [
"src/i18n/lang"
],
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.json",
"i18n-ally.keystyle": "nested",
"i18n-ally.extract.keygenStyle": "camelCase"
}