Repository navigation
Turkish interface through a language overlay - #4
Merged
Merged
Conversation
Compile.ps1 embeds every lang/*.json as an ASCII-escaped JSON block in $sync.configs.translations, after the configs and before the XAML, so the single-file script carries its translations with it. At start-up Initialize-WinUtilLanguage picks the language from -Language, then WINUTIL_LANG, then Turkish, and builds the tables Get-WinUtilText reads. It rewrites config Content, Description and ComboDescriptions in place only where the value still matches the English the pair was written for, and translates the XAML; tab headers and combo items stay English. English loads nothing, so an English session runs the old code path. start.ps1 forwards WINUTIL_LANG as -Language when it elevates, because the elevated process starts with a fresh environment.
Text the code builds at run time (dialogs, progress and status lines, tooltips, the selected-apps counter and the Win11 Creator steps) now goes through Get-WinUtilText. Each call sits behind a check on $sync.configs.uitext, so an English session takes exactly the old path. Log messages are not translated.
lang/tr.*.json holds the Turkish text for interface strings, message patterns and the config entries (tweaks, features, app navigation and applications). Brand and product names are kept as they are, and terms follow Microsoft's Turkish Windows wording.
tools/Test-WinUtilTranslation.ps1 reports shape errors, unknown config keys, stale pairs (English that no longer matches the source), conflicting pairs and coverage; -Strict exits non-zero on any error. pester/translation.Tests.ps1 covers the lang files, the overlay, the Get-WinUtilText lookups and the compiled translations block.
SPEC.md lists lang/ and the checker, adds the translation step to the build order and the language choice to the runtime model. The architecture page shows lang/ and the new compile step. The README notes that app and tweak text quoted in log messages can be in the interface language.
celaldrg
force-pushed
the
feat/turkce-arayuz
branch
2 times, most recently
from
October 29, 2026 08:27
870eca6 to
f4e69f1
Compare
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.
Type of Change
Description
WinUtil now starts in Turkish, and English stays one switch away. An English session shows exactly the upstream text.
-Language, then$env:WINUTIL_LANG, then Turkish.enloads no table. When WinUtil restarts itself as administrator,start.ps1forwardsWINUTIL_LANGas-Language, because the elevated process starts with a fresh environment.Compile.ps1embeds everylang/*.json, in name order, as an ASCII-escaped JSON block in$sync.configs.translations, after the configs and before the XAML. The compiled script stays pure ASCII.Initialize-WinUtilLanguageruns before the interface starts. It:Get-WinUtilTextreads. Lookups are ordinal and case-sensitive; an exact match wins, then the first matching pattern;Content,DescriptionandComboDescriptionsin place, but only where the value still equals the English the pair was written for. When upstream rewords a string, WinUtil shows the new English instead of an outdated translation;Get-WinUtilText, each behind a check on$sync.configs.uitext. Log messages are not translated.lang/tr.*.jsonholds the interface strings, the message patterns, and the tweak, feature, app-navigation and application entries. Terms follow Microsoft's Turkish Windows wording; brand and product names are kept.The README on
mainalready describes the Turkish interface, so a release cut frommainbefore this merges would still be English.Tests
pester/translation.Tests.ps1:CultureInvariant, and the checker finds no errors. A broken fixture reports every kind of error and fails with-Strict.Content,DescriptionandComboDescriptionschange, and only pairs written for the current text apply. English leaves the XAML unchanged.Get-WinUtilText: exact match, pattern, pass-through, null and empty input, case sensitivity, and no table loaded.tools/Test-WinUtilTranslation.ps1reports shape errors, unknown config keys, stale pairs, conflicts and coverage. With-Strictit fails on any error.Verification
tools/Test-WinUtilTranslation.ps1 -Strict: 0 errors and no stale pairs. Everything has a translation except the WinGet, Chocolatey and WinUtil names and an "N/A" placeholder.Compile.ps1on Windows PowerShell 5.1 with a tr-TR culture:.ps1files are ASCII, use CRLF and parse under Windows PowerShell 5.1.start.ps1could fail to pass the language to the elevated process. It is fixed in this branch.Known limitations
-Presetand-Configruns stay English.enand codes that have lang files (tr) are recognised.tr-TRfalls back to English with a warning.xaml/andconfig/as ANSI, so pairs for text containing ® or ⚠ go stale in that build. Release builds compile with PowerShell 7 and are unaffected.Issue related to PR
🤖 Generated with Claude Code