From 35446cdb3a38e5df4242050e877dd33f45f0156b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20D=2E=20D=C3=ADaz?= Date: Mon, 12 Feb 2024 21:48:30 +0100 Subject: [PATCH] add: documentation --- docs/translations.md | 20 ++++++++++++++++++++ package.json | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 docs/translations.md 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",