docs(translations): document the command-line catalog workflow - #630
Merged
Conversation
The README only described the POEdit path, which suits an outside contributor sending in one language but not a maintainer refreshing all of them. It also never said where messages.pot comes from, that the .mo is what actually gets loaded, or that a locale has to be listed in locales.json before it is served at all - so a new .po could be added correctly and still never render. Adds the GNU gettext equivalent, plus the things that are easy to get wrong: en.po is untranslated deliberately, --no-fuzzy-matching keeps a guessed translation from slipping through review, the reordering makes diffs large without changing content, and each catalog has its own register to match. Running the documented commands also settled the catalogs, which had been committed with .po headers older than the template and with entries not yet in template order. Content is unchanged - no translation added, lost or altered, and the .mo files are byte-identical - and a second run is now a no-op, so the next person gets a clean diff.
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.
Follow-up to #629.
translations/README.mdonly described the POEdit path. That suits an outside contributor sending in one language, but not a maintainer refreshing all of them, and it left three things unsaid:messages.potcomes from (npm run gettextwas not mentioned at all).mois what EmailEngine actually loads, so a.poedit does nothing until it is recompiled and committedlocales.jsonbefore it is served, so a correctly translated new.pocould still never renderAdds the GNU gettext equivalent of the whole loop, plus the parts that are easy to get wrong:
en.pois untranslated on purpose (source language, empty msgstr falls back to the msgid), somsgfmtreporting it as almost entirely untranslated is expected rather than a bug to fix--no-fuzzy-matchingis deliberate: it stops gettext guessing a translation for a new string from a similar old one and marking it fuzzy, which is easy to wave through in reviewmsgmergereorders entries to match the template, so diffs are large without content changing - comparemsgidlines, not line countsCatalogs settled
Running the documented commands turned out to produce a diff, which would have made the README wrong on its first use. The catalogs had been committed with
.poheaders older than the template and with entries not yet in template order. This commit settles them.Content is unchanged, verified rather than assumed:
.mofile is part of this commit, so nothing EmailEngine loads at runtime differsGettext coverage test passing.