/react-translations-demo

Demonstrates how react-translations and babel-plugin-extract-text can be used to provide a complete and simple gettext style translation solution for React that works both on the client and the server.

Primary LanguageJavaScriptMIT LicenseMIT

react-translations-demo

Demonstrates how react-translations and babel-plugin-extract-text can be used to provide a complete and simple gettext style translation solution for React that works both on the client and the server.

French Demo

Demonstrations

(react-translations)

  • The use of different APIs
  • Server loading of translations for server rendering on boot
  • Client rehydration of translations for client rendering
  • Basic locale detection middleware
  • Middleware that determines which translations to pass to client for rehydration

(babel-plugin-extract-text)

  • Gulp task for extraction of strings to a PO
  • Gulp task for converting a PO into JSON to be used with react-translations

Quick Setup

yarn install & yarn run import & yarn run build

Start Server

yarn start

Extract

yarn run export