Files
romm/backend/handler
Sam Dornan 74c8e4bfb5 feat(metadata): read a fan translation's tag and target language (#4665)
* feat(metadata): read a fan translation's tag and target language

A translated dump is playable in the language it was translated into, but the
tag saying so was kept verbatim, so the rom was filed under no language at all
and the filter drawer grew one throwaway value per patch: "T+Eng1.1_RPGe" and
"T-Eng0.98_DeJap" are the same thing to a reader and two different facets to
the gallery.

The GoodTools, TOSEC and plain spellings now resolve to one "Translation" tag,
and the language the patch targets joins the rom's languages, so a Japanese
game translated into English answers a search for English and reaches an
emulator as English. A translation into a language RomM cannot name is still
tagged, and a tag that merely starts with "tr", like "Trainer", is left alone.

The group and patch version the raw tag carries are dropped, since nothing
reads them and keeping them is what splits the facet.

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

* feat(metadata): read the spaced form of a GoodTools translation tag

"[T Fre]" separates with a space rather than a sign, and it is the spelling a
real ScreenScraper dump carries: its entry for "Super Mario Bros. (W) [T Fre]"
is flagged as a translation into French. The tag was read only as "T+Fre" or
"T-Fre", so that dump came out untranslated and unlanguaged.

A space carries no meaning of its own, unlike the sign, so this spelling counts
only when the word after it names a language: "(T Rex)" stays an ordinary tag.

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

* style(metadata): trim the translation alias comment to two lines

Greptile flagged it against the repo's comment discipline: four lines, and
the product as the actor.

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

* feat(metadata): resolve the short forms of a translation tag's language

"[T-En]" already resolved through the filename language vocabulary; the
non-ISO abbreviations "Ge", "Sp", "Du", "Gr" and "Jp" did not, so those
dumps were tagged without a language. Tests now cover both forms.

Also trims three comments and four test docstrings Greptile flagged
against the repo's comment discipline.

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

* fix(metadata): stop reading a hyphenated word as a translation

"(T-Rex)" matched the GoodTools superseded form and became a Translation
tag. A superseded patch carries its version and group, so require that,
or a language the vocabulary names, before the bare "T-" form counts.

"[T+Tha]" still tags, since no ordinary word takes that shape.

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

* style(metadata): trim the translation regex comment to two lines

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

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-22 23:03:49 -05:00
..
2025-12-07 12:19:13 -05:00