Skip to content

studio: EU mode applies every I18N string, not 13 of 23 - #6704

Open
dukefissura wants to merge 1 commit into
ItsNotRexed:mainfrom
dukefissura:studio-eu-strings
Open

dukefissura wants to merge 1 commit into
ItsNotRexed:mainfrom
dukefissura:studio-eu-strings

Conversation

@dukefissura

Copy link
Copy Markdown
Contributor

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

Depends on: none. It conflicts only textually with #6697 (my STUDIO-MODAL-STALE-IMAGE PR), at the end of tests/test_viewer_studio.cjs, where both append a test. Its viewer/studio.html changes don't touch openModal or the <img onerror> lines that #6529 and #6441 change.

What and why

viewer/studio.html defines an I18N table with an English (EU) entry for each string, but applyTranslations used only 13 of its 23 keys. After switching to EU, these stayed in Russian: the model stats labels, the Reset Camera button, the texture gallery heading and count, the not-found messages, the All chip and the category names (catNames). Seven more user-visible strings had no key at all: the model load error, the two show-more buttons, and the texture loading and load-error texts.

Now every key is applied:

  • the stat labels, the Reset Camera button and the gallery heading get ids that applyTranslations sets;
  • the category chips and group headers show catNames, and the chips keep the selected category when re-rendered;
  • the seven strings get keys in both languages (texLoading, texLoadError, showMore, showAll, modelLoadError), and the texture count is rebuilt from texCountSuffix whenever the language changes.

A model without a category is grouped under the Прочее (Miscellaneous) key that catNames translates. Russian mode reads as before.

Tested

Linux, Node 22.23.5, CPU only, no GPU or driver involved, no game files.

  • node --test tests/test_viewer_studio.cjs: 4/4 on top of main 1cc6e3c.
  • The new EU mode shows no Russian test loads 101 synthetic models (one without a category), a category map and 81 textures, switches to EU, and checks that no rendered text, placeholder or tab label contains Cyrillic characters. It also checks the not-found and load-error texts, then switches back to Russian. It fails without the viewer/studio.html change and passes with it.
  • tests/test_viewer_streaming.cjs: the only failure is the Shift/Ctrl test that already fails on main (fixed by test(viewer): pass AbortController and timers into camera-speed vm context #5692).
  • git diff --check is clean.

AI-assisted: yes (Claude)

Checklist

  • 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. (Not applicable: no translator change.)

…of the page in Russian

viewer/studio.html defines an I18N table with an English (EU) entry for each string, but
applyTranslations used 13 of its 23 keys. The model stats labels, the Reset Camera button, the
texture gallery heading and count, the not-found messages, the All chip and the category names
(catNames) stayed in Russian after switching to EU, and seven more strings (the model load error,
the two show-more buttons, the texture loading and load-error texts) had no key at all.

Every key is now applied: the stat labels, the Reset Camera button and the gallery heading get ids,
the category chips and group headers show catNames, the chips keep the selected category when
re-rendered, and the seven strings get keys in both languages. A model without a category is grouped
under the 'Прочее (Miscellaneous)' key that catNames translates; Russian mode reads as before.

tests/test_viewer_studio.cjs: switch to EU with models, categories and 81 textures loaded and check
that no rendered text has Cyrillic characters, plus the not-found and load-error texts, then back to
Russian. It fails before the change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fi5BEBqGPiXnY67f9mzu13
@kapitche

Copy link
Copy Markdown
Contributor

Tested e3cb3bb merged with main a66e6e3 on Linux/Node v22.23.5 (no Python involved; the test is a .cjs file run by ci.yml with node --test tests/test_*.cjs): pass

Commands (fresh worktree of upstream/main with the PR head merged):

  • node --test tests/test_viewer_studio.cjs -> 4 tests, 4 pass (includes the new EU-mode test)
  • node --test tests/test_*.cjs -> 61 tests, 60 pass, 1 fail: "Shift speeds the camera up and Ctrl slows it down, on either side of the keyboard". That test is not touched by this PR; plain upstream/main (a66e6e3) gives 60 tests, 59 pass, the same 1 fail, so it is pre-existing.

Negative control: git checkout upstream/main -- viewer/studio.html (new test kept) -> node --test tests/test_viewer_studio.cjs: 4 tests, 3 pass, 1 fail, the new "EU mode shows no Russian" test with an AssertionError; restoring the PR's studio.html makes it pass.

Diff read: the test drives the page through a stubbed DOM, so it checks every element's text/innerHTML/placeholder for Cyrillic after setLanguage('eu') and the exact strings for the newly translated ones; it does not render in a real browser. Switching back to ru is checked too. No concerns.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

viewer/studio.html adds IDs to previously hard-coded Russian labels and applies every I18N string in setLanguage, including new texLoading, texLoadError, showMore, showAll, and modelLoadError entries. A categoryLabel helper maps gallery.py's Russian-with-English-gloss category names through I18N[currentLang].catNames; updateTexCount handles loaded, error, and idle states; chips, empty states, and the model-load alert now use the active language. tests/test_viewer_studio.cjs adds an EU-mode test asserting no Cyrillic appears and checking RU still works afterward.

Why merge

English-mode users were seeing Russian in stats, category chips, and error states because those strings never had translation entries. This closes the gaps and keeps category labels consistent between gallery and studio. The test walks the full element tree for Cyrillic, so future untranslated additions fail loudly.

Verdict: Approve

@shayderrr

Copy link
Copy Markdown
Collaborator

Summary

viewer/studio.html adds IDs to previously hard-coded Russian labels and applies every I18N string in setLanguage, including new texLoading, texLoadError, showMore, showAll, and modelLoadError entries. A categoryLabel helper maps gallery.py's Russian-with-English-gloss category names through I18N[currentLang].catNames; updateTexCount handles loaded, error, and idle states; chips, empty states, and the model-load alert now use the active language. tests/test_viewer_studio.cjs adds an EU-mode test asserting no Cyrillic appears and checking RU still works afterward.

Why merge

English-mode users were seeing Russian in stats, category chips, and error states because those strings never had translation entries. This closes the gaps and keeps category labels consistent between gallery and studio. The test walks the full element tree for Cyrillic, so future untranslated additions fail loudly.

Verdict: Approve

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants