Skip to content

Conversation

@aleksandr-miheichev
Copy link
Contributor

@aleksandr-miheichev aleksandr-miheichev commented Aug 17, 2025

Summary

Externalize TUN settings labels and provide translations across locales. Unify the casing of MTU and switch XAML to use resource keys instead of hard-coded strings.

Changes

  • ResUI (EN base): add keys
    TbSettingsTunAutoRoute, TbSettingsTunStrictRoute, TbSettingsTunStack, TbSettingsTunMtu.
  • Locales: add translations for ru, zh-Hans, zh-Hant, hu, fa-IR.
    MTU remains the standard abbreviation across locales.
  • UI: replace hard-coded labels with {x:Static resx:ResUI.*} in
    v2rayN.Desktop/Views/OptionSettingWindow.axaml,
    v2rayN.Desktop/Views/AddServerWindow.axaml,
    v2rayN/Views/OptionSettingWindow.xaml,
    v2rayN/Views/AddServerWindow.xaml.
  • ResUI.Designer.cs: add public strongly-typed accessors for the new keys (so Avalonia {x:Static} resolves them).

Rationale

  • Aligns TUN UI with the app’s i18n approach.
  • Avoids mixed-language UI; single source of truth in .resx.

Testing

  • Built with dotnet build (net8.0) on Windows, app launches.
  • Verified labels render in RU & ZH, MTU consistently uppercase.
  • Missing keys fall back to base ResUI.resx (EN).

Notes

  • UI strings only, no behavioral changes.
  • No submodule pointer changes.
  • Chore: update .gitignore to ignore JetBrains Rider artifacts (.idea/, *.sln.iml).

Aleksandr Miheichev added 5 commits August 17, 2025 13:35
- Replace hard-coded labels "Auto Route", "Strict Route", "Stack",
  and "Mtu/mtu" with resource keys in both Avalonia and WPF views:
  - v2rayN/v2rayN.Desktop/Views/AddServerWindow.axaml
  - v2rayN/v2rayN.Desktop/Views/OptionSettingWindow.axaml
  - v2rayN/v2rayN/Views/AddServerWindow.xaml
  - v2rayN/v2rayN/Views/OptionSettingWindow.xaml
- Add new resource keys in ResUI:
  TbSettingsTunAutoRoute, TbSettingsTunStrictRoute,
  TbSettingsTunStack, TbSettingsTunMtu (unified casing as "MTU").
  Files:
  - v2rayN/ServiceLib/Resx/ResUI.resx
- Provide translations in:
  - v2rayN/ServiceLib/Resx/ResUI.ru.resx
  - v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
  - v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
  - v2rayN/ServiceLib/Resx/ResUI.fa-Ir.resx
  - v2rayN/ServiceLib/Resx/ResUI.hu.resx
- Normalize XML comments/whitespace in .resx files.
- Update submodule v2rayN/GlobalHotKeys to 5201dd5.

No breaking changes.
- Add strongly-typed accessors in ServiceLib.Resx.ResUI:
  - TbSettingsTunAutoRoute → "Auto Route"
  - TbSettingsTunStrictRoute → "Strict Route"
  - TbSettingsTunStack → "Stack"
  - TbSettingsTunMtu → "MTU"
- Keep auto-generated structure intact; normalize minor whitespace.

Refs: v2rayN/ServiceLib/Resx/ResUI.resx
No functional changes beyond exposing new i18n keys.
@2dust 2dust merged commit 4f711b1 into 2dust:master Aug 18, 2025
@aleksandr-miheichev aleksandr-miheichev deleted the i18n-ru-tun-labels branch August 18, 2025 20:17
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.

2 participants