---
source: https://studio.eloqnt.dev/docs/formats/android-xml
docs_index: https://studio.eloqnt.dev/llms.txt
---

# Android XML

Translate Android string resources (strings.xml) across res/values folders.

Android apps store their strings as XML resources, with the default language in `res/values/strings.xml` and one `res/values-<code>/` folder per additional language.

Install the format package:

```bash
npm install -D @eloqnt/format-android-xml
```

Then reference it from your configuration:

```ts title=".eloqnt/config.ts"
import {defineConfig} from '@eloqnt/cli';

export default defineConfig({
  messages: {
    path: {
      source: './app/src/main/res/values/strings',
      targets: './app/src/main/res/values-{code}/strings'
    },
    locales: ['de', 'de-AT', 'es-419'],
    sourceLocale: 'en',
    codes: {
      'de-AT': 'de-rAT',
      'es-419': 'b+es+419'
    },
    format: {
      codec: '@eloqnt/format-android-xml',
      extension: '.xml'
    }
  }
});
```

Two things are specific to Android's folder layout:

- **The source language has no locale marker.** Android keeps the default language in the bare `values/` folder, so `path` splits into a `source` path and a `targets` template.
- **Folder names use Android's own locale syntax**, mapped via `codes` for the `{code}` placeholder while `locales` keeps the real tags.

This resolves to:

- `./app/src/main/res/values/strings.xml` (source)
- `./app/src/main/res/values-de/strings.xml` (no code mapping)
- `./app/src/main/res/values-de-rAT/strings.xml` (mapped)
- `./app/src/main/res/values-b+es+419/strings.xml` (mapped)

## Plurals

Quantity strings appear as ICU messages in eloqnt, named after the resource:

```xml title="res/values/strings.xml"
<plurals name="notes_count">
    <item quantity="one">%d note</item>
    <item quantity="other">%d notes</item>
</plurals>
```

The resource above reads as `{notes_count, plural, one {%d note} other {%d notes}}` in lint output and during translation.

## Not supported

The following features are not supported:

- `<string-array>` elements: Their items are positional and unnamed, which is why most localization tools can't translate them reliably. To solve this, give each item its own `<string>` and reference those from the array via `@string/…`.
- [`srcPath`](https://studio.eloqnt.dev/docs/configuration#srcPath): Source code analysis is currently limited to `next-intl`.

---

For an index of every eloqnt/studio documentation page, see [https://studio.eloqnt.dev/llms.txt](https://studio.eloqnt.dev/llms.txt).
