diff --git a/docs/translations.md b/docs/translations.md new file mode 100644 index 00000000..689bf8c0 --- /dev/null +++ b/docs/translations.md @@ -0,0 +1,20 @@ +# Modify an existing language + +Go to `_locales` folder, select the language and edit the `.json` files. + +# Add a new language + +1. Edit `package.json / babel / plugins / "i18next-extract" / locales` to + include the new language tag. +2. Edit + `src / js / page / loader.mjs / function initTranslations / supportedLngs` to + include the new language tag. +3. Run `npm install` (If the project is already installed, skip this step.) +4. Run `npm run dev:rollup` +5. Edit `_locales / / *.json` files + +\*\* You can use https://r12a.github.io/app-subtags/ to `check` if the new +language tag is valid. + +**IMPORTANT:** Hyphen-separated tags must use 'underscore' (ex. en-US --must +be--> en_US). diff --git a/package.json b/package.json index 52116b0a..10578552 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "prepare": "husky install", "release": "node scripts/release.mjs", "clean": "rm -rf ./dist", - "dev:babel": "export ODOO_TERMINAL_ENV=development && babel --quiet 'src/**/*.{js,mjs}'", - "dev:watch": "export ODOO_TERMINAL_ENV=development && rollup -c -w", + "dev:rollup": "export ODOO_TERMINAL_ENV=development && rollup -c", + "dev:rollup:watch": "export ODOO_TERMINAL_ENV=development && rollup -c -w", "dev:tests": "export ODOO_TERMINAL_ENV=development && node scripts/build.mjs && poetry run pytest", "prod:build": "export ODOO_TERMINAL_ENV=production && node scripts/build.mjs", "start:firefox": "export ODOO_TERMINAL_ENV=development && node scripts/build.mjs && web-ext run --verbose -t firefox-desktop",