Repository navigation
Studio: add French, German, Spanish, Hindi, Arabic, Russian and Korean display languages - #7076
Conversation
Adds fully translated French, German, Spanish, Hindi, Arabic, Russian and Korean locales. Fills in all missing keys for zh-CN (113), ja (71) and pt-BR (47), fixes translation errors found in review, and reorders the language dropdown by popularity. All overlays pass check-parity with zero missing keys and zero placeholder mismatches.
There was a problem hiding this comment.
Code Review
This pull request introduces several new localization files (Arabic, German, Spanish, French, Hindi, Korean, and Russian) to Unsloth Studio, registers them in the translation system, and updates existing Japanese and Portuguese translations. The review feedback highlights that the term 'recipes' was left untranslated in the French and German locales, and suggests translating them to 'Recettes' and 'Rezepte' respectively.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| search: "Rechercher", | ||
| hub: "Hub", | ||
| train: "Entraîner", | ||
| recipes: "Recipes", |
There was a problem hiding this comment.
The term recipes is currently left untranslated as "Recipes" in French, whereas other languages like Spanish ("Recetas"), Russian ("Рецепты"), and Japanese ("レシピ") have translated it. To ensure a fully localized experience, please translate it to "Recettes".
| recipes: "Recipes", | |
| recipes: "Recettes", |
There was a problem hiding this comment.
Good catch, done. I translated it to "Recettes" here, and also fixed the same gap in German (Rezepte), Korean (레시피) and Hindi (रेसिपी) so all locales that translate this nav label are consistent. English keeps "Recipes" as the source.
| search: "Suchen", | ||
| hub: "Hub", | ||
| train: "Trainieren", | ||
| recipes: "Recipes", |
There was a problem hiding this comment.
The term recipes is currently left untranslated as "Recipes" in German, whereas other languages like Spanish ("Recetas"), Russian ("Рецепты"), and Japanese ("レシピ") have translated it. To ensure a fully localized experience, please translate it to "Rezepte".
| recipes: "Recipes", | |
| recipes: "Rezepte", |
There was a problem hiding this comment.
Done, translated to "Rezepte". Applied the same fix to Korean and Hindi as well for consistency.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fb58f682fe
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| de: { label: "German", nativeLabel: "Deutsch" }, | ||
| ru: { label: "Russian", nativeLabel: "Русский" }, | ||
| hi: { label: "Hindi", nativeLabel: "हिन्दी" }, | ||
| ar: { label: "Arabic", nativeLabel: "العربية" }, |
There was a problem hiding this comment.
Set RTL direction when enabling Arabic
With ar now exposed as a selectable locale, choosing it only updates document.documentElement.lang in syncDocumentLang; repo search shows no code setting document.documentElement.dir, while components such as the calendar/sidebar already rely on rtl: styles. Arabic users therefore get RTL text inside an LTR shell instead of mirrored controls and spacing, so the Arabic locale should carry direction metadata and sync dir="rtl" when selected.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Agreed, implemented. Each locale now carries a dir field and the locale store syncs document.documentElement.dir alongside lang, so Arabic sets dir="rtl" and the others reset to "ltr". I verified the mirrored layout in Chromium, Firefox and WebKit: the shell, sidebar and settings dialog all flip cleanly since the layout is flexbox based. Chat input and messages keep dir="auto" so per-message detection still works.
There was a problem hiding this comment.
Declining this one for now. Setting dir=rtl only mirrors the rtl:-aware and flex based surfaces; the shared primitives use physical-direction utilities with no RTL plugin (select chevron right-2, dialog close top-5 right-5, dropdown check right-2), so they land on the wrong side under rtl. Kept Arabic on an LTR layout in 8a2f1b2. Its text still renders right to left per element via bidi and chat content keeps dir=auto, so nothing regresses. Full layout mirroring can be a follow up once the physical direction classes are converted to logical ones.
The language preference now defaults to auto and resolves against the browser language list, with exact tag match first and language subtag match second (pt-PT resolves to pt-BR, zh-TW to zh-CN). Auto detect is the first dropdown option and is translated in every locale. Explicit choices still persist and sync; personalization sync now round trips the preference instead of the resolved locale so auto stays auto across devices. Auto mode also follows browser languagechange events.
|
Pushed a follow-up: the display language now defaults to Auto detect, listed first in the dropdown and translated in every locale. It resolves from the browser language list (exact tag first, then language subtag, so pt-PT gets pt-BR and zh-TW gets zh-CN) and falls back to English. Picking a specific language pins it as before, and personalization sync carries the preference itself so Auto detect stays Auto detect across devices. Parity and the type checked build both still pass. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7706627c9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| return ( | ||
| locales.find((locale) => locale.toLowerCase().split("-")[0] === language) ?? |
There was a problem hiding this comment.
Avoid falling back all Chinese variants to zh-CN
With auto detection now the default, a browser set to Traditional Chinese (for example navigator.languages = ["zh-TW", "en-US"]) hits this base-language fallback for zh-TW and resolves to zh-CN before considering any later preference. That serves Simplified Chinese to Traditional Chinese users, which is often less usable than falling back to English; consider special-casing Chinese script/region matching instead of treating every zh-* tag as zh-CN.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good point, fixed. Detection no longer maps Traditional Chinese to Simplified: zh-Hant, zh-TW, zh-HK and zh-MO now fall through to the next preferred language (English if nothing else matches) instead of resolving to zh-CN. Simplified tags (zh, zh-CN, zh-SG, zh-Hans, and zh-Hans-TW where the script is explicit) still resolve to zh-CN. This matches how CLDR and the major platforms keep Hans and Hant separate.
translate() read import.meta.env.DEV directly, which throws when the module runs outside Vite (SSR or Node tooling). Optional-chain it so the dev-only warning is skipped and translation still works everywhere.
…ff zh-CN - Sync document dir from a per-locale dir field so Arabic mirrors the layout instead of rendering RTL text in an LTR shell. - Translate the recipes nav label in fr, de, ko and hi to match the other locales (Recettes, Rezepte, and native forms). - Detection no longer maps Traditional Chinese (zh-Hant / zh-TW / zh-HK / zh-MO) to Simplified zh-CN; those tags fall through to the next preferred language. Simplified tags (zh, zh-CN, zh-SG, zh-Hans) still resolve to zh-CN.
|
Thanks for the reviews. Addressed everything in the latest commits:
Ran the i18n parity check (all locales 0 missing), the type checked build, and a cross browser matrix (Chromium, Firefox, WebKit) covering detection, RTL direction, pinning, persistence and the Traditional Chinese fallback. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c84713c7e
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const nextLanguage = isLocalePreference(remote.appearance.language) | ||
| ? remote.appearance.language | ||
| : latestLanguageRef.current; |
There was a problem hiding this comment.
Migrate legacy English sync to auto-detect
When an existing account already has any personalization saved from the old code path, that payload also contains appearance.language: "en" because the previous sync always serialized getLocale() whenever profile/theme settings caused a save. Hydrating that legacy record now treats "en" as an explicit pinned preference, so a user with a Spanish/French/etc. browser and an old synced profile is switched back to English instead of the new Auto detect default; consider distinguishing legacy default English from an explicit current preference before calling setLocale.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch, fixed. Personalization payloads now carry version 2, which stores the preference itself ("auto" or a pinned locale). On hydrate, a version 1 record with language "en" is mapped to auto, since the old sync serialized the resolved locale on every save and that "en" is almost always the old default rather than a deliberate choice. Explicit picks of any other locale from version 1, and every version 2 value (including a real English pick), are kept as-is.
Verified against the running server by seeding studio.db with four payload shapes and logging in from a French browser each time: v1 "en" resolves to auto (stays French), v1 "ja" stays pinned Japanese, v2 "en" stays pinned English, and v2 "auto" resolves French.
The old sync serialized the resolved locale on every save, so existing profiles carry appearance.language 'en' even when the user never chose a language. Hydrating that as a pinned locale forced non-English browsers back to English under the new Auto detect default. Payloads now carry version 2 (the preference itself); on hydrate a version 1 'en' maps to auto, while explicit picks and all version 2 values are kept as-is.
normalizePreference now returns a value re-derived from the LOCALES keys instead of the raw input. It stays functionally identical (the stored value was already whitelisted) but makes it explicit that only known, non-sensitive language codes are written to localStorage, and clears a false-positive clear-text-storage scan on the persistence path.
|
Tested this end to end on a live Studio (before vs after this PR, both driven against the same backend so every difference is purely this change) plus a cross platform CI run. Everything works. Review and evidence below. Verification
The language menu: 4 languages becomes Auto detect plus 11Every locale rendersLive cycle through all of them: Arabic right to leftThe full layout mirrors (sidebar and settings flip), the physical direction classes stay intact, and product names stay Latin. Auto detect (the new default)Browser language set to French resolves the UI to French with the menu showing Detection automatique. Browser language set to Arabic resolves to Arabic and flips the layout to RTL. Pinning a language still overrides detection, and the personalization sync stores the preference so Auto detect stays Auto detect across devices. Appearance tab, English baselineAll individual locale screenshotsBefore (main): the raw dropdown and the three prior localesAfter (this PR): the full dropdown and each localeNotesNothing blocking. The only follow ups are minor translation consistency nits (for example the ja |
- ja and hi: the nav and route Train label used the railway transliteration (トレイン and ट्रेन); switch to the training term already used everywhere else in each file (トレーニング, ट्रेनिंग). - zh-CN: keep VRAM in English to match every other locale and the PR's own keep-English rule, and drop an extra clause added to the upload size hint so it matches the English source. - hi: translate Recents to हाल के in the export and import section to match the sidebar label, and point users to the Configure tab by its translated name (कॉन्फ़िगर). - ru: reword the preview sharing hint to avoid the "disable to disable" repetition. i18n parity and the type checked build stay green.
…onverted Setting ar to dir rtl only mirrors the flex based shell, sidebar and settings dialog. The shared select, dialog and dropdown primitives use physical-direction utilities (right-2, top-5 right-5, ml-auto) that do not flip under dir rtl, so chevrons, close buttons and check marks land on the wrong side. Keep Arabic on an LTR layout for now, matching the original plan in this PR. Arabic text still renders right to left per element via bidi and chat content keeps dir auto, so nothing regresses. Full layout mirroring can follow once the physical-direction classes are converted to logical ones.
|
On a closer pass the Arabic RTL only mirrors the flex based shell, sidebar and settings dialog. The rest of the UI is built on physical-direction Tailwind utilities and there is no RTL plugin, so under
So an Arabic user sees the text mirror while the chevrons, check marks and close buttons sit on the wrong side. I pushed a commit that keeps Arabic on an LTR layout for now ( Full layout mirroring can be a follow up once the physical-direction classes ( |
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a2f1b2c00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return ( | ||
| locales.find((locale) => locale.toLowerCase().split("-")[0] === language) ?? | ||
| null |
There was a problem hiding this comment.
Prevent Traditional Chinese from matching generic zh fallback
For browser language lists such as ['zh-TW', 'zh', 'en-US'], the zh-TW pass returns null, but the later generic zh tag reaches this language-subtag match and selects zh-CN. That defeats the guard above for Traditional Chinese users and still auto-selects Simplified Chinese instead of falling through to their next non-Chinese language or English.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Good catch, fixed in 006b33d. A list like ['zh-TW', 'zh', 'en-US'] no longer resolves to zh-CN: detectLocale now remembers when a Traditional tag was seen and skips a later bare zh, so it keeps falling through (that list now resolves to en). A lone bare zh, and explicit zh-CN or zh-Hans fallbacks, still map to Simplified.
…plified navigator.languages can be a list like ['zh-TW', 'zh', 'en-US']. The zh-TW pass already falls through, but the bare zh then reached the language-subtag match and selected zh-CN, so Traditional Chinese users still got Simplified and the guard was defeated. detectLocale now remembers when a Traditional tag was seen and skips a later bare zh, so detection keeps falling through to the next non-Chinese language. A lone bare zh, and explicit zh-CN or zh-Hans fallbacks, still resolve to Simplified as before.
|
@codex review |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The Arabic dir note in messages.ts and the bare-zh note in locale-store.ts were two lines each; tighten each to one. Comment only, no behavior change.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6236f5120f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| de: { label: "German", nativeLabel: "Deutsch", dir: "ltr" }, | ||
| ru: { label: "Russian", nativeLabel: "Русский", dir: "ltr" }, | ||
| hi: { label: "Hindi", nativeLabel: "हिन्दी", dir: "ltr" }, | ||
| ar: { label: "Arabic", nativeLabel: "العربية", dir: "ltr" }, |
There was a problem hiding this comment.
Set Arabic document direction to RTL
When users select Arabic, syncDocumentLang() copies this metadata into document.documentElement.dir, but ar is declared as ltr. That keeps the newly added Arabic UI in LTR mode, including components and Tailwind rtl: variants that rely on the document direction, so labels, punctuation, and layout direction render incorrectly for Arabic users; set this locale to rtl or decouple text direction from full-layout mirroring if needed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Deliberately keeping Arabic on ltr, same as the earlier RTL thread. The shared primitives use physical-direction utilities with no rtl plugin (select chevron right-2, dialog close top-5 right-5, dropdown check right-2), so dir=rtl mirrors the text but leaves those controls on the wrong side. Arabic text still renders rtl per element via bidi and chat content keeps dir=auto, so nothing regresses. Full layout mirroring is a follow up once the physical-direction classes are converted to logical ones (end-, ms-). This commit only shortened that comment, no behavior change.
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Seventeen hi.ts labels stayed in English while all the other locales translated them: the training parameter labels (Grad Accum, Grad Norm, Grad Checkpoint, Eval Loss, Clip p95/p99, Seed, Continued Pretraining), the API example labels (curl/Python/JavaScript + tools/advanced), Hugging Face token, the VRAM estimate and the training terminal start line. Parity only checks key/placeholder presence so it did not catch these. Brand and technical tokens (curl, Python, VRAM, Loss, p95/p99, Hugging Face, unsloth) stay in English as elsewhere.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Resolve the use-personalization-sync.ts conflict from main's locale preference refactor (unslothai#7076): keep the PR's palette and customization sync while adopting main's LocalePreference API (useLocalePreference, getLocalePreference, isLocalePreference, DEFAULT_LOCALE_PREFERENCE, and remoteLanguagePreference). The payload and hasLocalSettings signatures keep their palette and customization parameters, and the language value now flows through remoteLanguagePreference and isLocalePreference.




















What this does
Expands Studio's display language support from 4 languages to 11 and brings the existing locales up to full coverage.
New languages (fully translated)
Spanish, French, German, Hindi, Arabic, Russian and Korean. Each locale file covers every key in
en.ts(about 750 strings) with consistent ML terminology per language (for example "taux d'apprentissage", "Lernrate", "learning rate" transliterations where conventional). Product and technical names (Unsloth Studio, LoRA, GGUF, Hugging Face, VRAM, llama.cpp, AdamW, etc.) stay in English per the i18n contribution rules.Auto detect (default)
The language preference now defaults to Auto detect, shown as the first option in the dropdown, and resolves the UI language from the browser language list. Exact tag matches win (pt-BR), then the language subtag (pt-PT resolves to pt-BR, zh-Hans and zh-CN resolve to zh-CN), otherwise English. Only Simplified Chinese ships, so Traditional Chinese tags (zh-TW, zh-Hant, zh-HK, zh-MO) fall through to English rather than being forced into Simplified. Picking a language still pins it exactly as before, and Auto detect follows browser languagechange events live. Personalization sync stores the preference rather than the resolved locale, so Auto detect stays Auto detect across devices while pinned choices sync as pinned.
Existing locales completed and fixed
The three non-English locales were partial and silently falling back to English:
Other changes
ja.tsandpt-br.tsnow usesatisfies DeepPartialMessageTree<typeof en>likezh-CN.ts, so overlays are type checked against the English baseline.check-parity.tscovers all 10 overlays.Notes
dir="auto". Full RTL mirroring can be a follow-up.es,fr,de,hi,ar,ru,ko), matching the existing barejatag.Testing
npx tsx src/i18n/check-parity.ts: all 10 overlays report 0 missing keys and 0 placeholder mismatches.npm run build(tsc + vite) passes, which validates thesatisfiesconstraints on every locale file.