unsloth/studio
Michael Han 6e375a5b17
Studio: add French, German, Spanish, Hindi, Arabic, Russian and Korean display languages (#7076)
* Studio: add 7 display languages, complete and fix existing locales

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.

* Studio: default display language to auto detect

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.

* Studio: guard import.meta.env in translate for non-Vite contexts

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.

* Studio: RTL for Arabic, translate recipes, keep Traditional Chinese off 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.

* Studio: don't treat legacy synced English as an explicit language pick

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.

* Studio: persist only known language codes from the locale table

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.

* Studio i18n: fix Train label transliteration and tidy locale consistency

- 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.

* Studio i18n: keep Arabic layout LTR until physical-direction CSS is converted

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.

* Studio i18n: do not let a generic zh after a Traditional tag pick Simplified

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.

* Studio i18n: collapse two locale comments to a single line

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.

* Studio i18n: translate Hindi strings that were left in English

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.

---------

Co-authored-by: danielhanchen <danielhanchen@gmail.com>
2026-07-14 01:38:04 -07:00
..
backend Studio: render image content returned by MCP tools (#7081) 2026-07-14 00:30:21 -07:00
frontend Studio: add French, German, Spanish, Hindi, Arabic, Russian and Korean display languages (#7076) 2026-07-14 01:38:04 -07:00
src-tauri Speed up Studio startup path (#6899) 2026-07-07 18:08:07 -07:00
__init__.py Final cleanup 2026-03-12 18:28:04 +00:00
install_llama_prebuilt.py Studio: remove AGENTS.md and CLAUDE.md from install artifacts (#7096) 2026-07-13 00:15:04 -07:00
install_node_prebuilt.py Pin isolated Node.js installer to committed sha256 digests (#6625) 2026-06-24 05:47:58 -07:00
install_python_stack.py Studio: fix flash-attn and torchao install on Blackwell (sm_100+) GPUs (Closes #6961) (#6970) 2026-07-08 06:38:10 -07:00
LICENSE.AGPL-3.0 Add AGPL-3.0 license to studio folder 2026-03-09 19:36:25 +00:00
node_prebuilt_pins.json Pin isolated Node.js installer to committed sha256 digests (#6625) 2026-06-24 05:47:58 -07:00
package-lock.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
package.json ci: advisory lockfile supply-chain audit (no install-script changes) (#5604) 2026-05-19 05:56:56 -07:00
setup.bat Final cleanup 2026-03-12 18:28:04 +00:00
setup.ps1 Tighten Studio instruction-file cleanup boundaries (#7097) 2026-07-13 01:46:23 -07:00
setup.sh Tighten Studio instruction-file cleanup boundaries (#7097) 2026-07-13 01:46:23 -07:00
Unsloth_Studio_Colab.ipynb Studio Colab: opt-in shareable Cloudflare tunnel link (#6684) 2026-06-26 00:56:23 -07:00