Skip to content

i18n: add Persian (fa-IR) translation - #91

Merged
itsfatduck merged 1 commit into
itsfatduck:masterfrom
NimaHp:feature/add-persian-fa-ir
Oct 7, 2026
Merged

itsfatduck merged 1 commit into
itsfatduck:masterfrom
NimaHp:feature/add-persian-fa-ir

Conversation

@NimaHp

@NimaHp NimaHp commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Adds the Persian (fa-IR) locale.

What

  • Translations.fa-IR.resx with all 814 neutral keys translated
  • one line in Domain/UI/SupportedLanguages.cs

Translation decisions

Follows the per-locale convention already documented in AGENTS.md:

  • English kept where Persian users expect the English term: Registry, Driver, Firmware, Secure Boot, VBS, V-Sync, UEFI, PCIe, WMI/ETW, AutoLogger, SSD / HDD / NVMe / DDR / SDRAM / LPDDR / HBM, MT/s, MHz, GB, Hibernation, Fast Startup, Service Host, MMCSS, Shell, Task Scheduler, Prefetch, AppX, JSON, plus product names (GitHub, Discord, Microsoft Store, NVIDIA, AMD, Intel, Xbox Game Bar, Click To Do, Recall, Widgets, Task View, Meet Now).
  • Naturally translated because Persian has an idiomatic equivalent: Service = سرویس, Scheduled Task = وظیفه زمان‌بندی‌شده, Power Plan = طرح انرژی, Explorer = فایل اکسپلورر, Bloatware = برنامه‌های زائد, Revert = بازگردانی, Dark Mode = حالت تاریک.
  • Windows feature names keep the English term in parentheses so they can be found in Windows Settings, e.g. Snap Layouts, Widgets, Click To Do.
  • Placeholders such as {0} are preserved verbatim, including multi-placeholder sets ({0}/{1}/{2}).
  • No em dashes. Translations are not padded to the English length.
  • Literal numbers use Latin digits (50 مگابایت, 24 ساعت, 64 بیتی) because fa-IR on .NET renders DigitSubstitution=Context, i.e. Loc.Instance["Key", value] also produces Latin digits. Persian digits for the literals would have mixed with the code-supplied ones on the same screen.

Verification

  • resx_audit: 0 missing, 0 empty, 15 values identical to English (DDR/SDRAM/UEFI/NVMe and similar identifiers)
  • placeholder sets identical to the neutral resx for all 814 keys
  • dotnet build optimizerDuck.slnx --configuration Release: 0 warnings, 0 errors
  • LanguageManagerTests.EveryNeutralKey_ResolvesInEverySupportedLanguage and EveryLocale_PreservesNeutralPlaceholderSets pass with fa-IR registered
  • full suite via the console runner with -longRunning 30: Total: 738, Errors: 0, Failed: 0, Skipped: 5
  • csharpier check .: clean (302 files)

Review notes

15 values are byte-identical to English on purpose (hardware and firmware identifiers). Everything else is translated.

RTL is picked up automatically: Loc.Direction flips FlowDirection on the root grid, so fa-IR renders right-to-left like ar-SA and he-IL.

One pre-existing limitation is worth flagging, since it shows up in this locale: WPF mirrors only text direction and TextAlignment, never layout. The optimization card template hardcodes LTR layout (HorizontalAlignment="Left" for the tag row, StackPanel Orientation="Horizontal" inside a tag, Grid ColumnDefinitions="*,Auto" for the footer), so three spots read wrong in any RTL language: the tag row, the icon inside a tag, and the footer order. I left it alone to keep this PR translation-only, but it affects ar-SA and he-IL equally and is worth a separate fix.

Closes the Persian translation request.

Adds a complete fa-IR locale: all 814 neutral keys are translated, placeholders are preserved verbatim, and no em dashes are used.

Technical terms follow the existing per-locale convention: Registry, Driver, Firmware, Secure Boot, VBS, UEFI, DDR/SSD/NVMe, MT/s, MHz, Shell, Hibernation, GPU/CPU/RAM and product names stay English, while Service, Scheduled Task and Power Plan get natural Persian equivalents.

Registered in SupportedLanguages.All, which the test gate reads, so EveryNeutralKey_ResolvesInEverySupportedLanguage and EveryLocale_PreservesNeutralPlaceholderSets cover fa-IR.
@NimaHp
NimaHp requested a review from itsfatduck as a code owner October 7, 2026 07:13

@itsfatduck itsfatduck left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thank you so much for the Persian translation and for taking the time to verify everything so thoroughly!

Also, thanks for pointing out the RTL layout issues. I'll look into those separately.

@itsfatduck
itsfatduck merged commit 7869fe4 into itsfatduck:master Oct 7, 2026
1 check passed
@NimaHp
NimaHp deleted the feature/add-persian-fa-ir branch October 8, 2026 13:49
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