Overview
Next-g11n is a toolbelt specifically designed for translating Next.js apps. It offers features such as i18n routing, type-safe dictionaries, and optimization for Server-Side Rendering.
Features
- Next.js i18n Routing: Enables easy navigation and routing for internationalized Next.js apps.
- Type-safe dictionaries: Provides type safety when working with translation objects/maps.
- Optimized for Server-Side Rendering: Supports rendering translations on the server-side, including interpolated terms.
Installation
To install next-g11n, use the following command:
yarn add next-g11n
or
npm i next-g11n
To create your dictionary.ts file (or any other name you prefer), define the translation object/map. It can carry one or multiple locales. The object format should follow a specific structure.
Summary
Next-g11n is a useful tool for translating Next.js apps, offering features like i18n routing, type-safe dictionaries, and optimization for Server-Side Rendering. It provides an easy installation process and guides users on how to create their translation dictionaries. With its features and optimizations, it simplifies the task of internationalizing Next.js applications.