Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Show HN: React Router V8 integration for LinguiJS

A new open-source package, lingui-rr, provides React Router V8 integration for LinguiJS, enabling localized routing with support for language prefixes and cookie-based language detection in React applications.

Background

- **LinguiJS** is an internationalization (i18n) library for JavaScript/React apps — it helps developers manage translations (e.g., English → Japanese, French, etc.) by extracting text from code, formatting translated messages, and handling plurals/dates. - **React Router V8** (often referred to as React Router v6 under the hood) is the standard routing library for React. This integration lets LinguiJS work with route-level code splitting: each route can load only its own translations on demand, reducing initial bundle size. - **`lingui-rr`** is an open-source package that wires the two together, enabling lazy-loaded translations per route so that users aren't sent the full set of translation strings upfront — important for large multilingual apps. - This matters because many React apps are now built with React Router v6's new "data router" APIs; existing Lingui integration examples are outdated or cumbersome, and this package fills that gap for developers shipping production-grade multilingual sites.

Related stories