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

# Supported File Formats

> Entri supports a wide range of localization file formats.

Entri supports ten localization file formats covering web, mobile, and desktop platforms. You configure the format per file pattern in your `.nt3.yml` file.

## Format overview

| Format identifier | Extension      | Platform / use case           |
| ----------------- | -------------- | ----------------------------- |
| `json-flat`       | `.json`        | Web — simple flat key-value   |
| `json-nested`     | `.json`        | Web — nested object structure |
| `yaml`            | `.yaml`        | Web / Ruby on Rails           |
| `po`              | `.po`          | GNU gettext (Linux, web)      |
| `xliff`           | `.xlf`         | Industry standard XLIFF 1.2   |
| `xliff2`          | `.xlf`         | Industry standard XLIFF 2.0   |
| `arb`             | `.arb`         | Flutter / Dart                |
| `android-xml`     | `.xml`         | Android                       |
| `ios-strings`     | `.strings`     | iOS / macOS                   |
| `ios-stringsdict` | `.stringsdict` | iOS / macOS (plurals)         |

## Format examples

<Tabs>
  <Tab title="json-flat">
    Flat key-value JSON. All keys live at the root level of the object.

    ```json theme={null}
    {
      "welcome_message": "Welcome to Entri",
      "button_save": "Save",
      "button_cancel": "Cancel",
      "error_not_found": "Page not found"
    }
    ```

    Recommended for simple projects or tools that don't support nested keys.
  </Tab>

  <Tab title="json-nested">
    Nested JSON objects. Keys are grouped into sections using dot-notation paths.

    ```json theme={null}
    {
      "common": {
        "save": "Save",
        "cancel": "Cancel"
      },
      "auth": {
        "login": "Log in",
        "logout": "Log out",
        "welcome": "Welcome, {{name}}"
      },
      "errors": {
        "not_found": "Page not found",
        "server_error": "Something went wrong"
      }
    }
    ```
  </Tab>

  <Tab title="yaml">
    YAML key-value format. Common in Ruby on Rails applications.

    ```yaml theme={null}
    en:
      common:
        save: Save
        cancel: Cancel
      auth:
        login: Log in
        logout: Log out
        welcome: "Welcome, %{name}"
      errors:
        not_found: Page not found
    ```
  </Tab>

  <Tab title="po">
    GNU gettext PO format. Widely used in open-source and Linux applications.

    ```po theme={null}
    # Entri — French translations
    msgid ""
    msgstr ""
    "Content-Type: text/plain; charset=UTF-8\n"
    "Language: fr\n"

    msgid "welcome_message"
    msgstr "Bienvenue sur Entri"

    msgid "button_save"
    msgstr "Enregistrer"

    msgid "button_cancel"
    msgstr "Annuler"
    ```
  </Tab>

  <Tab title="xliff">
    XLIFF 1.2 — the industry-standard XML-based interchange format, compatible with most professional CAT tools.

    ```xml theme={null}
    <?xml version="1.0" encoding="UTF-8"?>
    <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
      <file source-language="en" target-language="fr" datatype="plaintext">
        <body>
          <trans-unit id="welcome_message">
            <source>Welcome to Entri</source>
            <target>Bienvenue sur Entri</target>
          </trans-unit>
          <trans-unit id="button_save">
            <source>Save</source>
            <target>Enregistrer</target>
          </trans-unit>
        </body>
      </file>
    </xliff>
    ```
  </Tab>

  <Tab title="arb">
    Application Resource Bundle — the Flutter/Dart localization format.

    ```json theme={null}
    {
      "@@locale": "en",
      "welcomeMessage": "Welcome to Entri",
      "@welcomeMessage": {
        "description": "Shown on the home screen"
      },
      "buttonSave": "Save",
      "@buttonSave": {},
      "itemCount": "{count, plural, one{{count} item} other{{count} items}}",
      "@itemCount": {
        "placeholders": {
          "count": { "type": "int" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="android-xml">
    Android string resources XML format.

    ```xml theme={null}
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
        <string name="welcome_message">Welcome to Entri</string>
        <string name="button_save">Save</string>
        <string name="button_cancel">Cancel</string>
        <plurals name="item_count">
            <item quantity="one">%d item</item>
            <item quantity="other">%d items</item>
        </plurals>
    </resources>
    ```
  </Tab>

  <Tab title="ios-strings">
    iOS/macOS `Localizable.strings` format — simple key = "value" pairs.

    ```
    /* Home screen greeting */
    "welcome_message" = "Welcome to Entri";

    /* Button labels */
    "button_save" = "Save";
    "button_cancel" = "Cancel";

    /* Error messages */
    "error_not_found" = "Page not found";
    ```
  </Tab>
</Tabs>

## Configuring formats in `.nt3.yml`

Specify the format for each file pattern using the `format` key:

```yaml theme={null}
project_id: "proj_abc123"
source_language: en
file_patterns:
  - path: "src/locales/{lang}.json"
    format: json-nested
```

The `{lang}` placeholder is replaced with the language code (e.g., `en`, `fr`, `de`) when reading and writing files.

## Multiple patterns

You can mix formats within the same project by listing multiple patterns:

```yaml theme={null}
project_id: "proj_abc123"
source_language: en
file_patterns:
  - path: "src/locales/{lang}/app.json"
    format: json-nested
  - path: "src/locales/{lang}/marketing.po"
    format: po
```

<Tip>
  Each pattern maps to a separate namespace in Entri, allowing you to manage files by feature or team independently.
</Tip>

## Platform recommendations

| You are building...               | Recommended format                              |
| --------------------------------- | ----------------------------------------------- |
| React / Vue / Angular app         | `json-nested` or `json-flat`                    |
| Ruby on Rails app                 | `yaml`                                          |
| Android app                       | `android-xml`                                   |
| iOS / macOS app                   | `ios-strings` (+ `ios-stringsdict` for plurals) |
| Flutter app                       | `arb`                                           |
| Working with a translation agency | `xliff` or `xliff2`                             |
| GNU/Linux or gettext project      | `po`                                            |
