I18n. Fallback doesn't work when using translations outside of Components
See original GitHub issueHelloo,
I have a config like this for image picker:
import I18n from 'react-native-i18n'
const PICKER_OPTIONS = {
title: I18n.t('avatar_title'),
cancelButtonTitle: I18n.t('avatar_cancel'),
takePhotoButtonTitle: I18n.t('avatar_takePicture'),
chooseFromLibraryButtonTitle: I18n.t('avatar_takeFromLibrary'),
}
export default PICKER_OPTIONS
and I receive missing en-US translation with fallback activated. When I use the same I18n.t(‘avatar_title’) in React Components it gets translated.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
i18next translation outside component - Stack Overflow
You are using a backend service to fetch translations asynchronously in the browser. When importing i18n you probably expected translation ...
Read more >Fallback - i18next documentation
i18next by default loads its translations from one file named translation . However, you can configure it to load from multiple files, called...
Read more >The Ultimate Vue Localization Guide | Phrase
Dive into Vue localization and learn how to plug the Vue I18n library into your app, so you can make it accessible to...
Read more >Rails Internationalization (I18n) API - Ruby on Rails Guides
The I18n library will use English as a default locale, i.e. if a different locale is not set, :en will be used for...
Read more >next-translate - npm
Tiny and powerful i18n tools (Next plugin + API) to translate your Next.js pages.. Latest version: 1.6.0, last published: 3 months ago.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@ruskid - I didn’t have time to really create an example of the issue, so I just moved the order of imports like you suggested. That way if what you said works, then we’re good.
Please reopen if the issue persists.
wow… will do