AlexanderZaytsev / react-native-i18n

React Native + i18n.js
MIT License
2.18k stars 493 forks source link

Is it possible to find out what variables string contains? #227

Open iremlopsum opened 6 years ago

iremlopsum commented 6 years ago

For example if I have

helloString = 'Hello, {{name}}, how is your {{timeOfTheDay}}?'

I could do I18n.t('helloString', { name: Julie, timeOfTheDay: 'morning' });

But what I would love to do is something like I18n.t('helloString', (variables) => variables.map(var => this.state[var])

this way I can automate variable logic for forms based on previous entries.