Repository navigation
feat(i18n): add fr_CA translation and apply string context rule #minor - #19
Open
Revenantal wants to merge 12 commits into
Open
Revenantal wants to merge 12 commits into
Revenantal wants to merge 12 commits into
Conversation
The theme's strings moved from the base plugin's 'wicket' domain to the new 'wicket-theme' domain. Legacy sites already translated these strings under 'wicket' in Loco (.mo files) or WPML (database). After the move, those translations no longer match, so the text would show in English. The shim filters the 'wicket-theme' gettext calls (plain, context, and plural). When a string has no 'wicket-theme' translation, it looks it up under 'wicket' again. 'wicket-theme' stays the default and wins when it has a translation. New sites translate under 'wicket-theme' only. Remove the shim when legacy sites move their translations to 'wicket-theme'.
- Title color -> Title colour (Featured Posts) - Blur Color -> Blur Colour (Drop Shadows instructions) - Center -> Centre (Banner text alignment label; value stays "center")
- Add .ci/hooks/update-pot, which regenerates languages/<text-domain>.pot from the staged files. `composer setup-hooks` installs it as the pre-commit hook. It uses `wp` on PATH, or downloads a pinned, checksum-verified WP-CLI into the user cache. It never blocks a commit. - Add a PR check that fails when the committed .pot is out of date.
- Read extra comma-separated exclude paths from .ci/pot-exclude. - Leave excluded paths out of the staged snapshot, so large folders are not copied. - Exclude font-awesome/ from the theme's .pot scan.
…t strings - Replace the site-wide acf/settings/l10n_textdomain filter with an acf/prepare_field filter that translates only fields from the theme's acf-json, so plugin and child-theme ACF groups keep their own domains. - Add .ci/acf-i18n-strings.php (composer i18n:acf) to generate languages/acf-strings.php, which lets make-pot extract ACF field strings. - Give strings added on this branch an _x()/_nx() context and use proper plurals for search and listing result counts. - Merge "Published:", "Results for:", "Displaying:" and "Search Results for:" with their values into whole strings. The publish date now uses the site date format and the search term in the breadcrumb is escaped. - Add translator comments to ambiguous strings that existed on main; their msgids are unchanged so the legacy 'wicket' domain fallback keeps working. - Use "Log in to Purchase" (verb) for the product button.
- Add languages/fr_CA.po covering all 788 strings in wicket-theme.pot, including ACF field strings and plurals, with Canadian French terminology and typography. - Add the compiled .mo and WordPress 6.5+ .l10n.php files. Site-level translations (Loco, wp-content/languages) still take precedence.
esc_html_ex() is not a WordPress function; the two calls added in 88b603b would fatal on the fallback index template and the pagination demo.
- Give every string of 1 to 3 words a gettext context and drop contexts from full sentences, following the Atlas translations convention. - Contexts name the kind of string (label, button label, status, message, accessibility label, ...), not where it shows, so identical strings with the same meaning share one translation entry. Specific contexts are kept only where the same text has a different meaning (role name, relationship type). - ACF field strings follow the same rule in the runtime translator and the languages/acf-strings.php generator. Changes msgids' contexts, so existing site translations of these keys stop matching; accepted because client coverage is under 1% and Wicket ships fr_CA.
This was referenced Oct 2, 2026
Revenantal
requested review from
EstebanForge,
alex91ckua,
gary-wicket and
rferguson10
October 2, 2026 19:20
Revenantal
marked this pull request as ready for review
October 2, 2026 19:21
EstebanForge
approved these changes
Oct 2, 2026
EstebanForge
left a comment
Contributor
There was a problem hiding this comment.
Approved. Third PR, same bar, and it holds. What I verified:
msgfmt --checkpasses on the fr_CA catalog (771 messages), the shipped.momatches,.l10n.phpandacf-strings.php(516 ACF strings) are valid, and the CI pot check is green.style.cssonly gains the Text Domain and Domain Path headers. No manual version bump, the release bot stays in charge.load_theme_textdomainruns insidewicket_setup()onafter_setup_theme, and thefr_CA.monaming matches the theme convention. The legacywicketfallback filters follow the same four-variant pattern as the base plugin, registered before init. Cross-package behavior is consistent.- The ACF translator is key-guarded to this theme's own
acf-json, and the generator is the same one as account-centre with the theme paths swapped. post-types.phpfixes the old untranslatable patterns:_x($singular)variable msgids and'Add New ' . $singularfragments are now proper%stemplates. Raw slugs stay untranslated on purpose, with a comment saying why. Good.- The dead
hide-wp-admin-notificationstextdomain loader is gone (its path never existed), and those strings moved towicket-theme.
Two notes, nothing to fix:
- The listing sort labels came from a third dead domain,
industrial, notwicket. The fallback only coverswicket, so any client that translated those four strings through anindustrialtextdomain loses them. Same accepted risk class as the other PRs, just a different corpse. - One ACF instruction string ("Use this to add custom fonts from CDN...") contains a literal
\r\nin the source, and the fr translation mirrors it, somsgfmtemits a warning. Harmless, but cleaning the source string someday would silence it.
Thanks Adrian, the set is consistent across the three packages.
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.
Context
Wicket: none
Related PRs: industrialdev/wicket-wp-base-plugin#63, industrialdev/wicket-wp-account-centre#58, industrialdev/wicket-wp-financial-fields#10
What
languages/wicket-theme.potand a Canadian French (fr_CA) translation (.po,.mo,.l10n.php) for all 788 strings, including ACF field strings and plurals.Why
Theme strings were missing context, some were glued together from fragments, and ACF translation used a site-wide filter that affected plugin and child-theme field groups. Wicket now ships fr_CA, following the Atlas translations convention (
conv.stack.translations).How
Contexts and strings
wicketdomain fallback still works.ACF
acf/prepare_fieldfilter replaces the site-wideacf/settings/l10n_textdomainfilter. It translates only fields from the theme'sacf-json.composer i18n:acfgenerateslanguages/acf-strings.phpfor make-pot.Fixes and tooling
esc_html_ex()withecho esc_html_x(). It would have fataled on the fallback index template and the pagination demo..pothook runs faster, supports.ci/pot-exclude, and excludesfont-awesome/.Impact on existing translations
Re-contexted strings no longer match existing site translations. We accepted this because client translation coverage is under 1% and fr_CA now ships with the theme. Site-level translations (Loco,
wp-content/languages) still take precedence.