Repository navigation
feat(i18n): add fr_CA translation and apply string context rule #minor - #58
Open
Revenantal wants to merge 12 commits into
Open
Revenantal wants to merge 12 commits into
Revenantal wants to merge 12 commits into
Conversation
- Packaging & Labeling -> Packaging & Labelling (Business Services label) - gray out -> grey out (org selector ACF instructions) - Account Center -> Account Centre (getAccName center branch)
- Add a pre-commit hook that regenerates languages/<text-domain>.pot from the staged files. It uses `wp` on PATH, or downloads a pinned, checksum-verified WP-CLI into the user cache. It never blocks a commit. - Make `composer setup-hooks` install the pre-commit hook. - 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.
getAccName() returned "Account Centre" for sites set to account-center, so the Centre/Center localization option had no effect.
… the pot - Replace the site-wide acf/settings/l10n_textdomain filter with an acf/prepare_field filter that translates only fields from includes/acf-json, so other plugins' and the theme's 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 with a context and a field-group comment. - Use the Canadian spelling "eBook Fulfilment" for the VitalSource action label; the stored value stays unchanged for MDP matching.
- Add translators comments to ambiguous strings and abbreviations (Left/Right, Clear, Download, Member, Other, N/A, FY, Soc., PAC, CEO...). Existing msgids are unchanged so current site translations keep working. - Move inline translators comments onto their own lines so make-pot stops attaching them to the next string (Remove, Edit Permissions, File must be a valid image). - Replace "the contact"/"the member"/"this member" fragments with full sentences for the no-name success messages, using _x() contexts. - Keep spaces out of the "(Start %s)" strings and give them a context. - Wrap the cascade seat-limit error in __(). - Add both account-centre and account-center block search keywords.
- Add wicket-acc-fr_CA.po covering all 1,040 strings in wicket-acc.pot, including 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.
- 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. Same shape as the base plugin PR and it holds up. What I verified:
msgfmt --checkpasses on the fr_CA catalog (1041 messages), the shipped.momatches, and the.l10n.phpis valid with matching plural rules. CI pot check is green, so the pot is in sync with source.- The domain-load fix is real: the old
dirname(plugin_basename(__FILE__)) . '/languages/'pointed atsrc/languages/, which never existed, so bundled translations never loaded. The new root-relative load on init priority 1, admin included, fixes it. - The ACF pipeline is guarded:
translate_acf_field()only touches field keys collected fromincludes/acf-json, and.ci/acf-i18n-strings.phpmirrors the runtime context map and the 1-to-3-word rule exactly. - WP_Error codes are unchanged across services, the touchpoint
display_typebranches only exist in blocks whose signature has the parameter, and the added escaping (wp_die, email bodies, template-not-found) is a real hardening. Good riddance to the hardcodednjbia.orgin the welcome email, now the site's own host.
Two nits, fine to fix later:
- Same slug, two source strings:
getAccPageTitles()uses "Bulk Upload Members" whileRequiredPagesNotice::pageTitles()uses "Organization Members Bulk Upload". Different admin screens can show different titles for the same page. Please pick one. - The 1-to-3-word rule and the setting-to-context map now live in two places (Blocks.php runtime,
.ci/acf-i18n-strings.phpgenerator). A future drift makes ACF strings silently untranslatable. Please consider generating the map from one source, or a test that diffs the two.
Two behavior notes so nobody is surprised: handleWooCommerceMyAccountPage() now uses the translated title, so on a French site the safeguard pass renames the actual WooCommerce My Account page to French (slug stays my-account, URLs are safe). And the ui:i1e8n to ui:i18n fix in Schema means enumNames localization now actually applies where it silently never did.
Thanks Adrian, solid work across 171 files.
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-theme#19, industrialdev/wicket-wp-financial-fields#10
What
.po,.mo,.l10n.php) for all 1,040 strings inwicket-acc.pot, including plurals.account-center.Why
Many Account Centre strings were missing context, were split into fragments, or were translated through a site-wide ACF filter that affected other plugins. Wicket now ships fr_CA, following the Atlas translations convention (
conv.stack.translations).How
Contexts and strings
__().ACF
acf/prepare_fieldfilter replaces the site-wideacf/settings/l10n_textdomainfilter. It translates only fields fromincludes/acf-json.composer i18n:acf(.ci/acf-i18n-strings.php) generateslanguages/acf-strings.php, so make-pot extracts ACF strings with a context.Fixes
getAccName()now returns "Account Center" when the site uses the center setting..pothook runs faster and supports package excludes.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 plugin. Site-level translations (Loco,
wp-content/languages) still take precedence.