Đặt câu hỏi và nhận tóm tắt tài liệu bằng cách tham chiếu trang này và nhà cung cấp AI bạn chọn
Lịch sử phiên bản
- "Init history"v9.0.013/6/2026
Nội dung của trang này đã được dịch bằng AI.
Xem phiên bản mới nhất của nội dung gốc bằng tiếng AnhIf you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.
GitHub link to the documentationCopy doc Markdown to clipboard
Migrate from i18n-js to Intlayer
Transitioning from the i18n-js library to Intlayer is a highly optimized migration designed to offload large translations configurations into Intlayer's structured file resolution system.
What to do
Execute the following setup command in your repository:
Sao chép mã vào clipboard
npx intlayer initWith intlayer.config.ts prepared, you can add Intlayer's alias to your bundler configuration so that any imports of i18n-js target the compat package @intlayer/i18n-js.
What it does under the hood
i18n-js accesses namespaces through expressions like i18n.t('scope.key', {name}) along with locale fallbacks and specific plural mappings.
Under the hood:
- Interpolation: The compat adapter easily parses
%{name}mappings into your targeted runtime dictionary value. - Pluralization: Replaces
one/othersubkeys and maps them against Intlayer's powerful underlying plural mechanisms (Intl.PluralRules), abstracting away manual mappings. - Locales: Instead of loading monolithic language payloads at bootstrap, dictionaries are served up optimally based on the current context setup via the native Intlayer configuration.