> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prismy.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring Files to Sync with Prismy

<Note>
  Prismy allows you to configure which localization files to sync by simply
  adding a `prismy.json` file at the root of your repository. This configuration
  file lets you define the main branch, primary language, and the specific files
  you want to synchronize.
</Note>

# Example Configurations

### Nested JSON Format with Alphabetical Sorting

```json theme={null}
{
  "mainBranch": "main",
  "mainLanguage": "en-US",
  "filesToSync": [
    {
      "sort": "alphabetical-order", // "alphabetical-order" | "not-sorted"
      "format": "nested-json", // "flat-json" | "nested-json"
      "i18nLib": "next-intl", // "i18next" | "polyglotjs" | any other i18n lib
      "files": {
        "en-US": ["lib/i18n/messages/en/*"],
        "fr-FR": ["lib/i18n/messages/fr/*"]
      }
    }
  ]
}
```

### Flat JSON Format Without Sorting

```json theme={null}
{
  "mainBranch": "main",
  "mainLanguage": "en-US",
  "filesToSync": [
    {
      "sort": "not-sorted", // "alphabetical-order" | "not-sorted"
      "format": "flat-json", // "flat-json" | "nested-json"
      "files": {
        "en-US": ["lib/i18n/home/en.json", "lib/i18n/settings/en.json"],
        "fr-FR": ["lib/i18n/messages/fr.json", "lib/i18n/settings/fr.json"]
      }
    }
  ]
}
```

### Auto-Filling Missing Translation Files

Set `fillMissingLangFiles: true` to automatically track the same files across all languages, even if they don't exist yet.

```json theme={null}
{
  "mainBranch": "main",
  "mainLanguage": "en-US",
  "filesToSync": [
    {
      "sort": "alphabetical-order",
      "format": "nested-json",
      "fillMissingLangFiles": true,
      "files": {
        "en-US": ["locales/en/home.json", "locales/en/settings.json"],
        "fr-FR": ["locales/fr/home.json"],
        "es-ES": ["locales/es/settings.json"]
      }
    }
  ]
}
```

**Result:** Prismy will track all three files for each language:

* `en-US`: `home.json`, `settings.json`
* `fr-FR`: `home.json`, `settings.json` ← auto-added
* `es-ES`: `home.json` ← auto-added, `settings.json`

**Use this when:**

* Adding new translation files that should exist for all languages
* Working with glob patterns to ensure consistency across languages
* You want Prismy to detect missing translations even if the file doesn't exist yet

<Note>Currently supported for GitHub only. GitLab support coming soon.</Note>

# Configuration Options

* **`mainBranch`**: The default branch for Prismy (can be staging or preprod).
* **`mainLanguage`**: The source language for translations.
* **`filesToSync`**: Array of file groups to sync. Each group supports:
  * **`sort`**: How keys are organized - `alphabetical-order` or `not-sorted`.
  * **`format`**: File structure - `flat-json` (key-value pairs) or `nested-json` (hierarchical).
  * **`i18nLib`**: Your i18n library (e.g., `i18next`, `polyglotjs`, `react-intl`) for proper pluralization handling.
  * **`fillMissingLangFiles`**: When `true`, automatically tracks the same files across all languages, creating placeholders for missing ones. (GitHub only)
  * **`files`**: Language codes mapped to file paths (supports glob patterns like `locales/*/home.json`).
