[PR #2377] studio: show category names in the chosen language (STUDIO-CATEGORY-NAMES) #2380

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

📋 Pull Request Information

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

Base: main ← Head: fix/studio-category-names


📝 Commits (2)

  • 3c9a09f studio: show the EU strings the page already defines (STUDIO-EU-STRINGS)
  • 45a128d studio: show category names in the chosen language (STUDIO-CATEGORY-NAMES)

📊 Changes

2 files changed (+95 additions, -10 deletions)

View changed files

📝 tests/test_viewer_studio.cjs (+54 -0)
📝 viewer/studio.html (+41 -10)

📄 Description

Claimed in the coordination issue as: STUDIO-CATEGORY-NAMES (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7197726846)

Depends on: #2339 (STUDIO-EU-STRINGS). This branch is built on it, so the diff here shows both commits; the change of this pull request is the last commit, 45a128d32. Once #2339 lands, only that commit remains.

What and why

viewer/studio.html (served by tools/gallery.py) has a catNames entry in both languages of its I18N table. tools/gallery.py names each category in both languages ("Транспорт (Vehicles)"); catNames maps that to "Транспорт" for RU and "Vehicles" for EU. Nothing read catNames, so the category chips and the model list headers showed the server's two-language name whatever the language. It is the last unused entry of the table: #2339 applies the others and left this one out because the chips are built once per load.

  • The chips and the list headers now show categoryLabel(cat), which is catNames[cat] of the current language, or the server's name when catNames has no entry for it.
  • The server's name stays the filter key (selectCategory, activeCategory, the search), so filtering is unchanged.
  • The chips are relabelled on a language switch from a small list kept when they are built. The list headers already re-render on a switch.

Tested

Windows 11, Node 26.12.1, no game files:

  • node --test tests/test_viewer_studio.cjs: 14 pass. The new test builds chips and the list for Транспорт (Vehicles) and an unlisted Custom. It checks Транспорт (1) / Custom (1) and the headers in RU, then Vehicles (1) / Custom (1) after setLanguage('eu'), then that selecting the chip filters by the server's name. It fails on #2339's head; the other 13 pass.
  • Merges cleanly with the open studio PRs #1138, #1490, #2100, #2136, #2250 and with #2335.
  • 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/2377 **Author:** [@syfyra](https://github.com/syfyra) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/studio-category-names` --- ### 📝 Commits (2) - [`3c9a09f`](https://github.com/ubiquitarianism/leonida/commit/3c9a09f12a556ef29316132e2d47749cb2f845ad) studio: show the EU strings the page already defines (STUDIO-EU-STRINGS) - [`45a128d`](https://github.com/ubiquitarianism/leonida/commit/45a128d3285599fb8fdd4c697f51118ac0849251) studio: show category names in the chosen language (STUDIO-CATEGORY-NAMES) ### 📊 Changes **2 files changed** (+95 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_viewer_studio.cjs` (+54 -0) 📝 `viewer/studio.html` (+41 -10) </details> ### 📄 Description Claimed in the coordination issue as: STUDIO-CATEGORY-NAMES (https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7197726846) Depends on: #2339 (STUDIO-EU-STRINGS). This branch is built on it, so the diff here shows both commits; the change of this pull request is the last commit, 45a128d32. Once #2339 lands, only that commit remains. ### What and why `viewer/studio.html` (served by `tools/gallery.py`) has a `catNames` entry in both languages of its `I18N` table. `tools/gallery.py` names each category in both languages (`"Транспорт (Vehicles)"`); `catNames` maps that to `"Транспорт"` for RU and `"Vehicles"` for EU. Nothing read `catNames`, so the category chips and the model list headers showed the server's two-language name whatever the language. It is the last unused entry of the table: #2339 applies the others and left this one out because the chips are built once per load. - The chips and the list headers now show `categoryLabel(cat)`, which is `catNames[cat]` of the current language, or the server's name when `catNames` has no entry for it. - The server's name stays the filter key (`selectCategory`, `activeCategory`, the search), so filtering is unchanged. - The chips are relabelled on a language switch from a small list kept when they are built. The list headers already re-render on a switch. ### Tested Windows 11, Node 26.12.1, no game files: - `node --test tests/test_viewer_studio.cjs`: 14 pass. The new test builds chips and the list for `Транспорт (Vehicles)` and an unlisted `Custom`. It checks `Транспорт (1)` / `Custom (1)` and the headers in RU, then `Vehicles (1)` / `Custom (1)` after `setLanguage('eu')`, then that selecting the chip filters by the server's name. It fails on #2339's head; the other 13 pass. - Merges cleanly with the open studio PRs #1138, #1490, #2100, #2136, #2250 and with #2335. - `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#2380
No description provided.