feat(i18n): add Russian localization + eliminate all hardcoded UI text - #53
feat(i18n): add Russian localization + eliminate all hardcoded UI text#53ShutovKS wants to merge 4 commits into
Conversation
- Add Russian language to SkillsLocalization: enum, Get() method, full _russian dictionary (~1020 keys covering all UI strings + skill descriptions + permission/CLI subsystem) - Add RU button to footer language switcher (UXML + FooterController) - Move all inline ternaries (Current == Language.Chinese ? X : Y) to dictionary keys across SettingsDrawer, AIConfig, HistoryTab controllers - Add 101 permission/CLI keys to _english and _chinese (previously only in _russian via L() fallback), then replace all 112 PermissionUiHelpers.L() call sites with SkillsLocalization.Get() — remove the L() helper entirely - Localize all DisplayDialog button texts (Success/Error/OK/Yes/No/Cancel) - Localize Undo/Redo buttons, Unity CLI group title, unknown error fallback, log level dropdown choices, window titles - All 1020 keys verified identical across _english, _chinese, _russian
There was a problem hiding this comment.
Pull request overview
Adds Russian (RU) as a third UI language and continues the i18n migration by replacing hardcoded UI strings (including many permission/CLI and dialog strings) with SkillsLocalization.Get(...) keys across the editor UI.
Changes:
- Added
RussiantoSkillsLocalization.Language, introduced_russiandictionary, and expanded shared EN/CN dictionaries with many new keys. - Updated multiple UI controllers/windows to use localization keys instead of inline EN/CN fallbacks and hardcoded dialog/button labels.
- Added an RU language segment button to the main window footer (UXML + controller wiring).
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| SkillsForUnity/Editor/UI/UnitySkillsWindow.uxml | Adds RU button to the language segmented control. |
| SkillsForUnity/Editor/UI/UnitySkillsWindow.cs | Localizes window title and first-run/permissions UI strings; removes PermissionUiHelpers.L fallback helper. |
| SkillsForUnity/Editor/UI/UnityCliWindow.cs | Replaces inline fallback/local L() usage with SkillsLocalization.Get(...) keys. |
| SkillsForUnity/Editor/UI/Controllers/TopbarController.cs | Localizes permission/mode dropdown strings and tooltips. |
| SkillsForUnity/Editor/UI/Controllers/ShortcutsSettingsController.cs | Localizes dialog OK button label. |
| SkillsForUnity/Editor/UI/Controllers/SettingsDrawerController.cs | Localizes log level dropdown strings and permissions/CLI group labels/hints. |
| SkillsForUnity/Editor/UI/Controllers/PendingApprovalBannerController.cs | Localizes banner CTA and count/overflow strings. |
| SkillsForUnity/Editor/UI/Controllers/HistoryTabController.cs | Localizes history clear dialog and Undo/Redo button labels. |
| SkillsForUnity/Editor/UI/Controllers/FooterController.cs | Wires RU button and updates active-state logic for 3-language segmented control. |
| SkillsForUnity/Editor/UI/Controllers/AnalyticsTabController.cs | Localizes OK button and “unknown error” fallback. |
| SkillsForUnity/Editor/UI/Controllers/AIConfigTabController.cs | Localizes install success messaging, dialogs, and help text. |
| SkillsForUnity/Editor/UI/AllowlistPickerWindow.cs | Replaces localized fallbacks/local L() wrapper with SkillsLocalization.Get(...) keys. |
| SkillsForUnity/Editor/Skills/Localization.cs | Adds RU language support, RU dictionary, and many new keys in EN/CN for previously hardcoded UI text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| var undoBtn = new Button(() => | ||
| { | ||
| var result = WorkflowManager.UndoTask(task.id); | ||
| ShowResult(result, "Undo"); | ||
| ShowResult(result, SkillsLocalization.Get("btn_undo")); | ||
| RefreshHistory(); |
| var redoBtn = new Button(() => | ||
| { | ||
| var result = WorkflowManager.RedoTask(task.id); | ||
| ShowResult(result, "Redo"); | ||
| ShowResult(result, SkillsLocalization.Get("btn_redo")); | ||
| RefreshHistory(); |
| public enum Language { English, Chinese, Russian } | ||
|
|
||
| private const string PREF_LANGUAGE = "UnitySkills_Language"; | ||
| private static bool _initialized = false; |
- Localize history undo/redo result status templates (no snapshots / succeeded / failures) via format keys in all three languages - Validate stored EditorPrefs language value, fall back to English on stale/corrupt int
|
All 3 review comments addressed in eb60617:
|
|
Okay, I'll review your PR when I have time. |
|
Verified in Unity 6.3 LTS: compilation passes, UISkillsFontTests pass 4/4, EN/CN/RU all have 1023 matching keys with no placeholder mismatch, and Russian glyphs render correctly. This is useful work and I plan to merge it later when I have enough time for the integration. One UI request before then: keep the main panel language switch limited to two buttons, but let users choose in Settings which two languages are pinned there. For example, selecting English + Russian should make the bottom switch show EN/RU; selecting Chinese + Russian should make it show CN/RU. This preserves fast switching while avoiding the crowded three-button layout and narrow-width truncation. Please also account for Unity 2022 compatibility: the font asset containing the required Russian glyphs needs to be pre-baked and included with the package for that editor line, rather than relying only on the dynamic font-generation path that works in Unity 6. |
|
Review fixes are now on this PR branch only (head
Verification on Unity 6000.3.11f1: full EditMode |
|
Additional verification completed: Unity 2022.3.62f3 (arm64) was installed and PR #53 was run in a real Unity 2022 editor project. Full EditMode result: |
Summary
Adds Russian localization and removes hardcoded editor UI text while keeping the footer compact and compatible with Unity 2022.3+.
Changes
SkillsLocalizationwith EN/CN/RU key parity.LanguageChanged.UnitySkillsCN-UI.assetwith all fixed Chinese and Russian UI glyphs for the Unity 2022 code path.Verification
220 passed / 0 failed / 1 ignored.git diff --check: passed.EN | RU/中文 | RUfooter were visually verified in Unity 6.