Use plugin-specific i18n domain for translations - #24
Merged
Merged
Conversation
Convert __() calls in src/ and templates/ to __d('feedback', ...) so
user-facing strings live in their own translation domain instead of leaking
into the host app's default domain. The 41 pre-existing __d('feedback', ...)
calls already pointed at the right domain — the rest of the plugin now
matches.
Also refresh resources/locales/feedback.pot via cake i18n extract. The POT
was ~8 years stale (POT-Creation-Date 2018-01-16) and missed all the strings
added in the admin backend since then. Switch to --no-location while
regenerating so future regenerations stay tidy.
Existing language files (de/, es/, nl/, sv/) are intentionally left alone —
translators can run msgmerge against the refreshed POT to pull in the new
msgids without losing existing translations.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #24 +/- ##
=========================================
Coverage 77.72% 77.72%
Complexity 156 156
=========================================
Files 11 11
Lines 431 431
=========================================
Hits 335 335
Misses 96 96 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
__()calls insrc/andtemplates/to__d('feedback', ...). The 41 pre-existing__d('feedback', ...)calls already pointed at the right domain — the rest of the plugin now matches.resources/locales/feedback.potviabin/cake i18n extract. The POT was ~8 years stale (POT-Creation-Date 2018-01-16) and missed every string added in the admin backend since then. Went from ~25 to 56 unique msgids; also dropped per-string location comments by switching to--no-locationso future regenerations stay tidy.The existing
de/,es/,nl/,sv/language packs are intentionally left untouched — translators can runmsgmergeagainst the refreshed POT to pull in the new msgids without losing the existing translations.Why
Plugin strings were landing in the host app's
defaultdomain, plus the POT was so out of date that the admin UI was basically untranslatable even where the existing language packs already had relevant translations from older code paths.Verification (local)