Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Front-end error localization not working

    General Discussion
    2
    6
    483
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      PieterM last edited by

      Hey

      I followed this explanation but this isn't working.
      https://devdocs.bagisto.com/error_translation.html

      Do 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

      1 Reply Last reply Reply Quote 0
      • P
        PieterM last edited by

        Anyone can show me an example?

        1 Reply Last reply Reply Quote 0
        • P
          PieterM last edited by

          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.

          1 Reply Last reply Reply Quote 0
          • A
            aayush.bhatt172 last edited by

            Hello PieterM.

            Please check the following things.

            1. Have you defined your error translation for your locale code like this:
            export const messages = {
                    nl: {
            
            }
            }
            
            1. 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

            1 Reply Last reply Reply Quote 0
            • P
              PieterM last edited by

              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.js

              Also 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?

              1 Reply Last reply Reply Quote 0
              • A
                aayush.bhatt172 last edited by

                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

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post