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. CI/CD Integration
    Creation:2025-05-20Last update:2025-08-13
    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

    Version History

    1. "Init history"
      v5.5.106/29/2025
    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

    Auto-Generate Translations in a CI/CD Pipeline

    Intlayer allows the automatic generation of translations for your content declaration files. There are multiple ways to achieve this depending on your workflow.

    Table of Contents

    Using the CMS

    With Intlayer, you can adopt a workflow where only a single locale is declared locally, while all translations are managed remotely through the CMS. This allows content and translations to be completely detached from the codebase, offering more flexibility for content editors and enabling Live Sync (no need to rebuild the application to apply changes).

    Example Configuration

    intlayer.config.ts
    Copy code

    Copy the code to the clipboard

    import { Locales, type IntlayerConfig } from "intlayer";const config: IntlayerConfig = {  internationalization: {    locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],    requiredLocales: [Locales.ENGLISH], // Optional locales will be managed remotely    defaultLocale: Locales.ENGLISH,  },  editor: {    // CMS credentials if you use the CMS    clientId: process.env.INTLAYER_CLIENT_ID,    clientSecret: process.env.INTLAYER_CLIENT_SECRET,    liveSync: true,  },  ai: {    applicationContext: "This is a test application", // Helps ensure consistent translation generation  },};export default config;

    To learn more about the CMS, refer to the official documentation.

    Using Husky

    You can integrate translation generation into your local Git workflow using Husky.

    Example Configuration

    intlayer.config.ts
    Copy code

    Copy the code to the clipboard

    import { Locales, type IntlayerConfig } from "intlayer";const config: IntlayerConfig = {  internationalization: {    locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],    requiredLocales: [Locales.ENGLISH], // Optional locales are handled remotely    defaultLocale: Locales.ENGLISH,  },  editor: {    clientId: process.env.INTLAYER_CLIENT_ID,    clientSecret: process.env.INTLAYER_CLIENT_SECRET,  },  ai: {    provider: "openai",    apiKey: process.env.OPENAI_API_KEY, // Use your own API key    applicationContext: "This is a test application", // Helps ensure consistent translation generation  },};export default config;
    .husky/pre-push
    Copy code

    Copy the code to the clipboard

    npx intlayer build                          # To ensure dictionaries are up to datenpx intlayer fill --unpushed --mode fill    # Only fill missing content, does not update existing ones
    For more information about Intlayer CLI commands and their usage, refer to the CLI documentation.
    If you have multiple apps in your repo using separate intlayer instances, you can use the --base-dir argument like this:
    .husky/pre-push
    Copy code

    Copy the code to the clipboard

    # App 1npx intlayer build --base-dir ./app1npx intlayer fill --base-dir ./app1 --unpushed --mode fill# App 2npx intlayer build --base-dir ./app2npx intlayer fill --base-dir ./app2 --unpushed --mode fill

    Using GitHub Actions

    Intlayer provides a CLI command to autofill and review dictionary content. This can be integrated into your CI/CD workflow using GitHub Actions.

    .github/workflows/intlayer-translate.yml
    Copy code

    Copy the code to the clipboard

    name: Intlayer Auto-Fill# Trigger conditions for this workflowon:  pull_request:    branches:      - "main"permissions:  contents: write  pull-requests: writeconcurrency:  group: "autofill-${{ github.ref }}"  cancel-in-progress: truejobs:  autofill:    runs-on: ubuntu-latest    env:      # OpenAI      AI_MODEL: openai      AI_PROVIDER: gpt-5-mini      AI_API_KEY: ${{ secrets.AI_API_KEY }}    steps:      # Step 1: Get the latest code from the repository      - name: ⬇️ Checkout repository        uses: actions/checkout@v4        with:          persist-credentials: true # Keep credentials for creating PRs          fetch-depth: 0 # Get full git history for diff analysis      # Step 2: Set up Node.js environment      - name: 🟢 Set up Node.js        uses: actions/setup-node@v4        with:          node-version: 20 # Use Node.js 20 LTS for stability      # Step 3: Install project dependencies      - name: 📦 Install dependencies        run: npm install      # Step 4: Install Intlayer CLI globally for translation management      - name: 📦 Install Intlayer        run: npm install -g intlayer-cli      # Step 5: Build the Intlayer project to generate translation files      - name: ⚙️ Build Intlayer project        run: npx intlayer build      # Step 6: Use AI to automatically fill missing translations      - name: 🤖 Auto-fill missing translations        run: npx intlayer fill --git-diff --mode fill --provider $AI_PROVIDER --model $AI_MODEL --api-key $AI_API_KEY      # Step 7: Check if there are changes and commit them      - name: � Check for changes        id: check-changes        run: |          if [ -n "$(git status --porcelain)" ]; then            echo "has-changes=true" >> $GITHUB_OUTPUT          else            echo "has-changes=false" >> $GITHUB_OUTPUT          fi      # Step 8: Commit and push changes if any exist      - name: 📤 Commit and push changes        if: steps.check-changes.outputs.has-changes == 'true'        run: |          git config --local user.email "[email protected]"          git config --local user.name "GitHub Action"          git add .          git commit -m "chore: auto-fill missing translations [skip ci]"          git push origin HEAD:${{ github.head_ref }}

    To set up the environment variables, go to GitHub → Settings → Secrets and variables → Actions and add the secret .

    Same as for Husky, in the case of a monorepo, you can use the --base-dir argument to sequentially treat each app.
    By default, the --git-diff argument filters dictionaries that include changes from base (default origin/main) to current branch (default: HEAD).
    For more information about Intlayer CLI commands and their usage, refer to the CLI documentation.
    CMS
    Content Declaration
    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.

      import { Locales, type IntlayerConfig } from "intlayer";const config: IntlayerConfig = {  internationalization: {    locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],    requiredLocales: [Locales.ENGLISH], // Optional locales will be managed remotely    defaultLocale: Locales.ENGLISH,  },  editor: {    // CMS credentials if you use the CMS    clientId: process.env.INTLAYER_CLIENT_ID,    clientSecret: process.env.INTLAYER_CLIENT_SECRET,    liveSync: true,  },  ai: {    applicationContext: "This is a test application", // Helps ensure consistent translation generation  },};export default config;
      import { Locales, type IntlayerConfig } from "intlayer";const config: IntlayerConfig = {  internationalization: {    locales: [Locales.ENGLISH, Locales.SPANISH, Locales.FRENCH],    requiredLocales: [Locales.ENGLISH], // Optional locales are handled remotely    defaultLocale: Locales.ENGLISH,  },  editor: {    clientId: process.env.INTLAYER_CLIENT_ID,    clientSecret: process.env.INTLAYER_CLIENT_SECRET,  },  ai: {    provider: "openai",    apiKey: process.env.OPENAI_API_KEY, // Use your own API key    applicationContext: "This is a test application", // Helps ensure consistent translation generation  },};export default config;
      npx intlayer build                          # To ensure dictionaries are up to datenpx intlayer fill --unpushed --mode fill    # Only fill missing content, does not update existing ones
      # App 1npx intlayer build --base-dir ./app1npx intlayer fill --base-dir ./app1 --unpushed --mode fill# App 2npx intlayer build --base-dir ./app2npx intlayer fill --base-dir ./app2 --unpushed --mode fill
      name: Intlayer Auto-Fill# Trigger conditions for this workflowon:  pull_request:    branches:      - "main"permissions:  contents: write  pull-requests: writeconcurrency:  group: "autofill-${{ github.ref }}"  cancel-in-progress: truejobs:  autofill:    runs-on: ubuntu-latest    env:      # OpenAI      AI_MODEL: openai      AI_PROVIDER: gpt-5-mini      AI_API_KEY: ${{ secrets.AI_API_KEY }}    steps:      # Step 1: Get the latest code from the repository      - name: ⬇️ Checkout repository        uses: actions/checkout@v4        with:          persist-credentials: true # Keep credentials for creating PRs          fetch-depth: 0 # Get full git history for diff analysis      # Step 2: Set up Node.js environment      - name: 🟢 Set up Node.js        uses: actions/setup-node@v4        with:          node-version: 20 # Use Node.js 20 LTS for stability      # Step 3: Install project dependencies      - name: 📦 Install dependencies        run: npm install      # Step 4: Install Intlayer CLI globally for translation management      - name: 📦 Install Intlayer        run: npm install -g intlayer-cli      # Step 5: Build the Intlayer project to generate translation files      - name: ⚙️ Build Intlayer project        run: npx intlayer build      # Step 6: Use AI to automatically fill missing translations      - name: 🤖 Auto-fill missing translations        run: npx intlayer fill --git-diff --mode fill --provider $AI_PROVIDER --model $AI_MODEL --api-key $AI_API_KEY      # Step 7: Check if there are changes and commit them      - name: � Check for changes        id: check-changes        run: |          if [ -n "$(git status --porcelain)" ]; then            echo "has-changes=true" >> $GITHUB_OUTPUT          else            echo "has-changes=false" >> $GITHUB_OUTPUT          fi      # Step 8: Commit and push changes if any exist      - name: 📤 Commit and push changes        if: steps.check-changes.outputs.has-changes == 'true'        run: |          git config --local user.email "[email protected]"          git config --local user.name "GitHub Action"          git add .          git commit -m "chore: auto-fill missing translations [skip ci]"          git push origin HEAD:${{ github.head_ref }}