Code Monkey home page Code Monkey logo

Comments (2)

everttrollip avatar everttrollip commented on July 18, 2024

Update: I did a quick follow-up in the documentation, and I do now notice that I can only use the plugin once.

Vue.use automatically prevents you from using the same plugin more than once, so calling it multiple times on the same plugin will install the plugin only once.

However, do you know of any way that I can resolve my issue? By that I mean being able to handle multiple language/localisation handlers?

from vuex-i18n.

tikiatua avatar tikiatua commented on July 18, 2024

HI @everttrollip

Thank you for submitting this issue. This is indeed a very interesting and important use case that is currently not really well supported.

The idea with the two separate modules is great. Unfortunately, it will not work as the two plugin invocations register the translation functions on the vue instance (i.e. the $t) with the same names and therefore collide with each other.

What you can do, is use the $tlang method or translateIn filter to pass the language that should be used for a translation and base this on an other value that you set specifically.

{{ 'message' | translateIn('en') }}

Please let me know if this works for you, as we are currently in the process of developing version 2 of the plugin and might need to think about this usecase some more.

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.