Skip to content

Add Farsi localization, RTL flow-direction sync, and fix language-pack save bug - #110

Open
codesbygom wants to merge 4 commits into
hbashton:mainfrom
codesbygom:main
Open

codesbygom wants to merge 4 commits into
hbashton:mainfrom
codesbygom:main

Conversation

@codesbygom

Copy link
Copy Markdown

Summary

  • Port Farsi (fa) translation (Strings.fa.resx) from the codesbygom DS4Windows fork.
  • Port the content-only RTL flow-direction sync (App.xaml / App.xaml.cs, LanguagePackControl, UpdaterWindow, WelcomeDialog) from the same fork, so RTL languages mirror window content without mirroring native window chrome, images, or English-only text blocks.
  • Fix a bug in LanguagePackViewModel.ChangeLanguagePack(): Global.Save() was commented out, so a new language-pack selection only ever lived in memory. The "restart required" prompt fired, but the saved config still had the old UseLang, so the app came back up in the previous language every time — selecting a non-English language pack never actually stuck across a restart.

Test plan

  • Build the WPF app and confirm switching Language Pack to a non-English language (e.g. Farsi or Arabic) persists after restart.
  • Confirm RTL languages mirror window content correctly while window chrome/images/English captions stay LTR.

arash added 3 commits September 16, 2026 13:21
Port Strings.fa.resx and the content-only FlowDirection sync
(App.xaml/App.xaml.cs, LanguagePackControl, UpdaterWindow,
WelcomeDialog) from the codesbygom DS4Windows fork.
Global.Save() was commented out in ChangeLanguagePack(), so a new
language selection only lived in memory: the "restart required"
prompt fired, but the saved config still had the old UseLang, so
the app came back up in the previous language every time.
Twelve panels (About, ControllerOverview, AudioHaptics, ViiperSetupPrompt/
Progress, MappingLiveInput, TriggerLab, SwipeProfilesEditor,
Switch2StickCalibration, LogMessageDisplay, StickCalibration,
TouchButtonUserControl) had zero WPFLocalizeExtension bindings, so their
text stayed English regardless of the selected language pack. Wired all of
them to {lex:Loc}/Properties.Resources, keeping license text, proper nouns,
usernames, URLs, and unit suffixes (ms, Hz) untranslated as appropriate.

Also:
- Added the 4 keys missing from Strings.fa.resx and translated 2 tooltips
  that were copied verbatim from English.
- Created Properties/Resources.fa.resx (the legacy resx family used by
  ~200 Properties.Resources.* call sites) and uncommented
  DS4WinWPF.Properties.Resources.Culture = ci; in SetUICulture, which was
  never actually switching that resource family's culture.
- Registered Strings.fa.resx and Resources.fa.resx in the csproj
  (DependentUpon metadata) to match the other language entries.
- Fixed a latent bug in TriggerLabControl's MakeMeter: the slider's
  internal property key ("Start"/"Wall"/"Force") was reused as the
  display label, so localizing the label would have silently broken
  meter updates. Split them into separate parameters.

Net: 170 new Strings.resx/Strings.fa.resx keys, 156 new
Properties/Resources.resx/Resources.fa.resx keys, all translated.
Resources.resx was edited directly (not through Visual Studio's
designer), so the PublicResXFileCodeGenerator custom tool never ran
and Resources.Designer.cs still only exposed the pre-existing string
properties. Every Properties.Resources.* call site added for the
localization work failed with CS0117 as a result. Added the missing
156 properties by hand, matching the generator's existing pattern.
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.

1 participant