Skip to content

Commit

Permalink
add: documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Tardo committed Feb 12, 2024
1 parent b7c2a09 commit 35446cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions docs/translations.md
Original file line number Diff line number Diff line change
@@ -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 / <NEW LANGUAGE TAG> / *.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).
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 35446cd

Please sign in to comment.