next-export-i18n v1.3.0: respecing the user’s default language

Today I released version 1.3.0 of next-export-i18n, the i18n module for Next.js which is fully compatible with next export.

Install next-export-i18n with $ npm i next-export-i18n or get next-export-i18n v1.3.0 from npm.js.

New feature:…


This content originally appeared on DEV Community and was authored by martin krause

Today I released version 1.3.0 of next-export-i18n, the i18n module for Next.js which is fully compatible with next export.

Install next-export-i18n with $ npm i next-export-i18n or get next-export-i18n v1.3.0 from npm.js.

New feature: Respecting the user's default language

Starting with Version 1.3.0, next-export-i18nreads the user's default language settings from the browser. If this language is available as i18n it is automatically used as the default language.

About next-export-i18n

This npm module provides a simple solution for Internationalization (i18n) of projects using next export.

Next.js already has support for internationalized (i18n) routing out-of-the-box. You can provide a list of locales, a default as well as domain-specific locales and Next.js automatically handles the routing. It streamlines the touring and locale parsing for nearly all existing l18n library solutions available for Next.js such as react-intl, react-i18next, lingui, rosetta, next-intl.

Unfortunately, Next.js i18n-routing does not supports next export.
This means that none of the i18n-libraries (which are utilizing the build in i18n-routing) is able to support fully static sites which are generated with next export.

next-export-i18n provides a simple solution for Internationalization (i18n) when you want to generate a truly static website with next export.

Read the Introduction to next-export-i18n - next.js: i18n with static sites for more details.

Sample implementation

You can also take a look at the example implementation next-export-i18n-example.vercel.app and its source code at github: https://github.com/martinkr/next-export-i18n-example.

Links

Follow me on Twitter: @martinkr and consider to buy me a coffee

Photo by Jerry Zhang on Unsplash

Subscribe to the weekly modern frontend development newsletter


This content originally appeared on DEV Community and was authored by martin krause


Print Share Comment Cite Upload Translate Updates
APA

martin krause | Sciencx (2022-01-07T14:27:44+00:00) next-export-i18n v1.3.0: respecing the user’s default language. Retrieved from https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/

MLA
" » next-export-i18n v1.3.0: respecing the user’s default language." martin krause | Sciencx - Friday January 7, 2022, https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/
HARVARD
martin krause | Sciencx Friday January 7, 2022 » next-export-i18n v1.3.0: respecing the user’s default language., viewed ,<https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/>
VANCOUVER
martin krause | Sciencx - » next-export-i18n v1.3.0: respecing the user’s default language. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/
CHICAGO
" » next-export-i18n v1.3.0: respecing the user’s default language." martin krause | Sciencx - Accessed . https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/
IEEE
" » next-export-i18n v1.3.0: respecing the user’s default language." martin krause | Sciencx [Online]. Available: https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/. [Accessed: ]
rf:citation
» next-export-i18n v1.3.0: respecing the user’s default language | martin krause | Sciencx | https://www.scien.cx/2022/01/07/next-export-i18n-v1-3-0-respecing-the-users-default-language/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.