Skip to content

Localization json - #102

Open
Jeffiest wants to merge 2 commits into
TheMoonPeople:masterfrom
Jeffiest:localization-json
Open

Jeffiest wants to merge 2 commits into
TheMoonPeople:masterfrom
Jeffiest:localization-json

Conversation

@Jeffiest

@Jeffiest Jeffiest commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Jeffie and others added 2 commits October 7, 2026 04:06
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>

This branch has not been deployed

No deployments
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.

1 participant