Code Monkey home page Code Monkey logo

Comments (1)

tikiatua avatar tikiatua commented on June 19, 2024

Hi @BorysTyminski,

Thank you for your feedback. First of all, I would recommend to not use the this keyword inside a vuex store but only act on the properties passed into the respective functions.

The vuex-i18n plugin will actually simply register a special vuex module in the i18n namespace (https://vuex.vuejs.org/guide/modules.html).

So to modify the i18n data, you can call the respective actions. In your example, this would be the action 'i18n/setLocale'.

I would also advice you to call the respective i18n action from inside another action and not from inside a mutation.

// dispatch an action for the i18n vuex module
dispatch('i18n/setLocale', currentLanguage, { root: true });

You can find all available actions and mutations inside this file
https://github.com/dkfbasel/vuex-i18n/blob/master/src/vuex-i18n-store.js

from vuex-i18n.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.