i18n: s'appuyer sur le fichier fr.json pour l'edition du profil et la page de connexion

This commit is contained in:
jeremy bayse
2026-06-22 13:37:54 +02:00
parent 6d730a4363
commit 0987587a72
7 changed files with 52 additions and 33 deletions
+11
View File
@@ -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: {