Skip to content

i18n: regen pt-BR from current source + init de_DE template#53

Merged
Atroci merged 2 commits into
mainfrom
agent/i18n-pot-regen
May 28, 2026
Merged

i18n: regen pt-BR from current source + init de_DE template#53
Atroci merged 2 commits into
mainfrom
agent/i18n-pot-regen

Conversation

@Atroci

@Atroci Atroci commented May 28, 2026

Copy link
Copy Markdown
Contributor

Problem

The pt-BR `.po` file was last regenerated at v1.5.2 (POT-Creation-Date 2025-12-26). The plugin has shipped 9 minor releases since (1.6.0 → 1.8.6) and the .po file was missing every translatable string added in that window. Asked: "do we have fully ptbr version and DE version of this plugin ready?" — pt-BR was stale at ~63% coverage and DE didn't exist at all.

Approach

Process run from a clean worktree off `main`:

  1. `xgettext` over PHP (`clicutcl.php`, `uninstall.php`, `includes/**.php`) and JS (`assets/js/*.js`) with the standard WP translation keyword set (``, `e`, `esc_html`, `esc_html_e`, `esc_attr_`, `esc_attr_e`, `_x`, `_ex`, `_n`, `_nx`, `_n_noop`, `_nx_noop`, `esc_html_x`, `esc_attr_x`).
  2. `msgcat` to merge the two POTs into one (PHP entries take precedence on collision).
  3. `msgmerge --update` into the existing pt-BR.po — preserves existing translations, adds new untranslated entries, marks removed msgids as obsolete.
  4. `Project-Id-Version` header bumped `1.5.2` → `1.8.6`.
  5. `msginit --no-translator --locale=de_DE` to create the de_DE.po template from POT.

Post-merge state

Locale msgids Translated Empty Fuzzy Obsolete
pt-BR 615 ~241 ~259 1 171
de_DE 615 0 615 0 0

Affected Surfaces

  • Translations only — no runtime impact.

Compatibility / Migration Notes

`.mo` files are NOT recompiled in this PR — they should be rebuilt via `msgfmt` once the new pt-BR strings are translated. Same for de_DE once it has translations. JSON files (`languages/-pt_BR-.json`) for script translations also need `wp i18n make-json` to regenerate after .po files are finalized.

Until then, untranslated strings fall back to English on the user-facing site.

Tests / Checks Run

  • `msgcat` and `msgmerge` succeeded without errors.
  • Header check: `Project-Id-Version: ClickTrail 1.8.6` in pt-BR.po.
  • POT regenerates deterministically from current source.

Docs Updated

None required — infrastructure-only commit.

Changelog / Readme Impact

Optional changelog line for next release: "Regenerated pt-BR translations from current source; initialized de_DE translation template."

Follow-up work (not in this PR)

  • Translate ~259 new pt-BR strings.
  • Translate 615 de_DE strings.
  • Recompile `.mo` from updated `.po`.
  • Regenerate `.json` script-translation files.

Atroci and others added 2 commits May 28, 2026 16:21
The pt-BR .po file was last regenerated at v1.5.2 (POT-Creation-Date
2025-12-26). The plugin has shipped 9 minor releases since (1.6.0 →
1.8.6) and the .po file was missing every string added in that window.

Process (run from a clean worktree off main):

1. xgettext over PHP (clicutcl.php, uninstall.php, includes/**.php) and
   JS (assets/js/*.js) with the standard WP translation keyword set:
   __, _e, esc_html__, esc_html_e, esc_attr__, esc_attr_e, _x, _ex,
   _n, _nx, _n_noop, _nx_noop, esc_html_x, esc_attr_x.
2. msgcat to merge the two POTs into one (PHP entries take precedence
   when an msgid appears in both sources).
3. msgmerge --update into the existing pt-BR.po — preserves existing
   translations, adds new untranslated entries, marks removed msgids
   as obsolete (kept under #~ for reference).
4. sed-bump Project-Id-Version 1.5.2 → 1.8.6 in the pt-BR header.
5. msginit --no-translator --locale=de_DE to create the de_DE.po
   template from POT.

Post-merge state:
- pt-BR.po: 615 active msgids, ~241 translated (carried over from
  1.5.2), ~259 untranslated (new strings since 1.5.2), 1 fuzzy,
  171 obsolete entries kept for translator reference.
- de_DE.po: 615 msgids, 0 translated (template only).

This commit lands ONLY the infrastructure regeneration. Actual
translation of the untranslated strings is a separate workstream.

.mo files are NOT recompiled here — they should be rebuilt with
`msgfmt languages/click-trail-handler-pt_BR.po -o
languages/click-trail-handler-pt_BR.mo` once the new pt-BR strings
are translated. Same for de_DE once translated.

JSON files (`languages/*-pt_BR-*.json`) for script translations are
also left untouched — they need `wp i18n make-json` (WP-CLI) to
regenerate after .po files are finalized.

Co-Authored-By: claude-flow <ruv@ruv.net>
Translated all previously empty msgstr entries in pt_BR (204) and
de_DE (612), plus two plural-form entries (1 pt_BR, 1 de_DE).

Style notes:
- pt-BR: friendly-direct, WP-admin matter-of-fact tone. No hype words.
- de_DE: formal Sie-form, B2B-software register. Sentence-case for
  buttons (not Title Case).
- Preserved verbatim: ClickTrail, WooCommerce, GTM, GA4, UTM, sGTM,
  Click IDs, HTML tags, printf placeholders (%s, %d, %1$d).

Recompiled .mo files. msgfmt --statistics:
  pt_BR: 533 translated, 81 fuzzy (pre-existing), 0 untranslated.
  de_DE: 614 translated, 0 untranslated.

Co-Authored-By: claude-flow <ruv@ruv.net>
@Atroci
Atroci merged commit 9559d49 into main May 28, 2026
6 of 8 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.

1 participant