Đặ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
Bằng cách tích hợp Intlayer MCP Server vào trợ lý AI ưa thích của bạn, bạn có thể truy xuất toàn bộ tài liệu trực tiếp từ ChatGPT, DeepSeek, Cursor, VSCode, v.v.
Xem tài liệu MCP ServerNộ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 AnhNếu bạn có ý tưởng để cải thiện tài liệu này, vui lòng đóng góp bằng cách gửi pull request trên GitHub.
Liên kết GitHub tới tài liệuSao chép Markdown của tài liệu vào bộ nhớ tạm
New Intlayer v6 - What's new?
Welcome to Intlayer v6! This release focuses on performance, developer experience, and reliability. Below are the highlights, with migration notes and copy‑pasteable examples.
Highlights
- New command: npx intlayer content test to detect missing translations
- New global autoFill option to auto‑generate missing translations
- Fill command defaults to skipping existing translations: npx intlayer fill
- VS Code extension: new Intlayer Activity Bar (Search & Dictionaries), toolbar/context actions, auto‑reveal, Fill/Test commands
- 10× faster builds thanks to promise parallelization
- Remote dictionary caching to avoid refetch at app start
- Improved logging: set log.mode: 'verbose' to inspect behavior
- Stronger validation to prevent app crashes on dictionary issues
- Live updates with CMS using build.importMode = 'live' and pnpm intlayer live
- Fixes: Vue.js integration, Lynx adapter, Visual Editor on Windows
New: Test missing translations
Quickly audit your project to find which keys/locales are missing.
npx intlayer content testOutput:
pnpm intlayer content testMissing translations: - blog-data - Japanese (ja), Korean (ko), Chinese (zh), German (de), Italian (it) - src/components/BlogPage/blogData.content.ts - demo-page - French (fr), Italian (it) - src/components/DemoPage/demo.content.ts - locale-switcher - Italian (it), Portuguese (pt) - src/components/LocaleSwitcher/localeSwitcher.content.tsLocales: English (en), Russian (ru), Japanese (ja), French (fr), Korean (ko), Chinese (zh), Spanish (es), German (de), Arabic (ar), Italian (it), British English (en-GB), Portuguese (pt), Hindi (hi)Required locales: English (en)Missing locales: Japanese (ja), Korean (ko), Chinese (zh), German (de), Italian (it), French (fr), Portuguese (pt)Missing required locales: -Total missing locales: 7Total missing required locales: 0See more options in the CLI docs: CLI reference → "Test missing translations". As well as the Testing guide.
New: Global autoFill to complete missing translations
You can now enable auto‑fill globally so any dictionary with missing translations gets completed automatically.
Sao chép đoạn mã vào khay nhớ tạm (clipboard)
import { type IntlayerConfig, Locales } from "intlayer";const config: IntlayerConfig = { internationalization: { locales: [Locales.ENGLISH, Locales.FRENCH, Locales.SPANISH], defaultLocale: Locales.ENGLISH, requiredLocales: [Locales.ENGLISH, Locales.FRENCH], }, content: { // Auto-generate missing translations for all dictionaries autoFill: "./{{fileName}}Filled.content.ts", // // autoFill: "/messages/{{locale}}/{{key}}/{{fileName}}.content.json", // // autoFill: true, // auto-generate missing translations for all dictionaries like using "./{{fileName}}.content.json" // // autoFill: { // en: "./{{fileName}}.en.content.json", // fr: "./{{fileName}}.fr.content.json", // es: "./{{fileName}}.es.content.json", // }, },};export default config;Auto-fill your missing translations using the npx intlayer fill command.
You can still fine‑tune per dictionary using the autoFill field in content files. Intlayer will first consider the per dictionary configuration and then fallback to the global configuration. See the full reference in Auto-fill and Content file reference.
Fill command: safer defaults
The fill command now, by default, only fills missing translations and skips existing content.
npx intlayer fillAffected dictionary keys for processing: access-key-creation-form-schema, doc-search-metadata, doc-search-page - [access-key-creation-form-schema] Dictionary has no file path. Skipping. - [access-key-creation-form-schema] Processing content declaration: src/components/Dashboard/ProjectForm/AccessKey/useAccessKeyCreationFormSchema.content.ts - [access-key-creation-form-schema] No locales to fill - Skipping dictionary - [doc-search-metadata] Dictionary has no file path. Skipping. - [doc-search-metadata] Processing content declaration: src/app/[locale]/(docs)/doc/search/metadata.content.ts - [doc-search-metadata] No locales to fill - Skipping dictionary - [doc-search-page] Dictionary has no file path. Skipping. - [doc-search-page] Processing content declaration: src/app/[locale]/(docs)/doc/search/page.content.ts - [doc-search-page] [Russian (ru)] Preparing translation for dictionary from English (en) to Russian (ru)[intlayer] Applied Prettier formatting to src/app/[locale]/(docs)/doc/search/page.content.ts - [doc-search-page] Content declaration written to src/app/[locale]/(docs)/doc/search/page.content.tsCI examples are available in CI/CD.
Updated VS Code extension
The extension now includes a dedicated Intlayer tab in the Activity Bar and several workflow improvements:
- Intlayer Activity Bar with two views:
- Search webview for live dictionary/content search
- Dictionaries tree listing environments, dictionaries, and contributing files
- Toolbar on Dictionaries view: Build, Pull, Push, Fill, Refresh, Test, Create Dictionary File
- Context menus: Pull/Push on dictionaries; Fill on files
- Auto‑reveal: the current editor file is highlighted in the Dictionaries tree when applicable
- New commands available from the Command Palette: Fill Dictionaries and Test Dictionaries
See details in the Official VS Code Extension documentation.
Updated the MCP server to support the new features.
- Auto-fill
- Test missing translations
- Live updates
- Logging
- Validation
- Migration notes
- Documentation
MCP server helps for the automatisation of project using Intlayer. Testing missing translations for autogenerated code. It helps understanding your config, and embed the documentation of Intlayer in your IDE.
Performance: 10× faster
- Parallel resolution of local and remote dictionaries
- Remote dictionaries are cached to avoid re‑fetching at app startup
npx intlayer buildOutput:
[intlayer] Preparing Intlayer (v6.0.1)[intlayer] Dictionaries:[intlayer] ✓ Local content: 163/163[intlayer] ✓ Remote content: 100/100[intlayer] - access-key-creation-form [local: ✔ built] [distant: ✔ imported][intlayer] - access-key-form [local: ✔ built] [distant: ✔ imported][intlayer] - ai-ab-testing-section [distant: ✔ imported][intlayer] - application-not-running-view [local: ✔ built] [distant: ✔ imported][intlayer] - available-techno-section [local: ✔ built] [distant: ✔ imported][intlayer] - blog-data [local: ✔ built][intlayer] - blog-metadata [local: ✔ built][intlayer] - blog-nav-list [local: ✔ built] [distant: ✔ imported][intlayer] - blog-page [distant: ✔ fetched][intlayer] - blog-search-page [local: ✔ built] [distant: ✔ imported]...[intlayer] Content loaded (Total: 8401ms - Local: 4050ms - Remote: 4222ms)Logging improvements
The logging system has been improved to provide more detailed information about what happens during build and runtime transformations.
Enable verbose logs to better understand what happens during build and runtime transformations.
Sao chép đoạn mã vào khay nhớ tạm (clipboard)
export default { log: { mode: "verbose", // options: "default" | "verbose" | "disabled" },};See Configuration for all logging options.
Stronger validation
Dictionary processing now performs more robust validation. When a dictionary fails to process, Intlayer avoids breaking your application and surfaces actionable errors.
Live updates with CMS (Production‑safe)
Serve live content updates (e.g., editorial updates) in production without rebuilding your application.
- Enable live import mode:
Sao chép đoạn mã vào khay nhớ tạm (clipboard)
import { type IntlayerConfig } from "intlayer";const config: IntlayerConfig = { build: { importMode: "live", // "static" | "dynamic" | "live" }, editor: { liveSync: true, // enable live sync server side },};export default config;- Run your app and live process side‑by‑side:
npx intlayer live --with 'vite preview'Notes:
- Only dictionaries flagged to use live mode will be fetched live. Others are optimized for performance.
- Falls back to dynamic import if the live API isn’t reachable.
See CMS and Live Sync and Configuration for complete guidance.
Parallel process to watch files on turbopack
When using Turbopack on Next.js 14 and above as your development server with the next dev --turbopack command, dictionary changes will not be automatically detected by default.
This limitation occurs because Turbopack cannot run webpack plugins in parallel to monitor changes in your content files.
To work around this, we dropped the intlayer watch command, using the --with option to run both the development server and the Intlayer build watcher simultaneously.
Sao chép đoạn mã vào khay nhớ tạm (clipboard)
{ "scripts": { "dev": "npx intlayer watch --with 'next dev --turbopack'", },}Migration notes
- Removed: dictionaryOutput (previously i18next or next-intl). This will come back as pluggable adapters in future versions. Remove the field from your config.
- Related removal: i18nextResourcesDir (see doc/configuration changelog).
- Prefer the new global content.autoFill option to generate missing translations at scale.
- Use npx intlayer content test to gate PRs on missing translations.
- For verbose diagnostics, set log.mode = 'verbose'.
- Use intlayer instead of intlayerPlugin and intlayerMiddleware instead of intlayerMiddlewarePlugin in your Vite configuration.
Fixes
- Vue.js integration stability
- Lynx adapter improvements
- Visual Editor on Windows
Migration notes from v6 to v7
Check the migration notes from v6 to v7 for more information.