Feature Localization Credits - bh679/dungeon-train-mc GitHub Wiki

Home > Features > Localization credits

Localization credits

Lets a localization resource pack credit its translator(s) — name plus an optional link — right on the title screen, for whichever language the player currently has selected.

How It Works

A resource pack that overrides assets/dungeontrain/lang/<locale>.json can ship one or more small JSON files alongside it under assets/dungeontrain/localization_credits/:

{
  "locale": "es_es",
  "name": "Your Name",
  "url": "https://example.com",
  "human_reviewed": true
}
  • locale and name are required; url and human_reviewed (default false) are optional.
  • locale is a Minecraft locale code — the same code as the pack's own lang/<locale>.json filename.
  • One file per contributor; the filename doesn't need to match anything inside the file.
  • Multiple contributors can credit the same locale — all of their names show, comma-separated.

These files are loaded through the client resource-pack pipeline (not the server datapack pipeline the game's narrative content uses) — the main menu has no world loaded yet, so only resource packs are active there. The loader (LocalizationCreditRegistry) reloads on every resource-pack change, including at game launch.

On the title screen, TitleScreenLayoutHandler locates the vanilla language button and looks up any credits for the client's currently selected locale. If there are none, nothing is shown. If there are, a "Localized by <name>" line appears immediately to its left — right-aligned to the same edge as the button, and wrapping onto a second line (growing upward, bottom-aligned) if it wouldn't otherwise fit before the screen's left edge. A credited name is clickable (opening the vanilla link-confirmation screen) only when the entry included a url.

Because the lookup is keyed to the selected language, the credit is never a general "translators" list — it only ever shows the credit relevant to the language currently in front of the player.

Language-selection list badge

The vanilla language-selection screen (Options → Language) badges every language Dungeon Train ships a translation for with the Dungeon Train logo at the left edge of the row (LanguageSelectEntryLogoMixin). The human_reviewed flag drives how that badge renders — a language counts as human-reviewed if any of its credit entries sets it true:

  • Human-reviewed — solid logo.
  • Machine-translated (not human-reviewed) — logo faded to 35% opacity plus a small faded blue "AI" label beside it (since v0.490.0, PR #817), so players can tell at a glance which translations are machine-generated.
  • Untranslated languages — untouched, no badge.

AI-fraction ring

Since v0.499.0 (PR #826) the badge also shows how much of each translation is machine-generated: a blue ring around the logo whose filled circumference is the locale's AI-unreviewed share — AI-authored lines with no human reviewer, over all lines. A full circle is pure unreviewed machine translation; the ring empties as human translators review lines (zh_cn, the most-reviewed locale, shows only a thin ~8% sliver). The arc runs clockwise from 12 o'clock in the same ~35%-alpha blue as the AI label, over a fainter full-circle track so small fractions still read as a gauge.

The numbers come from three generated fields in each bundled credit file (total_keys / ai_authored / ai_unreviewed), stamped by scripts/localization/stamp-provenance.py from the repo-side per-line provenance sidecars and hard-validated in CI by check-provenance.py — never hand-edit them. A credit file without valid counts (e.g. a third-party pack) simply renders no ring; when several credits carry counts for one locale, the set with the greatest total_keys wins.

Who gets credited for a line

A player's name reaches the in-game credits through the provenance sidecars: scripts/localization/import-approved-translations.py pulls approved translations back from the relay and stamps each key's author and reviewer, and a translator is credited for a locale if they are either one of those on a key.

Two people can both have an approved translation of the same line. Only one text can ship, and it is the one the relay operator picked — failing that, the newest approval, which is the text the relay is already serving every player in that language. The other translator is not discarded: they take that key's reviewer slot, so both names stay in the credits. A third translator of one line has nowhere left to go and is named in the import's output instead (since PR #1236; before it, the runner-up's stamp was silently overwritten and a translator whose every line was contested vanished from this screen entirely).

Renaming yourself (v0.825.0)

The name you are credited under is whatever you typed in the submit screen's "Name to credit you by" box, and it used to be permanent. Since v0.825.0 the Credits page shows an Edit button beside every name you have submitted translations under (it knows which are yours from your own submission history, so it needs the internet connection turned on in Dungeon Train Options). Save a new name and:

  • the relay renames every one of your past translations at once, so other players see the new name on their next launch;
  • your own client shows it immediately, and your next submission defaults to it;
  • the repo catches up on the next translation import — scripts/localization/apply-translator-renames.py reads the relay's rename log and renames you in localization/authors.json and every provenance sidecar before the approved text is imported, and the regenerated credits follow in that PR.

Two refusals, both deliberate: a name another translator already submits under ("Another translator already goes by that name" — renaming onto it would merge two people's credit into one line), and a name none of your translations carry any more (the page was stale — reopen it). The import side makes the same check against authors.json, so a rename onto a name the relay has never seen is held for a person to resolve rather than applied. Translators who delivered a zip rather than using the in-game editor have no relay rows, so no Edit button — they are renamed by hand.

Technical Notes

  • games.brennan.dungeontrain.client.localization package: LocalizationCredit (record), LocalizationCreditRegistry (in-memory store + Gson parsing, log-and-skip on a malformed file), LocalizationCreditsClientLoaders (registers the reload listener on RegisterClientReloadListenersEvent), LocalizationCreditLabel (the wrap-aware text-link widget).
  • Schema + authoring guide for pack authors: assets/dungeontrain/localization_credits/CLAUDE.md in the repo.
  • If two active resource packs ship a credit file with the same filename, the higher-priority pack's entry wins for that filename — identical semantics to any other resource-pack override.

Related

⚠️ **GitHub.com Fallback** ⚠️