Skip to content

feat(i18n): add Russian localization + eliminate all hardcoded UI text - #53

Open
ShutovKS wants to merge 4 commits into
Besty0728:betafrom
ShutovKS:feat/russian-localization
Open

feat(i18n): add Russian localization + eliminate all hardcoded UI text#53
ShutovKS wants to merge 4 commits into
Besty0728:betafrom
ShutovKS:feat/russian-localization

Conversation

@ShutovKS

@ShutovKS ShutovKS commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds Russian localization and removes hardcoded editor UI text while keeping the footer compact and compatible with Unity 2022.3+.

Changes

  • Added Russian to SkillsLocalization with EN/CN/RU key parity.
  • Replaced inline localized fallbacks and hardcoded dialogs across the editor UI.
  • Footer remains exactly two language buttons.
  • Settings provides primary/secondary pinned-language dropdowns.
  • Duplicate pin selection swaps the two languages.
  • Pin changes refresh the footer immediately through LanguageChanged.
  • Rebuilt the persistent static UnitySkillsCN-UI.asset with all fixed Chinese and Russian UI glyphs for the Unity 2022 code path.
  • Added serialized FontAsset glyph-coverage tests.

Verification

  • Unity 6000.3.11f1 full EditMode: 220 passed / 0 failed / 1 ignored.
  • git diff --check: passed.
  • Russian UI and dynamic EN | RU / 中文 | RU footer were visually verified in Unity 6.
  • Unity 2022 is not installed on the test machine; its compatibility is covered by the persistent pre-baked asset and conditional EditMode test, not a runtime launch.

- 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
Copilot AI review requested due to automatic review settings August 1, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Russian to SkillsLocalization.Language, introduced _russian dictionary, 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.

Comment on lines 287 to 291
var undoBtn = new Button(() =>
{
var result = WorkflowManager.UndoTask(task.id);
ShowResult(result, "Undo");
ShowResult(result, SkillsLocalization.Get("btn_undo"));
RefreshHistory();
Comment on lines 305 to 309
var redoBtn = new Button(() =>
{
var result = WorkflowManager.RedoTask(task.id);
ShowResult(result, "Redo");
ShowResult(result, SkillsLocalization.Get("btn_redo"));
RefreshHistory();
Comment on lines +13 to 16
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
@ShutovKS

ShutovKS commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

All 3 review comments addressed in eb60617:

  1. HistoryTabController ShowResult (both lines 291/309): status templates ("no snapshots to process" / "succeeded" / "completed with ... failure(s)") are now localized via string.Format(SkillsLocalization.Get("history_result_*_fmt"), ...) — keys added to EN, CN and RU (1023 keys, full parity).

  2. Localization.cs Current: stored EditorPrefs int is validated with Enum.IsDefined(typeof(Language), saved), falls back to Language.English on stale/corrupt values.

@ShutovKS
ShutovKS changed the base branch from main to beta August 1, 2026 19:45
@Besty0728

Copy link
Copy Markdown
Owner

Okay, I'll review your PR when I have time.

@Besty0728

Besty0728 commented Aug 3, 2026

Copy link
Copy Markdown
Owner

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.

@ShutovKS

ShutovKS commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

Review fixes are now on this PR branch only (head 45951f9).

  • Footer remains exactly two buttons.
  • Settings can pin any two languages; duplicate selection swaps them.
  • Pin changes refresh the footer immediately.
  • Unity 2022 path uses the persistent static pre-baked UnitySkillsCN-UI.asset, now rebuilt with Russian glyph coverage.
  • EditMode glyph coverage validates the serialized FontAsset.

Verification on Unity 6000.3.11f1: full EditMode 220 passed / 0 failed / 1 ignored; git diff --check passes. Unity 2022 is not installed locally, so that editor version is covered by the static asset and conditional EditMode test but was not runtime-launched.

@ShutovKS

ShutovKS commented Aug 5, 2026

Copy link
Copy Markdown
Contributor Author

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: 221 total / 220 passed / 0 failed / 1 ignored; no compiler errors. This closes the previous Unity 2022 runtime verification gap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants