Comments (5)
Well, in the end I just did this:
I18n.locale = I18n.currentLocale().replace(/_.+/, "")
But I wonder if there is a better way for this?
from react-native-i18n.
What are you trying to achieve? Do you want to fallback to en
for en_US
and en_GB
? If so, there was a bug which I fixed in 0.0.6. Now you can do the following:
I18n.fallbacks = true
I18n.translations =
en:
test: 'test'
Now this translation will work for every en_*
locale.
from react-native-i18n.
I have updated the README: https://github.com/AlexanderZaytsev/react-native-i18n/blob/master/README.md
from react-native-i18n.
I want 'de_DE' and 'de_US' to use 'de'. If the the 'de' translation doesn't exist, use 'en'.
from react-native-i18n.
You'll be able to achieve this in 0.0.6 with fallbacks enabled. Use de
in your I18n.translations
, de_DE
and de_US
will fallback to it. If de
doesn't exist, I18n.js
by default fallbacks to en
.
from react-native-i18n.
Related Issues (20)
- Rerender Text change
- v2.0.15 broke android release build HOT 1
- Not working on IOS xcode12.4/12.5 HOT 1
- Android native code issue
- Not compile() HOT 2
- for latest RN
- missing en-US "" translation
- compile() on react-native-i18n package is not found; build always failing when package is used HOT 1
- android can not build with error compile HOT 2
- Android Could not find method compile() for arguments [project ':react-native-i18n'] HOT 2
- Android cannot build with minSdkVersion in AndroidManifest
- patch gradle android issue
- please upgrade gradle file.
- Compile keyword does not exist in the new versions of Gradle HOT 1
- react-native-i18n not working on React Native 0.70+
- Could not find method compile() for arguments
- react-native-locale-detector oldies problem
- not working on RN 072
- A problem occurred evaluating project ':react-native-i18n'. > Could not find method compile() for arguments [com.facebook.react:react-native:+] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
- compile issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-i18n.