translations-updater
Update and complete JournalOS translation JSON files by running composer journalos:locale and fixing missing or empty translations in lang/*.json. Use when UI copy changes, new keys are added, or locale files are out of sync.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Translations Updater
This Skill keeps JournalOS translation files consistent and complete. It regenerates locale keys using the project command and then fixes missing, empty, or invalid entries inside lang/*.json files.
When to use this Skill
Use this Skill when:
- New UI text or translation keys were introduced
- Modules, pages, or components added new strings
- Translation JSON files contain empty or missing values
- Locale files are out of sync with the codebase
Instructions
Step 1: Regenerate locale files
- Run the locale generation command:
composer journalos:locale - Confirm the command completes successfully before making any edits.
Step 2: Scan for missing or incomplete translations
-
Review all translation files:
-
lang/*.json
-
-
Identify any entries that are:
- Missing keys (present in one locale but absent in another)
- Empty strings (e.g.
"some.key": "") - Whitespace-only values
- Null values
- Invalid JSON
Step 3: Fix translations
Apply the following rules:
-
Do not remove translation keys unless they are confirmed unused.
-
For missing keys:
- Add the key to the relevant locale file(s).
-
For empty or invalid values:
- Replace them with an appropriate human-readable translation.
-
Ensure consistency:
- Same meaning across languages
- Same tense and tone
- Same terminology as used elsewhere in the app
-
Preserve formatting and placeholders exactly:
- Do not modify tokens such as
:name,:count,{value} - Do not alter embedded HTML or Markdown
- Do not modify tokens such as
Step 4: Validate JSON correctness
Ensure all lang/*.json files:
- Are valid JSON
- Use consistent indentation
- Contain no duplicate keys
Step 5: Quality checks
-
Confirm there are no:
- Empty strings
- Null values
- Placeholder values like TODO
-
If a translation is uncertain, prefer literal and conservative wording.
-
Maintain existing key order unless the project explicitly requires sorting.
Step 6: Run tests
- Run the test suite:
composer test - Resolve any failures related to translations or locale loading.
Best practices
- Never rename translation keys without corresponding code changes
- Never translate or alter placeholders
- Favor consistency over stylistic variation
- Avoid informal language unless the UI already uses it
Validation checklist
-
composer journalos:localeexecuted successfully - All
lang/*.jsonfiles are valid JSON - No missing keys remain
- No empty or null translation values remain
- Placeholders are preserved exactly
- All tests pass
Output expectation
All translation files in lang/*.json are regenerated, complete, valid, and contain no missing or empty translations.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-01-20
- 索引更新时间
- 2026-01-26
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!