From 2374bd490b2e9b409d8575ef99fcab54fe7e9253 Mon Sep 17 00:00:00 2001 From: Sudo-Ivan Date: Thu, 12 Mar 2026 15:43:48 -0500 Subject: [PATCH] Update README with instructions for adding langauge --- README.md | 26 ++++++++++++++++++++++++++ lang/README.de.md | 24 ++++++++++++++++++++++++ lang/README.it.md | 24 ++++++++++++++++++++++++ lang/README.ja.md | 24 ++++++++++++++++++++++++ lang/README.ru.md | 24 ++++++++++++++++++++++++ lang/README.zh.md | 24 ++++++++++++++++++++++++ 6 files changed, 146 insertions(+) diff --git a/README.md b/README.md index 7ececf3..d675791 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,32 @@ Security and integrity details: - Built-in integrity checks and HTTPS/WSS defaults in app runtime - CI scanning workflows in `.gitea/workflows/` +## Adding a Language + +Locale discovery is automatic. To add a new language, create a single JSON file: + +1. Generate a blank template from `en.json`: + +```bash +python scripts/generate_locale_template.py +``` + +This writes `locales.json` with every key set to an empty string. + +2. Rename it to your language code and move it into the locales directory: + +```bash +mv locales.json meshchatx/src/frontend/locales/xx.json +``` + +3. Set `_languageName` at the top of the file to the native name of the language (e.g. `"Espanol"`, `"Francais"`). This is displayed in the language selector. + +4. Translate all remaining values. + +5. Run `pnpm test -- tests/frontend/i18n.test.js --run` to verify key parity with `en.json`. + +No other code changes are required. The app, language selector, and tests all discover locales from the `meshchatx/src/frontend/locales/` directory at build time. + ## Credits - [Liam Cottle](https://github.com/liamcottle) - Original Reticulum MeshChat diff --git a/lang/README.de.md b/lang/README.de.md index 4c99a13..95086e1 100644 --- a/lang/README.de.md +++ b/lang/README.de.md @@ -223,6 +223,30 @@ task build:all - Integrierte Integritaetspruefungen und HTTPS/WSS-Standardeinstellungen - CI-Scanning-Workflows in `.gitea/workflows/` +## Sprache hinzufuegen + +Die Spracherkennung erfolgt automatisch. Um eine neue Sprache hinzuzufuegen, genuegt eine einzige JSON-Datei: + +1. Vorlage aus `en.json` generieren: + +```bash +python scripts/generate_locale_template.py +``` + +2. Datei umbenennen und in das Locale-Verzeichnis verschieben: + +```bash +mv locales.json meshchatx/src/frontend/locales/xx.json +``` + +3. `_languageName` am Anfang der Datei auf den nativen Sprachnamen setzen (z.B. `"Espanol"`, `"Francais"`). + +4. Alle uebrigen Werte uebersetzen. + +5. Schluesselparitaet pruefen: `pnpm test -- tests/frontend/i18n.test.js --run` + +Keine weiteren Code-Aenderungen noetig. + ## Mitwirkende - [Liam Cottle](https://github.com/liamcottle) - Originales Reticulum MeshChat diff --git a/lang/README.it.md b/lang/README.it.md index 66707a4..bec4f7b 100644 --- a/lang/README.it.md +++ b/lang/README.it.md @@ -223,6 +223,30 @@ task build:all - Controlli di integrita integrati e HTTPS/WSS predefiniti - Workflow di scansione CI in `.gitea/workflows/` +## Aggiungere una lingua + +Il rilevamento delle lingue e automatico. Per aggiungere una nuova lingua basta un singolo file JSON: + +1. Generare un modello da `en.json`: + +```bash +python scripts/generate_locale_template.py +``` + +2. Rinominare e spostare nella cartella delle lingue: + +```bash +mv locales.json meshchatx/src/frontend/locales/xx.json +``` + +3. Impostare `_languageName` all'inizio del file con il nome nativo della lingua (es. `"Espanol"`, `"Francais"`). + +4. Tradurre tutti i valori rimanenti. + +5. Verificare la corrispondenza delle chiavi: `pnpm test -- tests/frontend/i18n.test.js --run` + +Nessuna altra modifica al codice necessaria. + ## Crediti - [Liam Cottle](https://github.com/liamcottle) - Reticulum MeshChat originale diff --git a/lang/README.ja.md b/lang/README.ja.md index 4fafd79..dda01df 100644 --- a/lang/README.ja.md +++ b/lang/README.ja.md @@ -223,6 +223,30 @@ task build:all - 組み込みの整合性チェックと HTTPS/WSS デフォルト設定 - `.gitea/workflows/` の CI スキャンワークフロー +## 言語の追加 + +ロケールの検出は自動です。新しい言語を追加するには JSON ファイル1つだけで済みます: + +1. `en.json` からテンプレートを生成: + +```bash +python scripts/generate_locale_template.py +``` + +2. ファイル名を変更しロケールディレクトリに移動: + +```bash +mv locales.json meshchatx/src/frontend/locales/xx.json +``` + +3. ファイル先頭の `_languageName` にその言語の母語名を設定 (例: `"Espanol"`, `"Francais"`)。 + +4. 残りの値をすべて翻訳。 + +5. キーの整合性を確認: `pnpm test -- tests/frontend/i18n.test.js --run` + +他のコード変更は不要です。 + ## クレジット - [Liam Cottle](https://github.com/liamcottle) - オリジナル Reticulum MeshChat diff --git a/lang/README.ru.md b/lang/README.ru.md index 3c42ad0..717e10f 100644 --- a/lang/README.ru.md +++ b/lang/README.ru.md @@ -223,6 +223,30 @@ task build:all - Встроенные проверки целостности и HTTPS/WSS по умолчанию - CI-сканирование в `.gitea/workflows/` +## Добавление языка + +Обнаружение локалей происходит автоматически. Для добавления нового языка достаточно одного JSON-файла: + +1. Сгенерировать шаблон из `en.json`: + +```bash +python scripts/generate_locale_template.py +``` + +2. Переименовать и переместить в каталог локалей: + +```bash +mv locales.json meshchatx/src/frontend/locales/xx.json +``` + +3. Установить `_languageName` в начале файла на название языка на этом языке (например `"Espanol"`, `"Francais"`). + +4. Перевести все остальные значения. + +5. Проверить соответствие ключей: `pnpm test -- tests/frontend/i18n.test.js --run` + +Никаких других изменений кода не требуется. + ## Авторы - [Liam Cottle](https://github.com/liamcottle) - Оригинальный Reticulum MeshChat diff --git a/lang/README.zh.md b/lang/README.zh.md index c62d3d3..2c6519c 100644 --- a/lang/README.zh.md +++ b/lang/README.zh.md @@ -223,6 +223,30 @@ task build:all - 内置完整性检查和 HTTPS/WSS 默认设置 - `.gitea/workflows/` 中的 CI 扫描工作流 +## 添加语言 + +语言发现是自动的。添加新语言只需一个 JSON 文件: + +1. 从 `en.json` 生成模板: + +```bash +python scripts/generate_locale_template.py +``` + +2. 重命名并移动到语言目录: + +```bash +mv locales.json meshchatx/src/frontend/locales/xx.json +``` + +3. 将文件顶部的 `_languageName` 设置为该语言的母语名称 (例如 `"Espanol"`, `"Francais"`)。 + +4. 翻译所有其他值。 + +5. 验证键一致性: `pnpm test -- tests/frontend/i18n.test.js --run` + +无需其他代码更改。 + ## 致谢 - [Liam Cottle](https://github.com/liamcottle) - 原始 Reticulum MeshChat