# App Localization

Part of the HebrewCore documentation. Web: https://hc.itsbaba.com/docs#solution-localization · Whole docs: https://hc.itsbaba.com/docs.md · Index: https://hc.itsbaba.com/llms.txt

String files for iOS, Android and the web, with interface variables intact and plurals rewritten for Hebrew and Russian. Translate at build time and ship the results with your app.

## What to Use

| Need | Use |
| --- | --- |
| Plurals and selects | `message_format: "icu"`, described in [ICU plurals](https://hc.itsbaba.com/docs#icu). |
| Many strings at once | `/v1/translate/batch`, one message per item, up to 50 per call. |
| Variables and markup | Kept automatically: `{name}`, `{{count}}`, `%s`, `%d`, and anything inside `<keep>…</keep>`. |
| Consistent product vocabulary | `glossary` and [account terms](https://hc.itsbaba.com/docs#terms). |
| Mixed-direction strings | `/v1/wrap` with `format: "isolate"` for iOS and Android, `html` for the web. |

## Example

```http
POST /v1/translate/batch
{
  "items": [
    "{count, plural, one {# new message} other {# new messages}}",
    "{days, plural, one {Your trial ends in # day} other {Your trial ends in # days}}",
    "Welcome back, {name}!"
  ],
  "source_lang": "en",
  "target_lang": "he",
  "message_format": "icu",
  "glossary": { "trial": "תקופת ניסיון" }
}

{
  "results": [
    { "text": "{count, plural, one {# הודעה חדשה} two {# הודעות חדשות} other {# הודעות חדשות}}", … },
    { "text": "{days, plural, one {תקופת הניסיון מסתיימת בעוד # יום} two {תקופת הניסיון מסתיימת בעוד # ימים} other {תקופת הניסיון מסתיימת בעוד # ימים}}", … },
    { "text": "ברוך שובך, {name}!", … }
  ],
  "usage": { "characters": 146 }
}
```

## Pitfalls

- **Hebrew has a form for two.** A Hebrew string file without a `two` branch shows the wrong form for 2. Let `message_format: "icu"` add it.
- **Keys are not text.** Send only the values, never the string keys, and map results back by position.
- **Buttons and labels.** Without `listener_gender`, Hebrew labels use the neutral infinitive (להציג עוד), which is usually what an interface wants.
