Skip to content

Turkish interface through a language overlay - #4

Merged
celaldrg merged 5 commits into
mainfrom
feat/turkce-arayuz
Oct 29, 2026
Merged

celaldrg merged 5 commits into
mainfrom
feat/turkce-arayuz

Conversation

@celaldrg

Copy link
Copy Markdown
Owner

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactor
  • UI/UX improvement

Description

WinUtil now starts in Turkish, and English stays one switch away. An English session shows exactly the upstream text.

  • Language choice. -Language, then $env:WINUTIL_LANG, then Turkish. en loads no table. When WinUtil restarts itself as administrator, start.ps1 forwards WINUTIL_LANG as -Language, because the elevated process starts with a fresh environment.
  • Compile step. Compile.ps1 embeds every lang/*.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.
  • Overlay. Initialize-WinUtilLanguage runs before the interface starts. It:
    • builds the exact-match table and the ordered pattern list that Get-WinUtilText reads. Lookups are ordinal and case-sensitive; an exact match wins, then the first matching pattern;
    • rewrites config Content, Description and ComboDescriptions in 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;
    • translates the XAML. Tab headers and combo items stay English.
  • Display text. Dialogs, progress and status lines, tooltips, the selected-apps counter and the Win11 Creator steps go through Get-WinUtilText, each behind a check on $sync.configs.uitext. Log messages are not translated.
  • Turkish text. lang/tr.*.json holds 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.
  • Docs. SPEC.md, the architecture page and the README describe the overlay, the new compile step and what stays English.

The README on main already describes the Turkish interface, so a release cut from main before this merges would still be English.

Tests

  • New pester/translation.Tests.ps1:
    • Lang files: each is UTF-8 without BOM and has the documented shape. Its patterns compile with CultureInvariant, and the checker finds no errors. A broken fixture reports every kind of error and fails with -Strict.
    • Overlay: the XAML still parses with no warning, and tab headers and combo items are unchanged. Only Content, Description and ComboDescriptions change, 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.
    • Compiled translations: one pure-ASCII block per lang file, holding the same JSON as the file, placed after the configs and before the XAML.
  • New tools/Test-WinUtilTranslation.ps1 reports shape errors, unknown config keys, stale pairs, conflicts and coverage. With -Strict it 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.ps1 on Windows PowerShell 5.1 with a tr-TR culture:
    • the compiled script parses;
    • it holds five ASCII translation blocks in name order;
    • each block decodes to exactly its lang file.
  • Smoke runs against the real lang files and XAML:
    • the overlay loads without a warning;
    • the reworded strings and the new patterns translate as intended, and the existing install, uninstall and job texts keep their own translations;
    • the app popup tooltip handlers show Turkish with the table loaded and the original English without it.
  • All 24 changed .ps1 files are ASCII, use CRLF and parse under Windows PowerShell 5.1.
  • An independent review found one defect: start.ps1 could fail to pass the language to the elevated process. It is fixed in this branch.
  • This repository's CI runs Pester 5.8 and the compile check. The GUI was not opened on this machine.

Known limitations

  • Headless -Preset and -Config runs stay English.
  • Log messages stay English. App and tweak text they quote can be Turkish.
  • Tweak lists sort by the translated names.
  • Four of the five navigation labels lose their access-key underline.
  • In Win11 Creator, the step tab headers, the log lines and the opening placeholder line stay English.
  • Only en and codes that have lang files (tr) are recognised. tr-TR falls back to English with a warning.
  • The longer Turkish label for "Disable Updates" may be clipped at the minimum window width. This was not checked in a live window.
  • A local compile under Windows PowerShell 5.1 reads xaml/ and config/ as ANSI, so pairs for text containing ® or ⚠ go stale in that build. Release builds compile with PowerShell 7 and are unaffected.
  • The docs-site guides are not translated, because this edition does not deploy the docs site.

Issue related to PR

  • None. This is the Turkish edition's own feature.

🤖 Generated with Claude Code

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
celaldrg force-pushed the feat/turkce-arayuz branch 2 times, most recently from 870eca6 to f4e69f1 Compare October 29, 2026 08:27
@celaldrg
celaldrg merged commit ec98bbc into main Oct 29, 2026
8 checks passed
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