i18n: s'appuyer sur le fichier fr.json pour l'edition du profil et la page de connexion
This commit is contained in:
@@ -19,6 +19,17 @@ createInertiaApp({
|
||||
return createApp({ render: () => h(App, props) })
|
||||
.use(plugin)
|
||||
.use(ZiggyVue)
|
||||
.mixin({
|
||||
methods: {
|
||||
__(key, replace = {}) {
|
||||
let translation = this.$page.props.translations?.[key] || key;
|
||||
Object.keys(replace).forEach(r => {
|
||||
translation = translation.replace(`:${r}`, replace[r]);
|
||||
});
|
||||
return translation;
|
||||
}
|
||||
}
|
||||
})
|
||||
.mount(el);
|
||||
},
|
||||
progress: {
|
||||
|
||||
Reference in New Issue
Block a user