feat(i18n): sort translation files#2461
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a Python CLI to validate/reorder translation JSON key order, renames Screen Space GI translation keys and expands English strings, and integrates the ordering check into CI with documentation and local run instructions. ChangesTranslation Key Ordering and Screen Space GI Migration
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 OpenGrep (1.22.0)OpenGrep fatal error (exit code 2): [00.18][ERROR]: Error: exception Unix_error: No such file or directory stat package/SKSE/Plugins/CommunityShaders/Translations/en.json 🔧 Checkov (3.2.530)package/SKSE/Plugins/CommunityShaders/Translations/zh_CN.json2026-06-03 09:09:49,130 [MainThread ] [ERROR] Template file not found: package/SKSE/Plugins/CommunityShaders/Translations/zh_CN.json ... [truncated 2989 characters] ... rs/Translations/zh_CN.json package/SKSE/Plugins/CommunityShaders/Translations/en.json2026-06-03 09:09:49,127 [MainThread ] [ERROR] Template file not found: package/SKSE/Plugins/CommunityShaders/Translations/en.json ... [truncated 2962 characters] ... yShaders/Translations/en.json Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
No actionable suggestions for changed features. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/sort-i18n.py`:
- Around line 68-78: The check_order function currently strips "_meta" from
locale_keys, so files with "_meta" misplaced still pass; update check_order to
include "_meta" in locale_keys (i.e., do not filter it out) and construct
expected_keys to enforce "_meta" position: if "_meta" exists in data, prepend
"_meta" to expected_keys before adding en_key_order-filtered and extra_keys.
Modify the logic around en_key_order, expected_keys and locale_keys in
check_order to preserve insertion order from data and compare the full key
sequence (including "_meta") against the computed expected_keys.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0613c3f5-6116-479a-87e7-64505ec4031b
📒 Files selected for processing (7)
.claude/CLAUDE.md.github/workflows/pr-i18n.yamlTRANSLATING.mdpackage/SKSE/Plugins/CommunityShaders/Translations/en.jsonpackage/SKSE/Plugins/CommunityShaders/Translations/zh_CN.jsonsrc/Features/ScreenSpaceGI.cpptools/sort-i18n.py
|
✅ A pre-release build is available for this PR: |
This pull request adds a new tool and related workflow improvements to ensure all non-English translation files have their keys ordered to match
en.json, making translation maintenance and review easier. It also updates translation keys for the Screen Space GI feature to use a consistent prefix.Translation workflow improvements:
tools/sort-i18n.py, a script that checks and optionally rewrites translation files so their keys match the order inen.json. The script can be run manually or in CI, and the ordering rules are clearly documented..github/workflows/pr-i18n.yaml) to runsort-i18n.py --checkon pull requests, ensuring translation files stay in sync with the reference key order. [1] [2].claude/CLAUDE.mdandTRANSLATING.mdto describe the new key ordering requirement, how to check/fix it, and the rationale. [1] [2] [3]Translation key updates:
feature.ssgi.*translation keys tofeature.screen_space_gi.*inen.jsonfor consistency with the codebase and updated the C++ source accordingly. [1] [2] [3]Summary by CodeRabbit
Chores
Documentation
Localization