Code Monkey home page Code Monkey logo

Comments (3)

gilbsgilbs avatar gilbsgilbs commented on June 7, 2024

Hi,

Thanks for raising an issue about this.

Initially, I did want to provide different merging strategies for the exporter and an option for this used to exist. Unfortunately, the plugin may get called multiple times by babel which makes it hard to know if it's safe to remove keys from the JSON or if they will be caught in an upcoming file.

I'm unsure how to tackle this. I'd prefer to find a way to know if it's the last file and the transpilation is going to end, but I didn't find a way to do this using the Babel plugin API. I'll have to think of it a bit more, unless somebody have a better idea.

from babel-plugin-i18next-extract.

gilbsgilbs avatar gilbsgilbs commented on June 7, 2024

I edited the title, because I think it didn't relate what you really want. In your case, let's assume you had:

{
  "MyKey": "Foo",
  "Profile": ""
}

What you really want as output is:

{
  "MyKey": "Foo",
  "Profil": ""
}

keeping the value of MyKey if it was set. This is a bit different from recreating the translation files at each run.

Am I right?

from babel-plugin-i18next-extract.

gilbsgilbs avatar gilbsgilbs commented on June 7, 2024

@rpCal, could you try to upgrade to 0.1.0-rc.1, set the new discardOldKeys option to true and tell me if it fits your needs?

from babel-plugin-i18next-extract.

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.