Comments (3)
Composing is indeed not supported and I'm kind of on the fence about adding such feature. Sure we could support compose
function from recompose
, but then we would have to support flowRight
from lodash, then compose
from lodash FP and then custom implementations of compose and probably other very specific currying functions and so on. Even then, should we support both array and variadic version of lodash's flowRight
?
Maybe we could try to be a little smart and just rely on a (possibly configurable) whitelist of compose
keywords, still that sounds like a very specific use-case to me and a lot of "magic" would probably be involved to support every or even most use-cases.
I'm sure you know it, though as a workaround, you can use a comment hint for this:
// i18next-extract-mark-ns-start namespace1
const SomeComponent = ({ t }) => <div>{t('mykey')}</div>;
// i18next-extract-mark-ns-stop
export const SomeComponentWrapped = compose(withTranslation('namespace1'))(SomeCompone
That was one of the main intentions behind comment hints by the way. Avoid blocking the user because a specific case (typically something very "runtime-ish") isn't or won't be supported by the library.
If you have any strong opinion on this, I'd be glad to hear it.
from babel-plugin-i18next-extract.
Interesting, that makes sense.
It would be nice to be able to pass an option to the config that says everything in x directory should have y namespace instead of declaring that inside each file, but I think that would require changing the i18next API as well.
from babel-plugin-i18next-extract.
This would really help us :)
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.