martinandert / react-translate-component

A component for React that utilizes the Counterpart module to provide multi-lingual/localized text content.
MIT License
322 stars 31 forks source link

Can't translate from Array #16

Closed pistou closed 8 years ago

pistou commented 8 years ago

I'm trying to translate from an Array For instance:

en.js

module.exports = {
    foo: {
        bar: [
            {
                lorem: "ipsum",
                some: "text"
            }
        ]
    }
};

component.jsx

<Translate content="foo.bar[0].lorem" />

At this point, all I get is

missing translation: en.foo.bar[0].lorem

Is there a way to achieve this?

martinandert commented 8 years ago

Unfortunately, translating from arrays is not supported at the moment. I'm not sure if this is a good feature to have.