Code Monkey home page Code Monkey logo

Comments (3)

tikiatua avatar tikiatua commented on May 25, 2024

Hi @nkoehring,

Thank you for raising this issue. We actually never thought about this use case. I will adapt the flattenTranslations function to not flatten arrays and see where this will take us.

We should probably also think about how objects in an array should be handled.

"some.key" : [
    {title: "title one", content: "some content"},
    {title: "title two", content: {name: "myname"}}
]

// should probably be transformed to
"some.key": [
    {title: "title one", content: "some content"},
    {title: "title two", "content.name": "myname"}}
]

from vuex-i18n.

nkoehring avatar nkoehring commented on May 25, 2024

I see where you want to go but I wonder if this is really worth much additional work. I can't imagine a reason why people should create such a data structure for their translations. Do you know any example? Would be interesting to see.

from vuex-i18n.

tikiatua avatar tikiatua commented on May 25, 2024

Cannot really think of an example. I just added the changes and pushed it to npm as version 1.3.0. We assume, that lists would usually be composed only of strings. Therefore we added a console warning if this is not the case. For list of strings variable replacements are supported as usually.

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.