File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change
1
+ import { ref } from 'vue' ;
2
+
1
3
export default {
2
4
install : ( app ) => {
3
- let translation = null ;
5
+ const translation = ref ( null ) ;
4
6
5
7
// eslint-disable-next-line no-param-reassign
6
8
app . config . globalProperties . $translate = ( string , fallback ) => {
7
- if ( translation && translation [ string ] ) {
8
- return translation [ string ] ;
9
+ if ( translation . value ?. [ string ] ) {
10
+ return translation . value [ string ] ;
9
11
}
10
12
11
13
if ( import . meta. env . DEV && translation ) {
@@ -21,7 +23,7 @@ export default {
21
23
// value is the translated string, e.g. { key: 'Schlüssel' }
22
24
// eslint-disable-next-line no-param-reassign
23
25
app . config . globalProperties . $translate . setTranslation = ( translationObject ) => {
24
- translation = translationObject ;
26
+ translation . value = translationObject ;
25
27
} ;
26
28
} ,
27
29
} ;
You can’t perform that action at this time.
0 commit comments