Code Monkey home page Code Monkey logo

Comments (3)

gilbsgilbs avatar gilbsgilbs commented on June 7, 2024

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.

emroussel avatar emroussel commented on June 7, 2024

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.

culshaw avatar culshaw commented on June 7, 2024

This would really help us :)

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.