source link: https://www.i18nifty.dev/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Type-safe internationalization and translation in React
A i18n library designed to leverage TypeScript's type inference capability.
Localization is much less of a chore when assisted by intellisense.
TypeScript let you know where and what translations need to be provided while allowing you explicitly fallback to the default language.
Enable Copilot! 🦾
With GitHub Copilot enabled, translation is mostly a matter of supervision, even when there is logic involved!
Only the user's language translations downloaded
i18nifty provide an option for implementing code splitting, so that you avoid bundling every all translations for all languages in the main JS bundle. (Currently only available for SPAs).
React component and JS logic
Freely includes React components such as
Language defaults to browser preference
Language default to
navigator.language if your app is an SPA or to
HTTP Header if it's a Next.js app.
Selected language persisted across reloads
The language is persisted across reloads using
localStorage for SPA and
using cookie for Next.js apps.
Aggregate valuable and interesting links.
Joyk means Joy of geeK