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
Folded components bake translations (__()) in the locale of the first compiling request #221
Components compiled with @blaze(fold: true) evaluate translation helpers (__(), trans(), @lang) at compile time, so the translated string is baked into the compiled view in the locale of whichever request compiled it first. The compiled-view cache is shared across locales, so every later request gets that same language until views are cleared.
Reproduction (Blaze v1.0.19, Flux)
Multilingual app (uk and ru locales), compiled views cleared.
First request renders a page containing <flux:sidebar.toggle /> with app()->getLocale() === 'uk'.
Next request renders the same view with locale ru.
Expected: the toggle's aria-label is the ru translation of Toggle sidebar. Actual: it is still the uk string — and it stays that way for all users and locales until view:clear / the next deploy. Reversing the order bakes ru into uk pages.
We found 23 Flux stubs affected this way (directly or through folded children), including input, select (selected, No results found), input/file, pillbox, pagination, date-picker.
Cause
Folder::checkProblematicPatterns() (src/Folder/Folder.php) rejects folding for request-dependent code (session(, auth(), request(), $errors, @csrf, old(, …), but not for translation helpers, which depend on the request locale in the same way.
Suggestion
Treat __(, trans(, trans_choice(, @lang as problematic patterns (refuse to fold / throw InvalidBlazeFoldUsageException), or include the current locale in the fold cache key. Our current workaround is overriding the affected Flux stubs without fold: true.
Two data points from today, with Blaze v1.0.21 and Flux v2.22.0:
Still reproducible on v1.0.21. Rendering <flux:sidebar.toggle /> under nl and then under en in the same process gives the Dutch aria-label both times. In the other order it stays English. A plain {{ __('Toggle sidebar') }} in the same template follows the locale, and with BLAZE_ENABLED=false both do.
51 folded Flux views now call __(), up from the 23 counted above. Among them are modal, pagination, select/*, input/clearable, input/copyable, input/viewable, command/*, the date and time pickers, editor/* and sidebar/toggle, sidebar/collapse and sidebar/search.
I've opened #245 with a possible fix: it leaves a component unfolded when it translates while being folded.
Activity
ganyicz commentedon Oct 23, 2026
Thanks for reporting @mr-riabov
This will be fixed in the next release
ganyicz commentedon Oct 25, 2026
Reopening this as I found issues with the approach in the original PR, will revisit later.
rspahni commentedon Oct 29, 2026
@ganyicz - for the record, I reported the same issue on the Flux repo (livewire/flux#2851). If pursued here, can be closed there, or vice versa.
iruoy commentedon Nov 19, 2026
Two data points from today, with Blaze v1.0.21 and Flux v2.22.0:
<flux:sidebar.toggle />undernland then underenin the same process gives the Dutcharia-labelboth times. In the other order it stays English. A plain{{ __('Toggle sidebar') }}in the same template follows the locale, and withBLAZE_ENABLED=falseboth do.__(), up from the 23 counted above. Among them aremodal,pagination,select/*,input/clearable,input/copyable,input/viewable,command/*, the date and time pickers,editor/*andsidebar/toggle,sidebar/collapseandsidebar/search.I've opened #245 with a possible fix: it leaves a component unfolded when it translates while being folded.