studio: show the EU strings the page already defines (STUDIO-EU-STRINGS) #2339

Open
github-bot wants to merge 1 commit from github-bot/gh-2339 into main AGit
Owner

@⁠syfyra on GitHub · 2026-11-26 14:06 UTC · original
syfyra:fix/studio-stats-labels-i18n → main · +62 −8 · 2 files · 1 commits · draft

Claimed in the coordination issue as: STUDIO-EU-STRINGS (#1608)

What and why

viewer/studio.html (served by tools/gallery.py) has an RU/EU switch and an I18N table with both languages, but several entries were never applied, so after choosing EU the page kept Russian text:

Text on main Entry that existed but was unused
stats labels Модель / Категория / Полигонов (треугольников) / Вершин / Размер файла statModel, statCategory, statTriangles, statVertices, statSize
button Сброс камеры resetCamera
heading Галерея текстур (DDS & PNG) texHeading
chip Все (N) allCategories
N текстур найдено texCountSuffix
Текстуры не найдены / Ничего не найдено texNotFound / modelsNotFound
Показать все (N ещё), Ошибка загрузки текстур none: added as showAllTextures and texLoadError

applyTranslations now sets the stats labels, the button, the heading, the chip and the texture count; the model and texture lists, which already re-render on a switch, read their messages from I18N. The markup is unchanged apart from two ids (btn-reset-camera, tex-heading): each stats label is the text node in front of its value (<div>Модель: <b id="stat-name">), set the way the tab buttons' labels already are. Russian stays the default and reads exactly as before.

Left out on purpose: the category names (catNames exists, but the chips are built once per load and the names already carry English in brackets) and the model download alert (it sits in the lines #2100 changes).

Merges cleanly with the open studio PRs #1138, #1490, #2100, #2136, #2250 and with #2335 (STUDIO-MODEL-DETAILS, which adds translated rows to the same panel); with #2335 merged in, the studio tests pass 16/16.

Tested

Windows 11, Node 26.12.1, no game files:

  • node --test tests/test_viewer_studio.cjs: 13 pass. The new test loads an empty texture list and an empty model list in RU, switches to EU and checks all of the strings above, then the "show all" button with 81 textures and the load-error text. It fails on main (the labels stay Russian); the 12 existing tests pass.
  • scripts/check_no_game_data.py on both files.

GPUs tested: n/a (no GPU code)

AI-assisted: yes (Claude Code, Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a: no translator change)

🤖 Generated with Claude Code

**@⁠syfyra** on GitHub · 2026-11-26 14:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2339) `syfyra:fix/studio-stats-labels-i18n` → `main` · +62 −8 · 2 files · 1 commits · draft Claimed in the coordination issue as: STUDIO-EU-STRINGS (https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608) ### What and why `viewer/studio.html` (served by `tools/gallery.py`) has an RU/EU switch and an `I18N` table with both languages, but several entries were never applied, so after choosing EU the page kept Russian text: | Text on `main` | Entry that existed but was unused | |---|---| | stats labels Модель / Категория / Полигонов (треугольников) / Вершин / Размер файла | `statModel`, `statCategory`, `statTriangles`, `statVertices`, `statSize` | | button Сброс камеры | `resetCamera` | | heading Галерея текстур (DDS & PNG) | `texHeading` | | chip Все (N) | `allCategories` | | N текстур найдено | `texCountSuffix` | | Текстуры не найдены / Ничего не найдено | `texNotFound` / `modelsNotFound` | | Показать все (N ещё), Ошибка загрузки текстур | none: added as `showAllTextures` and `texLoadError` | `applyTranslations` now sets the stats labels, the button, the heading, the chip and the texture count; the model and texture lists, which already re-render on a switch, read their messages from `I18N`. The markup is unchanged apart from two ids (`btn-reset-camera`, `tex-heading`): each stats label is the text node in front of its value (`<div>Модель: <b id="stat-name">`), set the way the tab buttons' labels already are. Russian stays the default and reads exactly as before. Left out on purpose: the category names (`catNames` exists, but the chips are built once per load and the names already carry English in brackets) and the model download alert (it sits in the lines #2100 changes). Merges cleanly with the open studio PRs #1138, #1490, #2100, #2136, #2250 and with #2335 (STUDIO-MODEL-DETAILS, which adds translated rows to the same panel); with #2335 merged in, the studio tests pass 16/16. ### Tested Windows 11, Node 26.12.1, no game files: - `node --test tests/test_viewer_studio.cjs`: 13 pass. The new test loads an empty texture list and an empty model list in RU, switches to EU and checks all of the strings above, then the "show all" button with 81 textures and the load-error text. It fails on `main` (the labels stay Russian); the 12 existing tests pass. - `scripts/check_no_game_data.py` on both files. GPUs tested: n/a (no GPU code) AI-assisted: yes (Claude Code, Claude Opus 5.5) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a: no translator change) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
viewer/studio.html has an RU/EU switch and an I18N table, but several
of its entries were never applied, so the EU page kept Russian text: the
five stats labels (Модель, Категория, Полигонов, Вершин, Размер файла),
the reset-camera button, the texture gallery heading, the "Все" category
chip, the texture count, and the empty-list messages for models and
textures. The "show all" button and the texture load error had no
entries at all.

Apply them: applyTranslations sets the labels (each is the text node in
front of its value, so the markup stays as it is), the button, the
heading, the chip and the count; the lists, which re-render on a switch,
read their messages from I18N. Two entries are added for the "show all"
button and the load error. The category names and the model download
alert are left for later.

Tested: new test in tests/test_viewer_studio.cjs (fails before the
change, passes after); the existing studio tests pass.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 14:08:09 +00:00
Author
Owner

@⁠lixonik on GitHub · 2026-11-26 15:43 UTC · original · reviewed

Windows 11/Node: 13/13 Studio tests passed, including selecting the added locales and localized controls. No findings from these checks.

AI-assisted.

**@⁠lixonik** on GitHub · 2026-11-26 15:43 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2339#pullrequestreview-6076963347) · **reviewed** Windows 11/Node: 13/13 Studio tests passed, including selecting the added locales and localized controls. No findings from these checks. AI-assisted.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2339/head:github-bot/gh-2339'
git switch 'github-bot/gh-2339'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2339'
git switch 'github-bot/gh-2339'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2339'
git switch 'github-bot/gh-2339'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2339'
git switch 'main'
git merge --squash 'github-bot/gh-2339'
git switch 'main'
git merge --ff-only 'github-bot/gh-2339'
git switch 'main'
git merge 'github-bot/gh-2339'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.