Comments (3)
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.
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.
@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)
- Randomly JSON.parse Error when using i18n extract plugin HOT 1
- Support i18next JSON v4's format HOT 5
- Translations not extracted when `t` is used as a template tag literal
- when running tests, I get a warning
- Align Trans key extraction with react-i18next for elements with i18nIsDynamicList
- Ability to extract plurals from defaultValues HOT 1
- Using discardOldKeys keeps only strings from last file
- Allow specifying fallback-functions to parse AST-node for extractors
- Allow defining defaults in the "i18next-extract-mark-context-next-line" directive HOT 1
- extraction not working for TransComponent HOT 5
- Feature key prefixes
- excludes doesn't seem to work HOT 1
- One project where "nested
- Race condition in extract HOT 4
- Can't get an Array of strings to translate HOT 1
- Support fallback keys
- Add comment hint to explicitly register translation keys
- Adding count to t options throws error at computeDerivedKeys and causes webpack build to fail HOT 1
- [BUG][0.9.1] Latest Release Packaging is broken? HOT 2
- translation resource files get overwritten HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from babel-plugin-i18next-extract.