Skip to content

Commit 979ac81

Browse files
feat(app): add Hebrew locale (anomalyco#42475)
Co-authored-by: Luke Parker <10430890+Hona@users.noreply.github.com>
1 parent 71caa7d commit 979ac81

10 files changed

Lines changed: 1515 additions & 1 deletion

File tree

‎.opencode/glossary/he.md‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# he Glossary
2+
3+
## Sources
4+
5+
- Hebrew Academy approved IT terminology: https://terms.hebrew-academy.org.il/Millonim/ShowMillon?KodMillon=192
6+
- Firefox Hebrew localization corpus: https://github.com/mozilla-l10n/firefox-l10n/tree/main/he
7+
- KDE Hebrew localization team and corpus: https://l10n.kde.org/team-infos.php?teamcode=he
8+
- Community-maintained VS Code Hebrew language pack: https://github.com/AMAARETS/vscode-language-pack-he
9+
- Microsoft Hebrew developer documentation for Git terminology: https://learn.microsoft.com/he-il/power-platform/alm/tutorials/github-actions-deploy
10+
- W3C guidance for bidirectional text: https://www.w3.org/International/articles/strings-and-bidi/
11+
12+
## Do Not Translate (Locale Additions)
13+
14+
- `OpenCode` (preserve casing in prose and UI copy)
15+
- `API`, `MCP`, `LSP`, `OAuth`, `Git`, model names, and provider names
16+
- Commands, flags, keyboard shortcuts, file paths, URLs, identifiers, hashes, and code literals
17+
- Keep `commit` and `diff` when they name the exact Git artifact or operation
18+
19+
## Preferred Terms
20+
21+
| English / Context | Preferred | Notes |
22+
| ----------------- | ------------- | ------------------------------------------------------------------------- |
23+
| session | `הפעלה` | Use `שיחה` only when the source specifically means a chat or conversation |
24+
| workspace | `סביבת עבודה` | |
25+
| terminal | `מסוף` | Prefer the established Hebrew term over transliteration |
26+
| command | `פקודה` | |
27+
| provider | `ספק` | Use `ספק מודלים` where the bare noun is ambiguous |
28+
| model | `מודל` | |
29+
| API key | `מפתח API` | Keep the acronym in Latin letters |
30+
| plugin | `תוסף` | |
31+
| repository | `מאגר` | Use `מאגר Git` where context is ambiguous |
32+
| branch | `ענף` | |
33+
| context | `הקשר` | Use `חלון הקשר` for context window |
34+
| tokens | `אסימונים` | |
35+
36+
## Guidance
37+
38+
- Prefer natural modern Israeli Hebrew over word-for-word translation or obscure coined terms.
39+
- Use short action verbs for controls and translate complete phrases in context.
40+
- Keep recognized developer acronyms and exact Git vocabulary in Latin script instead of phonetic transliteration.
41+
- Treat embedded code, paths, commands, shortcuts, hashes, model IDs, and other Latin technical artifacts as LTR content inside the RTL interface.
42+
- Keep recurring concepts consistent and do not collapse session, chat, run, and launch into one Hebrew term.
43+
44+
## Avoid
45+
46+
- Avoid transliterations such as `טרמינל`, `פלאגין`, and `קומנד` when `מסוף`, `תוסף`, and `פקודה` are clear.
47+
- Avoid translating `commit` as `התחייבות`.
48+
- Avoid inventing Hebrew expansions for `API`, `MCP`, or `LSP`.

‎packages/app/src/context/language.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import {
2525
export type Locale = DesktopNativeLocale
2626
export type Direction = "ltr" | "rtl"
2727

28-
const RTL_LOCALES: ReadonlySet<Locale> = new Set(["ar", "ur", "pa", "fa", "dv"])
28+
const RTL_LOCALES: ReadonlySet<Locale> = new Set(["ar", "he", "ur", "pa", "fa", "dv"])
2929

3030
function localeDirection(locale: Locale): Direction {
3131
return RTL_LOCALES.has(locale) ? "rtl" : "ltr"
@@ -73,6 +73,7 @@ const loaders: Record<Exclude<Locale, "en">, () => Promise<Dictionary>> = {
7373
ru: () => merge(import("@/i18n/ru"), import("@opencode-ai/ui/i18n/ru")),
7474
uk: () => merge(import("@/i18n/uk"), import("@opencode-ai/ui/i18n/uk")),
7575
ar: () => merge(import("@/i18n/ar"), import("@opencode-ai/ui/i18n/ar")),
76+
he: () => merge(import("@/i18n/he"), import("@opencode-ai/ui/i18n/he")),
7677
no: () => merge(import("@/i18n/no"), import("@opencode-ai/ui/i18n/no")),
7778
br: () => merge(import("@/i18n/br"), import("@opencode-ai/ui/i18n/br")),
7879
th: () => merge(import("@/i18n/th"), import("@opencode-ai/ui/i18n/th")),

‎packages/app/src/i18n/desktop-native.test.ts‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ describe("desktop native translations", () => {
2929
"Українська",
3030
"Bosanski",
3131
"العربية",
32+
"עברית",
3233
"Norsk",
3334
"Português (Brasil)",
3435
"ไทย",
@@ -133,6 +134,11 @@ describe("desktop native locale detection", () => {
133134
expect(detectDesktopNativeLocale(["nb-NO"])).toBe("no")
134135
expect(detectDesktopNativeLocale(["nn-NO"])).toBe("no")
135136
})
137+
138+
test("recognizes Hebrew language tags", () => {
139+
expect(detectDesktopNativeLocale(["he"])).toBe("he")
140+
expect(detectDesktopNativeLocale(["he-IL"])).toBe("he")
141+
})
136142
})
137143

138144
describe("desktop native ICU data", () => {

‎packages/app/src/i18n/desktop-native.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const DESKTOP_NATIVE_LOCALES = [
1313
"uk",
1414
"bs",
1515
"ar",
16+
"he",
1617
"no",
1718
"br",
1819
"th",
@@ -80,6 +81,7 @@ export const DESKTOP_NATIVE_LABELS: Record<DesktopNativeLocale, string> = {
8081
uk: "Українська",
8182
bs: "Bosanski",
8283
ar: "العربية",
84+
he: "עברית",
8385
no: "Norsk",
8486
br: "Português (Brasil)",
8587
th: "ไทย",
@@ -145,6 +147,7 @@ export const DESKTOP_NATIVE_LOCALE_TAGS: Record<DesktopNativeLocale, string> = {
145147
uk: "uk",
146148
bs: "bs",
147149
ar: "ar",
150+
he: "he-IL",
148151
no: "nb-NO",
149152
br: "pt-BR",
150153
th: "th",

0 commit comments

Comments
 (0)