Strong-typed I18N in React

Alex Vasilev
Geek Culture
Published in
3 min readOct 18, 2021

--

Adding i18n support to your app can be painful. Extracting all text strings from JSX to translation files and replacing them with keys is meticulous monotonous work. One small misspelling and oops you got a bug. But what if I tell you, that you can use TypeScript to validate translations?

The idea is pretty simple: translations are stored in JSON files as a key-value dictionary, TypeScript is able to parse them and…

--

--