On iOS all fine. If device lang is ru then I see this locale. On android it is empty string. I've tested it on virtual device and real device.
See next code:
import I18n from 'react-native-i18n';
console.log('I18n', I18n);

+1 Same problem here
I think, I need to add that I use Android 6.0
I use I18n.currentLocale() which works for me.
@denvers For me it returns "en", while phone is in "ru"
FIXED! Just don't use automatic setup via "link". Check your MainApplication.java for import of library and it's initializaition
@inferusvv So you mean that the react-native link did not set it up correctly and you needed to correct it manually?
@leventebalogh yes, it doesn't work
@inferusvv weird, which version on rn? :octocat:
it works for me
This should be re-opened, it's still an issue and @inferusvv's solution is the correct one. Maybe the recipe for rnpm link needs to be updated?
I'm getting an empty locale too on iOS.

Digging deeper I modified line 6 of index.js and added console.log(RNI18n) and it logs undefined, thus an empty string is assigned to I18n.locale key.
Hey there, can you provide some more info on the version of RN you're using?
I tried it on a bunch of different flavours and it worked correctly with react-native link :(
Im using RN 0.40, maybe it didn't link correctly? Is there a way to unlink and link again?
On Jan 26, 2017, 6:27 AM -0300, Matteo Mazzarolo notifications@github.com, wrote:
>
Hey there, can you provide some more info on the version of RN you're using?
I tried it on a bunch of different flavours and it worked correctly with react-native link.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub (https://github.com/AlexanderZaytsev/react-native-i18n/issues/43#issuecomment-275343158), or mute the thread (https://github.com/notifications/unsubscribe-auth/AA-g9lOibZxK9WhzeUctgjfClQw1XN61ks5rWGcOgaJpZM4Ka-ak).
Are you on [email protected]? You can unlink using react-native unlink react-native-i18n.
Yes I am using 1.0.0.
I've unlink and link again and it is still returning undefined.
Tried npm uninstall then install again, link, and restart packager, still not working :(
It isn't here, so I guess it didn't link correctly.

I added it manually now it works :)
We encountered the same result as @wachunei, where we had to manually added lib for iOS.
RN 0.42.0rc, react-native-i18n 1.0.0.
@wachunei how do we add and link the library manuallly on iOS? I opened up the xcode project workspace and go to see the project nagviator. I saw RN1I18n.xcodeproj is listed there. Does it mean i have the library linked?
@jjhesk open ios/*.xcodproj project, then click on your project in the Project Navigator sidebar, click on Build Phases and expand Link Binary With Libraries section, libRNI18n.a should not be listed. Expand Libraries folder in Project Navigator, then RNI18n.xcodeproj » Products, grab libRNI18n.a and drop it into the Link Binary With Libraries list. You're done. Here's the official guide to Linking Libraries in iOS
Hey all, I've been a bit busy lately.
Does anyone know what can be the source of this linking bug? It seems to happen since 0.40 🤔
I'm kinda lost here, how do packages tell react-native link what to link to project?
Same for me, I created some native libraries in the past (like this one) but react-native link has always worked out of the box for me on both Android and iOS.
Btw thank you @wachunei for all the support :)
Just to state that I also had to manually add to the build phases (library was correctly added) testing on ios10 simulator with current i18n lib (^1.0.0)
Ok, I have solved with a workaround (see this open issue by me): https://github.com/AlexanderZaytsev/react-native-i18n/issues/53
You can add this (tested on iOS emulator) to solve the locale undefined or empty:
I18n.locale = I18n.currentLocale();
Hey guys, I'm setting up a new project with this library and bug is still happening, just had to drag and drop libRNI18n.a manually to linked libraries. Android seems to work fine.
I think this is a non-minor bug and should me mentioned in README.md, because everyone is going to fall back to manual installation, not after a few tries and losing some time figure things out.
I have not found a way to specify react-native link exactly what to do to link this library correctly.
@mmazzarolo you're welcome, I'm glad to help.
@wachunei I added a warning in the README.md. I investigate on the problem.
Can you give a try on the v2.0.0? It should be fixed now 😃
@zoontek Some hours ago upgraded library. All fine 👍
Most helpful comment
@leventebalogh yes, it doesn't work