mirror of
https://github.com/awizemann/scarf.git
synced 2026-05-10 18:44:45 +00:00
feat(i18n): add translations for zh-Hans, de, fr, es, ja, pt-BR
Ships first-pass AI translations for six locales on top of the existing English base, plus a simple JSON-per-locale contributor workflow so new languages can land as a single PR. - 518 keys translated per locale (proper nouns / brand names / format- only strings left to fall back to English by design — see the "Non-blocking (intentional verbatim)" section of scarf/docs/I18N.md). - Per-locale source-of-truth lives in tools/translations/<locale>.json; tools/merge-translations.py writes them into Localizable.xcstrings and is idempotent (re-runnable as translators iterate). - InfoPlist.xcstrings (macOS microphone permission prompt) translated for all six locales. - knownRegions expanded: zh-Hans, de, fr now join by es, ja, pt-BR. - CONTRIBUTING.md gains an "Adding a Language" section documenting the fork → JSON → merge → PR flow. Native-speaker reviews welcome. Closes #13 (the original ask: Simplified Chinese support). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-3
@@ -7,12 +7,27 @@ Scarf uses Apple's modern **String Catalog** workflow. Source strings are auto-e
|
||||
| Locale | Status |
|
||||
|---|---|
|
||||
| `en` (English) | Base / source |
|
||||
| `zh-Hans` (Simplified Chinese) | Region enabled, translations pending |
|
||||
| `de` (German) | Region enabled, translations pending |
|
||||
| `fr` (French) | Region enabled, translations pending |
|
||||
| `zh-Hans` (Simplified Chinese) | AI-translated, native-speaker review welcome |
|
||||
| `de` (German) | AI-translated, native-speaker review welcome |
|
||||
| `fr` (French) | AI-translated, native-speaker review welcome |
|
||||
| `es` (Spanish) | AI-translated, native-speaker review welcome |
|
||||
| `ja` (Japanese) | AI-translated, native-speaker review welcome |
|
||||
| `pt-BR` (Portuguese, Brazil) | AI-translated, native-speaker review welcome |
|
||||
|
||||
Canadian French users are served by base `fr`. `fr-CA` will be added only if a concrete Québec-specific bug is reported.
|
||||
|
||||
### Translation workflow
|
||||
|
||||
Source-of-truth per locale lives in `tools/translations/<locale>.json` — a flat `{ "English": "Translation" }` map. The merge step writes those into `scarf/scarf/Localizable.xcstrings` via:
|
||||
|
||||
```bash
|
||||
python3 tools/merge-translations.py
|
||||
```
|
||||
|
||||
Keys absent from a locale file fall back to English at runtime — this is deliberate for proper nouns (Scarf, Hermes, Anthropic, OAuth, SSH…) and format-only strings (`%lld`, `%@ → %@`, `•`). Re-running the merge is idempotent; iterate on a JSON and re-merge.
|
||||
|
||||
Contributor path for new languages is documented in the repo root [CONTRIBUTING.md](../../CONTRIBUTING.md#adding-a-language).
|
||||
|
||||
## Adding a new language
|
||||
|
||||
1. Xcode → Project → Info → Localizations → `+` (add locale).
|
||||
|
||||
Reference in New Issue
Block a user