feat: allow only/except overrides on @translations and Update deprecated GitHub Actions to fix failing CI - #53
Merged
Conversation
Support per-layout namespace filtering via an optional options array so apps can ship different translation subsets per root layout without changing global config. Closes GENL#27. Co-authored-by: Cursor <cursoragent@cursor.com>
GENL
reviewed
Jul 24, 2026
GENL
reviewed
Jul 24, 2026
GENL
reviewed
Jul 24, 2026
Comment on lines
+175
to
+176
| $namespace = str_replace('\\', '/', trim((string) $namespace, '/\\')); | ||
| $namespace = Str::beforeLast($namespace, '.'); |
Owner
There was a problem hiding this comment.
These two are duplicated in namespaceToDotPath. But it's an ok tradeoff for now.
GENL
reviewed
Jul 24, 2026
Comment on lines
+182
to
+195
| // Full path when the first segment is a locale key (e.g. "en/auth"). | ||
| // Otherwise treat as a short name and expand under each loaded locale. | ||
| $firstSegment = Str::before($namespace, '/'); | ||
|
|
||
| if (isset($translations[$firstSegment])) { | ||
| $resolved[] = $namespace; | ||
| continue; | ||
| } | ||
|
|
||
| foreach ($localeKeys as $locale) { | ||
| if (isset($translations[$locale])) { | ||
| $resolved[] = $locale . '/' . $namespace; | ||
| } | ||
| } |
GENL
reviewed
Jul 24, 2026
Owner
|
Thanks for this awesome work @vpuentem. I left a few quick comments. After that the PR should be ready to merge. |
Co-authored-by: GENL <36866702+GENL@users.noreply.github.com>
Co-authored-by: GENL <36866702+GENL@users.noreply.github.com>
Co-authored-by: GENL <36866702+GENL@users.noreply.github.com>
Contributor
Author
actions/cache@v1 was disabled by GitHub, which broke the Tests workflow. Bumped it to v4, and updated actions/checkout and actions/setup-node to their latest major versions too since the old ones are on the same deprecation track.
…ravel releases in CI
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
Implements dynamic namespace filtering for #27 by allowing optional
only/exceptoverrides on the@translationsdirective, so different Blade layouts can load different translation subsets without changing global config.@translations/@translations($locale)usage is unchangeden/authstill workTest plan
vendor/bin/phpunit(13 tests)only/except