Front-end error localization not working
-
Hey
I followed this explanation but this isn't working.
https://devdocs.bagisto.com/error_translation.htmlDo I need to run some sort of command or did I miss something.
The locale is set to NL and the pages are translated just fine but the front-end vue validation isn't translated.Greets
-
Anyone can show me an example?
-
I added this code:
Vue.use(VeeValidate, {
dictionary: {
nl: { messages: {
required : (field) => 'Veld' + field + 'is verplicht',
}
}
}
});In file: resources/assets/js/app.js
and then I ran npm run dev which created an app.js in the public folder with the correct functions but the errors are still in english.
-
Hello PieterM.
Please check the following things.
- Have you defined your error translation for your locale code like this:
export const messages = { nl: { } }
- Have you executed this command :
npm run watch
Please revert back in any kind of confusion.
Also, please check the link below. Here's the solution of the same kind of problem.
https://github.com/bagisto/bagisto-docs/issues/134 -
Hey Aayush
The file app.js is this the one in the in Shop package or in the resources folder?
packages/Webkul/Shop/src/Resources/assets/js/app.js
or
resources/assets/js/app.jsAlso when I run 'npm run dev' I see that the app.js in the public fonder changes but the shop.js in the public/themes directory does not. Isn't the shop.js file not the one with all the logic?
How do I update the themes/default/asset/js/shop.js file?
-
Hello PieterM.
After making the changes with command npm run watch/dev.
Make sure to run the command npm run prod for saving the changes.Also, intstall npm in the particular package only and run all the npm commands inside the package only.
No need to make changes in resources/assets/js/app.js