Repository navigation
Add Turkish (tr) UI translation - #1
Merged
Merged
Conversation
Add a Turkish (tr) locale for the GUI and the macOS privilege prompt. - lib/gui/app/i18n/tr.ts: full translation of en.ts with the same keys, placeholders and HTML links. The object is checked with `satisfies typeof en`, so tsc (tsconfig.i18n.json, run in CI) reports missing, extra or misspelled keys. - lib/gui/app/i18n.ts: register the tr resources and add 'tr' to supportedLocales, which selects the macOS sudo prompt script. - lib/shared/sudo/sudo-askpass.osascript-tr.js: Turkish password prompt, executable like the en and zh scripts. - forge.config.ts: ship the new prompt as an extra resource.
celaldrg
force-pushed
the
feat/turkish-ui
branch
2 times, most recently
from
October 29, 2026 08:26
8ff7981 to
bb2687a
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.
Summary
Adds a Turkish (
tr) locale for the GUI and a Turkish macOS privilege prompt, followinglib/gui/app/i18n/README.md.lib/gui/app/i18n/tr.ts(new): full translation ofen.tswith the same keys (122/122, same order), the same{{...}}placeholders and the same HTML links. Product names ("Etcher", "balenaEtcher", "Etcher Pro", Rufus, WoeUSB) are not translated.lib/gui/app/i18n.ts: imports the Turkish resources, registers them astrand adds'tr'tosupportedLocales.lib/shared/sudo/sudo-askpass.osascript-tr.js(new): Turkish macOS sudo prompt. The file name is whatlib/shared/sudo/darwin.tsbuilds (sudo-askpass.osascript-${lang}.js); mode 100755 like the en/zh scripts.forge.config.ts: adds the Turkish prompt topackagerConfig.extraResourcenext to the en/zh scripts. In development,darwin.tsresolves the script withrequire.resolveand a template string, so webpack's context module already includes the new file.Type safety
tr.tsends withsatisfies typeof en(type-only import ofen.ts). tsc rejects missing, extra and misspelled keys, including nested keys and plural variants. The existing CI stepnpx tsc -p tsconfig.i18n.jsoncovers it becausei18n.tsimportstr.ts. ts-loader erases bothimport typeandsatisfies, so runtime output is unchanged. The zh-CN and zh-TW files are not touched.Terminology
_oneand_othershare the same text ("3 hedef").Intl.PluralRules('tr')has the categories one/other, so the keys match en.toDriveandtoTargetare dative phrases ("... sürücüsüne", "3 hedefe"), so they read correctly in bothsucceedToandflashError. Turkish puts the verb last, soandFailTargetis a parenthetical: "ubuntu.img, 2 hedefe (1 hedefe yazılamadı) başarıyla yazıldı".drives.openInBrowser: the English string contains literal backticks; they are not carried over (zh-CN and zh-TW drop them too).How it was tested
Locally on Windows 11, Node 24.16.0, in a clean worktree after
npm ci --ignore-scripts:npx balena-lint --typescript typings lib tests forge.config.ts forge.sidecar.ts forge.pkg-node.ts webpack.config.tswithout--fix: passes with no findings.npx prettier --check "lib/**/*.css", plusnpx prettier --checkon the changed TypeScript files: pass.npx tsc -p tsconfig.i18n.json: passes.satisfiescheck: five broken copies oftr.ts(missing key, extra nested key, extra top-level key, misspelled key, missing plural variant) each fail tsc (TS2741, TS2353, TS2561); the unmodified copy passes.<a>tags, identical line-break counts, product names present, no string left in English except "Etcher Pro".lib/gui/app/i18n.tsandlib/shared/messages.tsloaded through ts-node with a mocked system locale andLANGunset.tr-TRandtr:langParser()returnstr,i18next.languageandresolvedLanguagearetr, and thedarwin.tslogic pickssudo-askpass.osascript-tr.js.en-USgives English and the en prompt;zh-CNgives zh-CN and the zh prompt (unchanged).Not verified
Observed, not changed (out of scope)
langParser()returnsenwheneverLANGis set (a workaround for mocha). Linux desktop sessions usually setLANG, so Linux users likely get English whatever their locale (checked withLANG=tr_TR.UTF-8).flash-results.tsxcallsi18next.t('failedTarget')andi18next.t('failedRetry'), but these keys live underflash., so the raw key names are shown in every language.Flash.tsx("Flash complete!", "Oops! Looks like the flash failed."), the "found" count in the drive selector title, and the ETA units fromformatSeconds("1m5s").lib/gui/app/i18n/README.mdstill points tolib/shared/catalina-sudo/and does not mentionsupportedLocalesor theextraResourcelist.zh-CN.tslackssettings.trimExtPartitions, so that setting falls back to English.imageWriter.cancel(), but the child process routes only on the message type (cancel), so translating the label does not change behaviour.🤖 Generated with Claude Code