Skip to content

Use plugin-specific i18n domain for translations#166

Merged
dereuromark merged 1 commit into
masterfrom
i18n-domain
May 4, 2026
Merged

Use plugin-specific i18n domain for translations#166
dereuromark merged 1 commit into
masterfrom
i18n-domain

Conversation

@dereuromark

Copy link
Copy Markdown
Owner

Summary

  • Convert the 2 __() calls in the unauthorized-handler middleware to __d('tinyauth', ...) so plugin strings live in their own domain.
  • Add resources/locales/tinyauth.pot (1 unique msgid — the unauthorized-access fallback message) generated via bin/cake i18n extract so language packs can be derived from a stable POT.

Why

Plugin strings were landing in the host app's default domain. Anyone translating the host app would have ended up translating this plugin's UI under their own domain — and shipping a translated language pack with the plugin was effectively impossible.

Verification (local)

  • phpunit: 111 / 111 (2 pre-existing deprecations, 11 pre-existing notices — unrelated to this change)
  • phpstan: no errors
  • phpcs: clean

Convert __() calls in the unauthorized-handler middleware to __d('tinyauth', ...)
so user-facing strings live in their own translation domain instead of leaking
into the host app's default domain.

Add resources/locales/tinyauth.pot generated via cake i18n extract so
translators have a stable POT to base language files on.
@codecov-commenter

codecov-commenter commented May 4, 2026

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 67.59%. Comparing base (919f2d9) to head (79650da).

Files with missing lines Patch % Lines
...authorizedHandler/ForbiddenCakeRedirectHandler.php 0.00% 1 Missing ⚠️
...e/UnauthorizedHandler/ForbiddenRedirectHandler.php 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff            @@
##             master     #166   +/-   ##
=========================================
  Coverage     67.59%   67.59%           
  Complexity      627      627           
=========================================
  Files            29       29           
  Lines          1614     1614           
=========================================
  Hits           1091     1091           
  Misses          523      523           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@dereuromark dereuromark merged commit 4ae2d03 into master May 4, 2026
16 checks passed
@dereuromark dereuromark deleted the i18n-domain branch May 4, 2026 00:54
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.

2 participants