Skip to content

Commit f99caf7

Browse files
committed
feat(i18n): add Polish (pl) as an app display language
Adds Polish to the app language picker (Settings -> Advanced -> Language), following the same pattern used when Russian (#145) and Italian (#305) were added. - New src/renderer/src/i18n/locales/pl.json, hand-translated from en.json with full structural parity (982 keys, 0 missing / 0 extra / 0 invalid). - runtime.ts: pl added to SupportedAppLocale, APP_LANGUAGE_OPTIONS, MESSAGE_CATALOG, normalizeAppLanguage and resolveAppLocale, so a system locale of pl-PL resolves to Polish automatically. - settings-store.ts: pl added to the AppLanguage union and to the main process copy of normalizeAppLanguage, so the setting persists instead of being coerced back to 'system' on load and on every patch. - electron.d.ts: appLanguage union widened to match. - settings.general.language.pl display name added to all 10 existing locale files, in each target language. - Refreshed the stale locale lists in docs/i18n-architecture.md and CLAUDE.md, which were still missing ru and/or it. No existing locale strings, keys or runtime behaviour are changed. Claude-Session: https://claude.ai/code/session_01DM3kF3wjMpoDJSUWApqsJ5
1 parent 2da7b9e commit f99caf7

16 files changed

Lines changed: 1404 additions & 18 deletions

File tree

‎CLAUDE.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ When implementing a new Raycast API:
221221

222222
### Internationalization (i18n)
223223

224-
Locales live in `src/renderer/src/i18n/locales/` — `en.json` is the source of truth, plus `zh-Hans`, `zh-Hant`, `ja`, `ko`, `fr`, `de`, `es`, `ru`.
224+
Locales live in `src/renderer/src/i18n/locales/` — `en.json` is the source of truth, plus `zh-Hans`, `zh-Hant`, `ja`, `ko`, `fr`, `de`, `es`, `ru`, `it`, `pl`.
225225

226226
**Rule: whenever you add, rename, or remove a user-facing string, update every locale file in the same change.** Missing keys fall back to English (or a derived label from the last path segment), which looks broken for non-English users. Keys are only "done" when all locales have them.
227227

@@ -233,7 +233,7 @@ Checklist when touching `en.json`:
233233
4. Preserve interpolation variables verbatim (`{count}`, `{name}`, `{version}`, `{plural}`, etc.) — translations must keep the same placeholders.
234234
5. Verify structural parity after edits — all locales must have the same set of keys as `en.json`. A quick node check:
235235
```bash
236-
node -e "const fs=require('fs');function k(o,p=''){const r=[];for(const x of Object.keys(o)){const v=o[x],q=p?p+'.'+x:x;v&&typeof v==='object'?r.push(...k(v,q)):r.push(q)}return r}const en=new Set(k(JSON.parse(fs.readFileSync('src/renderer/src/i18n/locales/en.json','utf8'))));for(const l of ['zh-Hans','zh-Hant','ja','ko','fr','de','es','ru']){const s=new Set(k(JSON.parse(fs.readFileSync('src/renderer/src/i18n/locales/'+l+'.json','utf8'))));console.log(l,'missing:',[...en].filter(x=>!s.has(x)).length,'extra:',[...s].filter(x=>!en.has(x)).length)}"
236+
node -e "const fs=require('fs');function k(o,p=''){const r=[];for(const x of Object.keys(o)){const v=o[x],q=p?p+'.'+x:x;v&&typeof v==='object'?r.push(...k(v,q)):r.push(q)}return r}const en=new Set(k(JSON.parse(fs.readFileSync('src/renderer/src/i18n/locales/en.json','utf8'))));for(const l of ['zh-Hans','zh-Hant','ja','ko','fr','de','es','ru','it','pl']){const s=new Set(k(JSON.parse(fs.readFileSync('src/renderer/src/i18n/locales/'+l+'.json','utf8'))));console.log(l,'missing:',[...en].filter(x=>!s.has(x)).length,'extra:',[...s].filter(x=>!en.has(x)).length)}"
237237
```
238238
6. Never copy a locale file wholesale from another language as a starting point — past incidents have left one locale filled with another language's text (e.g. `ja.json` was Chinese). Always translate each value.
239239

‎docs/i18n-architecture.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
- Keep the first rollout small and reviewable.
66
- Ship app-level localization for English, Simplified Chinese, Traditional Chinese, Japanese,
7-
Korean, French, German, and Spanish.
7+
Korean, French, German, Spanish, Russian, Italian, and Polish.
88
- Make future locale additions a resource-only change whenever possible.
99

1010
## Current Design
1111

1212
- Persist the user preference as `appLanguage` in `settings.json`.
13-
- Accept `system`, `en`, `zh-Hans`, `zh-Hant`, `ja`, `ko`, `fr`, `de`, and `es`.
13+
- Accept `system`, `en`, `zh-Hans`, `zh-Hant`, `ja`, `ko`, `fr`, `de`, `es`, `ru`, `it`, and `pl`.
1414
- Resolve `system` at runtime from the renderer locale.
1515
- Store translatable copy under `src/renderer/src/i18n/`.
1616
- Use English as the fallback locale for missing keys.

‎src/main/settings-store.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ export type AppLanguage =
209209
| 'de'
210210
| 'es'
211211
| 'ru'
212-
| 'it';
212+
| 'it'
213+
| 'pl';
213214

214215
export interface AppSettings {
215216
globalShortcut: string;
@@ -895,6 +896,7 @@ function normalizeAppLanguage(value: any): AppLanguage {
895896
if (normalized === 'es' || normalized.startsWith('es-')) return 'es';
896897
if (normalized === 'ru' || normalized.startsWith('ru-')) return 'ru';
897898
if (normalized === 'it' || normalized.startsWith('it-')) return 'it';
899+
if (normalized === 'pl' || normalized.startsWith('pl-')) return 'pl';
898900
return DEFAULT_SETTINGS.appLanguage;
899901
}
900902

‎src/renderer/src/i18n/locales/de.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "Deutsch",
110110
"es": "Español",
111111
"ru": "Russisch",
112-
"it": "Italienisch"
112+
"it": "Italienisch",
113+
"pl": "Polnisch"
113114
},
114115
"fontSize": {
115116
"title": "Font Size",

‎src/renderer/src/i18n/locales/en.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "German",
110110
"es": "Spanish",
111111
"ru": "Russian",
112-
"it": "Italian"
112+
"it": "Italian",
113+
"pl": "Polish"
113114
},
114115
"fontSize": {
115116
"title": "Font Size",

‎src/renderer/src/i18n/locales/es.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "Deutsch",
110110
"es": "Español",
111111
"ru": "Ruso",
112-
"it": "Italiano"
112+
"it": "Italiano",
113+
"pl": "Polaco"
113114
},
114115
"fontSize": {
115116
"title": "Font Size",

‎src/renderer/src/i18n/locales/fr.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "Deutsch",
110110
"es": "Español",
111111
"ru": "Russe",
112-
"it": "Italien"
112+
"it": "Italien",
113+
"pl": "Polonais"
113114
},
114115
"fontSize": {
115116
"title": "Font Size",

‎src/renderer/src/i18n/locales/it.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "Tedesco",
110110
"es": "Spagnolo",
111111
"ru": "Russo",
112-
"it": "Italiano"
112+
"it": "Italiano",
113+
"pl": "Polacco"
113114
},
114115
"fontSize": {
115116
"title": "Dimensione del testo",

‎src/renderer/src/i18n/locales/ja.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "ドイツ語",
110110
"es": "スペイン語",
111111
"ru": "ロシア語",
112-
"it": "イタリア語"
112+
"it": "イタリア語",
113+
"pl": "ポーランド語"
113114
},
114115
"fontSize": {
115116
"title": "フォントサイズ",

‎src/renderer/src/i18n/locales/ko.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@
109109
"de": "Deutsch",
110110
"es": "Español",
111111
"ru": "Русский",
112-
"it": "이탈리아어"
112+
"it": "이탈리아어",
113+
"pl": "폴란드어"
113114
},
114115
"fontSize": {
115116
"title": "글꼴 크기",

0 commit comments

Comments
 (0)