HomeSandboxShowcaseAppDocBlog
    • EnglishEnglish
      EN
    • русскийRussian
      RU
    • 日本語Japanese
      JA
    • françaisFrench
      FR
    • 한국어Korean
      KO
    • 中文Chinese
      ZH
    • españolSpanish
      ES
    • DeutschGerman
      DE
    • العربيةArabic
      AR
    • italianoItalian
      IT
    • British EnglishBritish English
      EN-GB
    • portuguêsPortuguese
      PT
    • हिन्दीHindi
      HI
    • TürkçeTurkish
      TR
    • polskiPolish
      PL
    • IndonesiaIndonesian
      ID
    • Tiếng ViệtVietnamese
      VI
    • українськаUkrainian
      UK
    /
    Filter docs by framework
    Alt+←
    Why Intlayer ?
    Get Started
    Concept
    • How Intlayer Works
    • Configuration
    • TestFillBuildWatchExtractLoginPushPullConfigurationListVersionEditorLiveDebugDoc ReviewDoc TranslateSDK
    • Visual Editor
    • CMS
    • CI/CD Integration
    • TranslationPluralEnumerationConditionGenderInsertionFileNestingMarkdownHTMLFunction Fetching
    • Per Locale File
    • Compiler
    • Auto Fill
    • Testing
    • Bundle Optimization
    Environment
    • Next.js 14 and App Router
      Next.js 15
      Next.js no locale path
      Next.js and Page Router
      Compiler
    • Tanstack Start Solid
    • Astro and React
      Astro and Svelte
      Astro and Vue
      Astro and Solid
      Astro and Preact
      Astro and Lit
      Astro and Vanilla JS
    • React Router v7
      React Router v7 (fs-routes)
      Compiler
    • Nuxt and Vue
    • Vite and Solid
    • SvelteKit
    • Vite and Preact
    • Vite and Vanilla JS
    • Vite and Lit
    • Angular 19 (Webpack)
      Analog
    • React CRA
    • React Native and Expo
    • Express.js
      NestJS
      Fastify
      Hono
      Adonis
    • Lynx and React
    Plugins
    • JSON
    • gettext (.po)
    VS Code Extension
    Agent
    • MCP Server
    • Agent skills
    Releases
    • v8
    • v7
    • v6
    Benchmark
    • Next.js
    • TanStack
    • Vue
    • Solid
    • Svelte
    Blog
    Ask a question
    1. Documentation
    2. Concept
    3. CLI
    4. Fill
    Creation:2024-08-11Last update:2025-11-22
    Reference this doc to your favorite AI assistant
    ChatGPT
    Claude
    DeepSeek
    Google AI mode
    Gemini
    Perplexity
    Mistral
    Grok

    Ask your question and get a summary of the document by referencing this page and the AI provider of your choice

    Edit this doc

    If you have an idea for improving this documentation, please feel free to contribute by submitting a pull request on GitHub.

    GitHub link to the documentation
    Copy

    Copy doc Markdown to clipboard

    Fill / audit / translate dictionaries

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer fill

    This command analyzes your content declaration files for potential issues such as missing translations, structural inconsistencies, or type mismatches. If it finds any problems, intlayer fill will propose or apply updates to keep your dictionaries consistent and complete.

    Key Points:

    • Splits large JSON files into chunks to stay within the AI model's context window limits.
    • Retries translation if the output format is incorrect.
    • Incorporates application and file-specific context for improved translation accuracy.
    • Preserves existing translations by not overwriting them.
    • Processes files, chunks, and locales in parallel using a queue system to increase speed.

    Aliases:

    • npx intlayer dictionaries fill
    • npx intlayer dictionary fill
    • npx intlayer dic fill

    Examples of output:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer fillPreparing Intlayer (v7.5.14)Done 76ms@intlayer/ai found - Run process locallyProvider: (default) - Model: (default) - API Key: ✓Affected dictionary keys for processing: app, comp-test, hello-world, lang-switcher - [comp-test]      No locales to fill, Skipping comp-test.content.json - [app]            Processing app.content.tsx - [app]            Filling missing metadata for app.content.tsx - [hello-world]    Processing test.content.ts - [hello-world]   [French (fr)]      Preparing test.content.ts - [hello-world]   [Spanish (es)]     Preparing test.content.ts - [lang-switcher]  Processing langSwitcher.content.ts - [lang-switcher]  Filling missing metadata for langSwitcher.content.ts - [hello-world]    Translation completed successfully for test.content.ts - [lang-switcher] [Spanish (es)]     Preparing langSwitcher.content.ts - [app]           [French (fr)]      Preparing app.content.tsx - [app]           [Spanish (es)]     Preparing app.content.tsx - [hello-world]    Content declaration written to test.content.ts - [app]            Translation completed successfully for app.content.tsx - [app]            Content declaration written to app.content.tsx - [lang-switcher]  Translation completed successfully for langSwitcher.content.ts - [lang-switcher]  Content declaration written to langSwitcher.content.ts

    Arguments:

    Files list options:

    • -f, --file [files...]: A list of specific content declaration files to audit. If not provided, all discovered *.content.{ts,js,mjs,cjs,tsx,jsx,json} based on your configuration file setup will be audited.

      Example: npx intlayer dictionary fill -f src/home/app.content.ts
    • -k, --keys [keys...]: Filter dictionaries based on keys. If not provided, all dictionaries will be audited.

      Example: npx intlayer dictionary fill -k key1 key2
    • --key [keys...]: Filter dictionaries based on keys (alias for --keys).

      Example: npx intlayer dictionary fill --key key1 key2
    • --excluded-keys [excludedKeys...]: Filter out dictionaries based on keys. If not provided, all dictionaries will be audited.

      Example: npx intlayer dictionary fill --excluded-keys key1 key2
    • --excluded-key [excludedKeys...]: Filter out dictionaries based on keys (alias for --excluded-keys).

      Example: npx intlayer dictionary fill --excluded-key key1 key2
    • --path-filter [pathFilters...]: Filter dictionaries based on glob pattern for file paths.

      Example: npx intlayer dictionary fill --path-filter "src/home/**"

    Entry output options:

    • --source-locale [sourceLocale]: The source locale to translate from. If not specified, the default locale from your configuration will be used.

    • --output-locales [outputLocales...]: Target locales to translate to. If not specified, all locales from your configuration will be used except the source locale.

    • --mode [mode]: Translation mode: complete, review. Default is complete. complete will fill all missing content, review will fill missing content and review existing keys.

    Git options:

    • --git-diff: Only run on dictionaries that includes changes from base (default origin/main) to current branch (default: HEAD).
    • --git-diff-base: Specify the base reference for git diff (default origin/main).
    • --git-diff-current: Specify the current reference for git diff (default: HEAD).
    • --uncommitted: Include uncommitted changes.
    • --unpushed: Include unpushed changes.
    • --untracked: Include untracked files.

      Example: npx intlayer doc translate --git-diff --git-diff-base origin/main --git-diff-current HEAD
      Example: npx intlayer doc translate --uncommitted --unpushed --untracked

    AI options:

    • --model [model]: The AI model to use for the translation (e.g., gpt-3.5-turbo).
    • --provider [provider]: The AI provider to use for the translation.
    • --temperature [temperature]: Temperature setting for the AI model.
    • --api-key [apiKey]: Provide your own API key for the AI service.
    • --custom-prompt [prompt]: Provide a custom prompt for your translation instructions.
    • --application-context [applicationContext]: Provide additional context for the AI translation.
    • --data-serialization [dataSerialization]: The data serialization format to use for the AI features of Intlayer. Options: json (standard, reliable), toon (fewer tokens, less consistent).

      Example: npx intlayer fill --model gpt-3.5-turbo --provider openai --temperature 0.5 --api-key sk-1234567890 --application-context "My application is a cat store"

    Environment variables options:

    • --env: Specify the environment (e.g., development, production).
    • --env-file [envFile]: Provide a custom environment file to load variables from.

      Example: npx intlayer fill --env-file .env.production.local
      Example: npx intlayer fill --env production

    Configuration options:

    • --base-dir: Specify the base directory for the project.

      Example: npx intlayer fill --base-dir ./src
    • --no-cache: Disable the cache.

      Example: npx intlayer build --no-cache

    Preparation options:

    • --build: Build the dictionaries before pushing to ensure the content is up to date. True will force the build, false will skip the build, undefined will allow using the cache of the build.

    • --skip-metadata: Skip filling missing metadata (description, title, tags) for dictionaries.

    Log options:

    • --verbose: Enable verbose logging for debugging. (default to true using CLI)

    Example:

    bash
    Copy code

    Copy the code to the clipboard

    npx intlayer fill --file src/home/*.content.ts --source-locale en --output-locales fr es --model gpt-3.5-turbo

    This command will translate content from English to French and Spanish for all content declaration files in the src/home/ directory using the GPT-3.5 Turbo model.

    Test
    Build
    Alt+→

    In this page

      Discussions are anonymous and regularly reviewed to address common issues. Feel free to share feature ideas, feedback on the documentation, or anything related to Intlayer, we use this input to shape our roadmap and improve the product.

      npx intlayer fill
      npx intlayer fillPreparing Intlayer (v7.5.14)Done 76ms@intlayer/ai found - Run process locallyProvider: (default) - Model: (default) - API Key: ✓Affected dictionary keys for processing: app, comp-test, hello-world, lang-switcher - [comp-test]      No locales to fill, Skipping comp-test.content.json - [app]            Processing app.content.tsx - [app]            Filling missing metadata for app.content.tsx - [hello-world]    Processing test.content.ts - [hello-world]   [French (fr)]      Preparing test.content.ts - [hello-world]   [Spanish (es)]     Preparing test.content.ts - [lang-switcher]  Processing langSwitcher.content.ts - [lang-switcher]  Filling missing metadata for langSwitcher.content.ts - [hello-world]    Translation completed successfully for test.content.ts - [lang-switcher] [Spanish (es)]     Preparing langSwitcher.content.ts - [app]           [French (fr)]      Preparing app.content.tsx - [app]           [Spanish (es)]     Preparing app.content.tsx - [hello-world]    Content declaration written to test.content.ts - [app]            Translation completed successfully for app.content.tsx - [app]            Content declaration written to app.content.tsx - [lang-switcher]  Translation completed successfully for langSwitcher.content.ts - [lang-switcher]  Content declaration written to langSwitcher.content.ts
      npx intlayer fill --file src/home/*.content.ts --source-locale en --output-locales fr es --model gpt-3.5-turbo