使用您最喜欢的AI助手总结文档,并引用此页面和AI提供商
版本历史
- "Init history"v9.0.02026/6/13
此页面的内容已使用 AI 翻译。
查看英文原文的最新版本如果您有改善此文档的想法,请随时通过在GitHub上提交拉取请求来贡献。
文档的 GitHub 链接复制文档 Markdown 到剪贴板
Intlayer Compat Adapters
Migrating a large application to a new internationalization library can be daunting. To ease this transition, Intlayer provides compat adapters for the most popular i18n libraries in the ecosystem.
These adapter packages expose the exact same public API as your existing i18n libraries, but delegate all translation work to Intlayer at runtime.
How it works
When you use a compat adapter, you do not need to rewrite your application's imports or change how you use your translation hooks and components. Instead, Intlayer's bundler plugins automatically alias your existing imports to the Intlayer compat packages.
For example, a developer replaces import { useTranslation } from 'react-i18next' with import { useTranslation } from '@intlayer/react-i18next' (done automatically via the bundler plugin), and the app keeps working with translations now served from Intlayer dictionaries. Keys are also typed against your Intlayer dictionaries!
Available Compat Adapters
Choose your existing library below to see how to migrate seamlessly: