Skip to content

Localization json - #112

Merged
Adubbz merged 20 commits into
TheMoonPeople:masterfrom
Jeffiest:localization-json
Oct 8, 2026
Merged

Adubbz merged 20 commits into
TheMoonPeople:masterfrom
Jeffiest:localization-json

Conversation

@Jeffiest

@Jeffiest Jeffiest commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Updated: rebased on current master (d16ee57) and reworked the text shadow.

Rebase

  • The Options screen moved to port/src/options/ in feat: made the settings menu modular, fixed buttons size and added accessibility #100, so the localization of its text now lives there (rows.cpp, screen.cpp). The old menu_option.cpp changes are dropped.
  • New settings since the first version are covered (Accessibility page, soundtrack, surround, vertical return, page help texts). The shipped fr/de/es/it files have all the keys, and the "Reset page" wording is updated.
  • Tests: 230/230 pass.

Text shadow

  • The TrueType font's shadow was reading as an outline all round. It now falls down and to the right and fades softly, closer to the bitmap font.
  • New Display setting, "Text Shadow": Soft (default) or Deep. It's saved as video.text_shadow in config.json ("soft" or "deep").
  • The Soft shadow is a blurred, fairly transparent spread. Deep is a heavier version of the same cast.

Font

  • Every language uses the same font, tools/font/DarkCloudCompendium.ttf, loaded as lang/font.ttf. It covers all characters in the shipped translations.

Jeffie and others added 20 commits October 7, 2026 06:53
The fragment shaders' discard compiles to OpDemoteToHelperInvocation,
which requires the Vulkan 1.3 feature shaderDemoteToHelperInvocation.
The device did not enable it, so the validation layer reported it and the
graphics tests that count validation messages (TexDecode, GfxMisc) failed.
It is a core 1.3 feature, which the renderer already requires.

The test fixture also set the deprecated VK_LAYER_ENABLES, which the layer
reports as a message of its own; use VK_LAYER_VALIDATE_SYNC instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…tion

Game text can come from JSON files, with the disc's own message files as the
fallback, and message text can be drawn from a TrueType font so it is sharp at
any window size. Nothing from the disc is added to the repository.

- The files are laid out as Minecraft's language files are: one flat JSON file
  per language (en_gb.json, fr_fr.json...), each a "dotted.key": "text" object
  with the same keys in every language. A key is the message file's key (its
  path with the language and the .mes taken out, slashes made dots) and the
  message id: "dun.script.d01.d01.12".
- localize.{hpp,cpp} reads <exe>/lang and <save>/lang and lays the text over a
  message file as the game loads it (LoadFile2, LoadFileBG and the pack lookup
  GetPackFile). A missing message, file, bad JSON or a text that does not fit
  keeps the disc's text and says so once on stderr. patches/*.json make small
  edits to the disc's text (replace pairs, or whole text, guarded by a hash).
- darkcloud --export-text DIR, run once automatically for a save folder with
  no export, writes one file per language from the user's own data (855
  message files on the PAL disc, each reading back to the disc's codes), and
  the hashes patches check. The export is gitignored.
- The Options screen's own words are looked up by key too
  (options.<setting>.label, .help, .choice.<n>, options.page.<name>), with the
  English in the code as the fallback; port/lang/ ships French, German,
  Italian and Spanish for them, copied beside the executable by the build.
- lang/font.ttf draws message text with stb_truetype at the screen's
  resolution, in the game's own cells; letters the font lacks (accents,
  cedilla, inverted marks, oe) are built from the font's own glyphs.
- A Language row on the Game page and game.language in config.json skip the
  start-up language screen; changing it reloads the town or title once Options
  closes so images, menus and messages all change together.
- scripts/port/compare_text.py compares the languages message by message.
- docs/LOCALIZATION.md describes the formats and limits.

Japanese is not decoded: its text is glyph indices into the game's own font,
so ja_jp.json keeps them as {N} codes, which still round-trip.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The outline and drop shadow were drawn at 60% of the bitmaps' offsets and faintly, so they vanished
under a thin glyph. They now sit at the full offsets and the outline is laid down nine times, which
reads as dark as the bitmaps' text.
…text; refresh the truncation report's line numbers
…nt's icons and the textures' painted buttons

Settings input.glyphs (new/original) and input.glyph_device (auto/ps4/ps5/xbox/switch/keyboard) with two Options rows (translated in fr/de/es/it), the symbols drawn with a cast shadow like the font's, stb_image as a pinned download / Flatpak source, tests, docs/GLYPHS.md.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… box

The build copies tools/font/DarkCloudCompendium.ttf, which the repository already
holds, to lang/font.ttf beside the executable, so message text is drawn from it as
built (Dayuppy confirmed on 2026-10-06 that the community font may be used here;
credited in CREDITS and tools/font/README.md). Its accented letters, cedilla,
inverted marks and oe are blank in the file and are built from its own glyphs, which
covers every language the game has.

--font FILE names another font, a font in the save folder's lang/ wins over the
bundled one, and a missing font is said once instead of silently falling back to the
bitmaps. The language JSON is written on the first start with the game data in place;
docs/LOCALIZATION.md and the README now start with that quick start. The font tests
run on the repository's own font, so they no longer skip.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Doxygen reads only README.md and docs/PC.md, so a markdown link to
docs/LOCALIZATION.md cannot resolve and its warning fails the documentation
build. The rest of the README and PC.md name other docs in backticks; do the same.
build_glyphs.py --ps5-pack rebuilds only the PS5 atlas and its glyphs.json entry from a flat folder of 64 px buttons.
Text Shadow and a new Symbol Shadow are percents in steps of 5: 0 casts none, 50 is the
soft shadow (the letters' default), 100 the deep one. The button symbols default to 25, a
lighter shadow, since a solid shape stacks it where a thin stroke does not. The old soft and
deep config values still read as 50 and 100.
@Adubbz
Adubbz merged commit 20f85d1 into TheMoonPeople:master Oct 8, 2026
6 checks passed
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.

4 participants