infinitered / ignite-i18n

An ignite plugin for react-native-i18n.
4 stars 9 forks source link

FIX - app could crash if default translation not exists #12

Closed Fr33maan closed 7 years ago

Fr33maan commented 7 years ago

Stupid error in https://github.com/infinitered/ignite-i18n/pull/9

We tried to find a unknownError by default but this one is an extra translation I've personally add. Plus you don't necessary try to send an error to the client. The best thing to do is to send the message you try to translate directly to the client if no translation exists.

GantMan commented 7 years ago

good catch!

Fr33maan commented 7 years ago

Thanks for your quick action !

Fr33maan commented 7 years ago

Well actually the module was managing default translation. The fix is useful in case you give an object or undefined to the I18n.t function which will crash in this case.

If the translation does not exists, we have a message not so user friendly. I'm going to try to do something better, I don't like the initial solution.

Sorry for that PR, it should have been perfect at first try.

jamonholmgren commented 7 years ago

Sorry for that PR, it should have been perfect at first try.

No worries, @l1br3 , love your recent contributions!

Fr33maan commented 7 years ago

thanks @jamonholmgren !