Translating Your React Native App With i18n-js & Expo-Localization

Colin Wren
The Startup
Published in
6 min readJan 16, 2021

--

Photo by JACQUELINE BRANDWAYN on Unsplash

I’ll apologise in advance for the back and forth on the spelling of the word ‘locali(s|z)e’. I’m British but the library uses the American spelling.

During the development of JiffyCV I never really gave much thought to the localisation needs of an app until I went to submit to the different app stores and realised the scale of markets being supported.

Localisation is a tricky task to get right, especially in the domain JiffyCV exists in as it’s not as simple as translating text, but there are considerations into the format of data like dates (in the UK we use DD/MM/YYYY, in the US it’s MM/DD/YYYY).

Localisation also covers the names of entities and concepts. For instance in the UK the terms CV and Resume are interchangable and refer to a short summary of your skills (ideally it’s a single page) but in the US the term CV isn’t really used and a Resume can often span multiple pages.

With localisation having such an impact into how the app looks and how users understand the app’s concepts there needs to be an easy way to implement the logic to determine what to show based on the locale the user is using.

Luckily Expo provides a library called expo-localization to get the user’s locale from their device and this can be combined with…

--

--

Colin Wren
The Startup

Currently building reciprocal.dev. Interested in building shared understanding, Automated Testing, Dev practises, Metal, Chiptune. All views my own.