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>
3.9 KiB
Contributing to Scarf
Thanks for your interest in contributing to Scarf.
Getting Started
- Fork and clone the repo
- Open
scarf/scarf.xcodeprojin Xcode 26.3+ - Build and run (requires macOS 26.2+ and Hermes installed at
~/.hermes/)
Architecture
Scarf uses the MVVM-Feature pattern. Each feature is a self-contained module under Features/:
Features/FeatureName/
Views/ SwiftUI views
ViewModels/ @Observable view models
Rules:
- Features never import sibling features directly
- Cross-feature navigation goes through
AppCoordinator - Services in
Core/Services/are shared across features - Models in
Core/Models/are plain structs
Guidelines
- Keep it simple. Minimal dependencies, no over-engineering.
- No commented-out code, TODOs, or deferred functionality in PRs.
- All code must build with zero warnings.
- Follow existing patterns — look at how similar features are built before adding new ones.
- The app only reads from
~/.hermes/state.db(never writes). Memory files are the exception. - Swift 6 strict concurrency:
@MainActordefault isolation,nonisolatedfor service methods.
Documentation
Public docs live in the GitHub wiki. Small fixes (typos, clarifications) can be made via the "Edit" button on any wiki page — you need push access to the main repo. For larger changes, clone the wiki locally (git clone git@github.com:awizemann/scarf.wiki.git) or open an issue describing the proposed change.
Adding a Language
Scarf ships with English + Simplified Chinese, German, French, Spanish, Japanese, and Brazilian Portuguese. To add another locale (or improve an existing one):
- Fork the repo and create a branch.
- Add the locale to
knownRegionsinscarf/scarf.xcodeproj/project.pbxproj— follow the existing list (e.g. additafter"pt-BR"). - Drop a new JSON file at
tools/translations/<locale>.json— copy an existing one (saytools/translations/es.json) as a starting point. Each entry maps the English source string to your translation. Keys you omit fall back to English at runtime — do that for proper nouns (Scarf, Hermes, Anthropic, OAuth, SSH, …) and for anything technical that shouldn't translate. - Preserve format specifiers exactly:
%@,%lld,%d, positional%1$@/%2$lld, etc. If word order needs to change in your language, use positional forms (%1$@ … %2$@). - Add your locale to
tools/merge-translations.py'sLOCALESlist and runpython3 tools/merge-translations.py— this writes your translations intoscarf/scarf/Localizable.xcstrings. - Translate
scarf/scarf/InfoPlist.xcstrings(the macOS microphone-permission prompt) for your locale. Add a newstringUnitunderlocalizations. - Build (
xcodebuild -project scarf/scarf.xcodeproj -scheme scarf build) and sanity-check in Xcode: Scheme → Run → App Language → your locale. Walk the main views (Dashboard, Chat, Settings) and look for clipping or obvious leaks. - Open a PR including the new JSON file, the updated catalog, and the pbxproj / script changes. Mention which routes you spot-checked.
AI translation is fine for the first pass — it's how the initial six locales landed. Native-speaker review improves quality and is always welcome, either as a follow-up PR or as review comments on the initial one.
See scarf/docs/I18N.md for deeper context on the String Catalog setup and which strings are intentionally kept verbatim.
Reporting Issues
Open an issue with:
- What you expected to happen
- What actually happened
- macOS version and Hermes version
- Steps to reproduce
Pull Requests
- Open an issue first to discuss the change
- One feature or fix per PR
- Include a clear description of what changed and why
- Ensure the project builds with
xcodebuild -project scarf/scarf.xcodeproj -scheme scarf build