rsnext/examples/with-i18n-next-intl
Nick Babcock 5629223407
Update examples to use React 17 (#26133)
[With next 11 requiring react 17](https://nextjs.org/blog/next-11#upgrade-guide), most of the examples
need to be updated, so the following snippet updated all the examples to
a compatible react version.

```bash
cd examples/
fd -g 'package.json' | xargs sed -r -i 's/"react": ".*"/"react": "^17.0.2"/
fd -g 'package.json' | xargs sed -r -i 's/"react-dom": ".*"/"react-dom": "^17.0.2"/'

# exclude experimental react version
git checkout with-reason-relay/package.json
```
2021-06-16 16:43:26 +00:00
..
components Add next-intl example (#21447) 2021-04-19 19:58:36 +00:00
messages Add next-intl example (#21447) 2021-04-19 19:58:36 +00:00
pages Add next-intl example (#21447) 2021-04-19 19:58:36 +00:00
.gitignore Add next-intl example (#21447) 2021-04-19 19:58:36 +00:00
next.config.js Add next-intl example (#21447) 2021-04-19 19:58:36 +00:00
package.json Update examples to use React 17 (#26133) 2021-06-16 16:43:26 +00:00
README.md docs: add 'Open in StackBlitz' buttons to various examples (#25853) 2021-06-08 20:45:02 +00:00

next-intl example

This example uses next-intl, a minimal, but complete solution for managing internationalization in Next.js apps.

Features

  • 🌟 I18n is an essential part of the user experience, therefore this library doesn't compromise on flexibility and never leaves you behind when you need to fine tune a translation. Messages use the proven ICU syntax which covers interpolation, numbers, dates, times, plurals, ordinal pluralization, label selection based on enums and rich text.
  • ⚔️ Based on battle-tested building blocks from Format.JS (used by react-intl), this library is a thin wrapper around high-quality, lower-level APIs for i18n.
  • 💯 Built-in number and date formatting that is integrated with translations, e.g. allowing for the usage of global formats for a consistent look & feel of your app.
  • 💡 A hooks-only API ensures that you can use the same API for children as well as for attributes which expect strings.
  • 🚀 Integrates with both static as well as server side rendering.

Preview

Preview the example live on StackBlitz:

Open in StackBlitz

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

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

npx create-next-app --example with-i18n-next-intl
# or
yarn create next-app --example with-i18n-next-intl

Deploy it to the cloud with Vercel (Documentation).