You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Blade rewriter misses short texts: no Commons namespace alias in its key map #3
Laravel 13 + Inertia 2 + Vue 3.5 project; piloting the pipeline on Blade views
(resources/views/**).
What happens
extract routes short texts (≤ 2 words, ≤ 24 chars, no sentence punctuation) into a Commons namespace. The Vue/JS replacement engine (src/i18n/replace-i18n.js, buildKeyMap()) adds a Commons|kind|text alias (plus a text-kind fallback), so
those keys match from any file.
The Blade rewriter (src/i18n/rewrite-i18n-blade.js, buildKeyMapFromTranslations())
registers only the literal tree path — no Commons alias, no kind fallback. Any
Blade string short enough to land in Commons therefore never matches its own
file-derived namespace.
extract writes the key as Commons.text.pallet_report (correct per the short-text rule);
the rewriter looks up Reports.Pallet|text|Pallet Report (namespace derived from the
file path) → miss → file unchanged (0 replacements), while longer texts in the same
run (e.g. an error-page paragraph) are replaced fine.
Expected
The Blade key map mirrors the Vue/JS behavior: Commons alias + text-kind fallback.
Environment
@ai-localizer/cli / @ai-localizer/core v0.1.1, Windows 11, Node v24.20.0.
Happy to contribute a PR (Apache-2.0).
Reported by @ViniMayerFontana via the Relief Inventory pt-BR localization effort (Apache-2.0, happy to PR).
Activity
xwiz commentedon Nov 14, 2026
Thanks for tracking this down. #13 adds the Commons fallback to Blade rewriting, so short strings can be matched from their view namespace.
The fix is in the PR and has regression coverage. It’s awaiting merge, so it isn’t in a release yet.