rsnext/examples/with-i18n-rosetta
Dustin Deus d28ad8805a
Rosetta i18n example (#11841)
* add rosetta example

* add comment

* add example for ssr

* add debug example, rerender when i18n keys are added

* output active locale, fix interpolation, fix cases for SSR and CSR

* add useful comments

* address pr issues

* update name in readme

* improve wording

* rename folder

* fix prop typo, add redirects

* load specific i18n json file in getStatisProps
Dashboard dont use any ssr technique

* use ext

* improve example

* Updated example

Co-authored-by: Luis Alvarez <luis@zeit.co>
2020-04-21 12:49:18 -05:00
..
components Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
hooks Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
lib Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
locales Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
pages Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
next.config.js Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
package.json Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00
README.md Rosetta i18n example (#11841) 2020-04-21 12:49:18 -05:00

rosetta example

This example uses rosetta, react hooks and context to provide a SSR, SSG, CSR compatible i18n solution.

In next.config.js you can configure the fallback language.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Using create-next-app

Execute create-next-app with npm or Yarn to bootstrap the example:

npm init next-app --example with-i18n-rosetta with-i18n-rosetta
# or
yarn create next-app --example with-i18n-rosetta with-i18n-rosetta

Download manually

Download the example:

curl https://codeload.github.com/zeit/next.js/tar.gz/canary | tar -xz --strip=2 next.js-canary/examples/with-i18n-rosetta
cd with-i18n-rosetta

Install it and run:

npm install
npm run dev
# or
yarn
yarn dev

Deploy it to the cloud with Vercel (Documentation).