ttag-org / ttag

:orange_book: simple approach for javascript localization
https://ttag.js.org/
MIT License
345 stars 44 forks source link

Does it work with react native? #114

Closed chrusart closed 6 years ago

chrusart commented 6 years ago

I can extract translations, merge .pot to .po, but can't make it work in RN. Weird thing is that it only works when I debugging remotely in chrome and reading stored json files. It doesn't work when I'm not connected to remote debugger, it has a problem as stored json files are stripped from Symbol types after JSON.stringify().

undefined is not a function (evaluating 'getObjectKeys(translateObj.translations)[typeof Symbol === "function" ? Symbol.iterator : "@@iterator"]()')
chrusart commented 6 years ago

Ok, probably it has something to do with JavaScriptCore as it's outdated in Android. Symbol is not in shipped in JSC for Android. https://github.com/facebook/react-native/issues/15902 https://github.com/facebook/react-native/pull/5294#issuecomment-190061913 Will post results when using new JSC for RN Android.

chrusart commented 6 years ago

Ok, with new JSC works. https://github.com/react-community/jsc-android-buildscripts Binaries - yarn add jsc-android and just setup Andoid project.

AlexMost commented 6 years ago

Hey @chrusart, sorry for the late reply. Thanks for the research - this can be really helpful. Feel free to report any issues or request a feature) Any feedback is appreciated!