Repository navigation
Translations as gettext PO files for all languages - #170
Merged
Merged
Conversation
Translations/PO holds the template (ambermoon.pot, the English texts) and one PO file per language (de, fr, cs, pl, es). msgctxt is the file of the text, msgid the English text; the comments give the kind of text, the usual length, the meaning of the placeholders and the German original. Translations/po.py writes the template (extract), creates PO files from the text folders (export), writes the text folders of the release from the PO files (import; existing files keep their BOM and line end), merges a PO file with a new template (update: changed texts become fuzzy), checks a translation (check: placeholders, line breaks, lengths, intro/extro glyphs) and checks that everything is up to date (verify). Importing the PO files gives the existing texts of German, French, Czech and Polish byte for byte. The Spanish texts now live only in es.po; the game texts in Disks/Bugfixing/Spanish keep their accents (the release creator removes them), only ¿ ¡ are removed. The Spanish intro/extro font gets the glyph ". The release workflow imports the PO files before it builds the releases, and the new workflow translations runs verify for pull requests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGvkG5Uoa8unp8Sx5tBxho
- quotes: 77 texts with a missing, doubled or extra quotation mark compared with the English text (French, Czech, Polish; 2 in the German original) - junk after a NUL byte at the end of 33 texts (\0 STOP., \0 \x1a, ...) - Czech: broken placeholder ~SEX2 (Messages/255), ~INK 17~ -> ~INK17~ in the remake outro, 3 remake strings without closing quote, a stray quote in a remake string (broke the C# syntax) - Polish: typo podšża -> podąża (intro), missing line break before ~INK 31~ - French: untranslated English sentences in 4 texts translated - Czech and Polish intro/extro fonts: glyph for " (used by the extro, was missing) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QGvkG5Uoa8unp8Sx5tBxho
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All translations of Ambermoon become gettext PO files, the same approach as Amberstar.net. Translators can use Poedit, Weblate, Crowdin and similar tools instead of thousands of text files. When an English text changes, the translation is marked fuzzy automatically. This PR also fixes obvious errors in the existing translations.
Translations/POambermoon.potde.po,fr.po,cs.po,pl.po,es.pomsgctxtis the file of the text (AllTexts/NPC_texts.amb/001/001,IntroTexts/…,ExtroTexts/…) or the section and line of the remake texts (Remake/Tutorial texts/003).msgidis the English text,msgstrthe translation.^,$,~LEAD~,{0}) stays as it is.msgstr: means not translated. No file is written for it, and the game keeps the German base text.Translations/po.py(Python 3, no dependencies)extract: writes the template.export <lang>: creates a PO file from the text folders. This was used once for the migration.import <lang>|--all: writesDisks/Bugfixing/<Language>/…from the PO file. Existing files keep their BOM and line end.update <lang>|--all: merges with a new template. Changed English texts become fuzzy, and removed ones become obsolete.check <lang>|--all: reports changed placeholders and line breaks, unusual lengths, missing intro/extro glyphs and fuzzy entries, and shows statistics.verify: checks that the template and all text folders are up to date with the PO files.Migration
es.po.Translations/Spanish/{AllTexts,IntroTexts,ExtroTexts,RemakeTranslatableTexts.txt}and the old helper scripts are removed.Disks/Bugfixing/Spanishis written byimport es. The game texts keep their accents (the release creator removes them with-u); only ¿ ¡ are removed.Fixed in the existing translations (second commit)
"compared with the English text. Typical cases:^where the speech continues in the next paragraph;""or"."at the end;^on signs.2Map_texts 288/005,3Map_texts 344/002). Each automatic fix changes exactly one character; 7 cases were fixed by hand.\0 STOP.,\0 \x1a,\0 4, and\0\0\0\0\x05in a French automap label). Affected: Czech, German, French.~SEX2 popel→~SEX2~ popel(Messages/255);~INK 17~→~INK17~in the remake outro, as in the English;RemakeTranslatableTexts.txtwithout closing quote, and a stray quote inside a tutorial string. These broke the C# syntax.podšża→podążain the intro (šhas no glyph in the font);^that had become."before~INK 31~(NPC_texts 065/001).2Map_texts 293/004, 416/016, 423/001, 437/002). They are translated in the style of the French translation.", made of two apostrophes. The extro uses"in 8 Czech and 6 Polish lines, which were shown without quotes before.Not changed, because they are a matter of translation and not obvious errors:
~SEX1~/~SEX2~used differently because of grammar;checkstill lists them as warnings.CI
release.yml: runspo.py import --allbefore the release creator.translations.yml: runspo.py verifyfor pull requests and pushes that touchTranslations/**orDisks/Bugfixing/**, and printscheck --allas information.Tests
python3 Translations/po.py verify: template and all 5 languages up to date.python3 Translations/po.py check --all: 0 errors in all languages; only warnings remain.polib.🤖 Generated with Claude Code
https://claude.ai/code/session_01QGvkG5Uoa8unp8Sx5tBxho