I'd like to refer multi-language locale data of same keys in my React code. How to do that?
For example, in another scheme like Ruby on Rails, we can fetch expected locale data as below:
I18n.available_locales.map { |locale| I18n.t('hello', locale: locale) }
In the case above, when I18n.available_locales
equals to ['en', 'ja']
, then we can fetch English and Japanese locale data of same key.
In react-intl, IntlProvider
component already has context for locale (like en
or ja
) so I wonder how can I do that.
Regards,