Add Farsi localization, RTL flow-direction sync, and fix language-pack save bug - #110
Open
codesbygom wants to merge 4 commits into
Open
codesbygom wants to merge 4 commits into
codesbygom wants to merge 4 commits into
Conversation
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.
3 tasks
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
fa) translation (Strings.fa.resx) from the codesbygom DS4Windows fork.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.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 oldUseLang, 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