File tree Expand file tree Collapse file tree
cmp/compiler/src/react/shared Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ import {
2020 persistLocale ,
2121} from "@lingo.dev/compiler/locale/client" ;
2222
23+ const noop = ( ) => { } ;
24+
2325/**
2426 * Translation context type
2527 */
@@ -239,8 +241,12 @@ function TranslationProvider__Prod({
239241 } , [ ] ) ; // Only run on mount
240242
241243 useEffect ( ( ) => {
242- setTranslations ( initialTranslations ) ;
243- } , [ initialTranslations ] ) ;
244+ // TODO (AleksandrSl 08/12/2025): More elegant solution required.
245+ // This is used to update the client part when next app changes locale
246+ if ( router ) {
247+ setTranslations ( initialTranslations ) ;
248+ }
249+ } , [ initialTranslations , router ] ) ;
244250
245251 /**
246252 * Change locale
@@ -273,7 +279,7 @@ function TranslationProvider__Prod({
273279 locale,
274280 setLocale,
275281 translations,
276- registerHashes : ( ) => { } , // No-op in production
282+ registerHashes : noop ,
277283 isLoading,
278284 sourceLocale,
279285 } }
You can’t perform that action at this time.
0 commit comments