I want two more thing in Expo! localizations and console.log object


#1

Hi. I love React Native and love your works.

I have two suggestions with your work.

  1. I want Expo to include localizations to handle multiple languages which is very important in app development.

  2. Expo client app won’t show any console if I put console.log with object. Such as “console.log(props)”. I want this to appear like a chrome.

I hope your project work forever!! Love it.


#2

Hi!

1.) You can npm install i18n-js from https://github.com/everydayhero/i18n-js and then work along the README.md from https://github.com/fnando/i18n-js .

2.) For logging complex objects, you need to enable javascript debugging, like explained here: https://docs.expo.io/versions/v17.0.0/guides/debugging.html

Cheers,
Marcus


#3

Thanks for reply.

I hope i18n-js is in part of Expo.

Also can you provide me usage expample of using https://github.com/fnando/i18n-js library?


#4

We also provide Expo.Util.getCurrentLocaleAsync() to figure out which is the user’s preferred locale on their device. See the docs for this method (sorry it’s a bit hard to discover).


#5

https://github.com/expo/expo/issues/10 has a link to this example: https://github.com/locize/locize-examples/tree/master/react-native-expo


#6

I read the documents you commented before I wrote the question.

What I expected was seeing object console like provided in chrome as you can see from above image. When I do debug JS remotely, application gets really slow. Hope I can debug only using expo tool debugging.

Thanks.!


#7

We’re working on making console.log(...) between the Expo client and XDE/exp more robust and support many more data types like React components, for example. It’s still in progress and I don’t know when it will be released but just want you to know we are thinking about it.

In the meantime, you could do your own custom object serialization yourself, like console.log(yourFunction(...)).


#8

Thanks. I just wanted to know if expo team is working on it.


#9

Hi ide, any progress in implementing localization in Expo ? Will it come in future ?
Thanks


#10

Is this still an issue? You can use https://github.com/i18next/react-i18next/ with expo -> there is even a sample: https://github.com/i18next/react-i18next/tree/master/example/react-native-expo (using Expo.Util.getCurrentLocaleAsync for language detection)