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

Open
opened 2026-11-26 21:20:53 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2339
Author: @syfyra
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: fix/studio-stats-labels-i18n


📝 Commits (1)

  • 3c9a09f studio: show the EU strings the page already defines (STUDIO-EU-STRINGS)

📊 Changes

2 files changed (+62 additions, -8 deletions)

View changed files

📝 tests/test_viewer_studio.cjs (+33 -0)
📝 viewer/studio.html (+29 -8)

📄 Description

Claimed in the coordination issue as: STUDIO-EU-STRINGS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7194265327)

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2339 **Author:** [@syfyra](https://github.com/syfyra) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/studio-stats-labels-i18n` --- ### 📝 Commits (1) - [`3c9a09f`](https://github.com/ubiquitarianism/leonida/commit/3c9a09f12a556ef29316132e2d47749cb2f845ad) studio: show the EU strings the page already defines (STUDIO-EU-STRINGS) ### 📊 Changes **2 files changed** (+62 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_viewer_studio.cjs` (+33 -0) 📝 `viewer/studio.html` (+29 -8) </details> ### 📄 Description Claimed in the coordination issue as: STUDIO-EU-STRINGS (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7194265327) ### 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2341
No description provided.