ClamNotes records a class, transcribes it on the device and writes a study note in the language that was spoken. The speech models it runs cover 25 European languages, so the app speaks the same 25: the iPhone, iPad and Mac interfaces, the Live Activity, the Siri phrases, the permission prompts and the legal documents. I build it alone. The only way that stays true is a rule that makes forgetting impossible, and a script that enforces it.
The rule: one change, 25 languages
The repository's AGENTS.md says it plainly: every text shown in the app needs its translation in all 25 languages of Localizable.xcstrings in the same change, and the legal documents change in every language too. Not "we'll catch up before the release". The same change.
I wrote it that way because the alternative fails quietly. A missing translation in a String Catalog doesn't crash or warn at run time: the app shows the English key. On a Polish iPhone that is one English sentence in a Polish screen, and nobody who would notice is in the room. Catching it at the commit costs one command.
Those counts, and every other measurement in this post, are from the catalog as it stood on 20 October 2026, when I wrote it. By publication it had grown to more than 1,100 keys, and every one of them still had all 24 translations.
The 25 are Bulgarian, Croatian, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Latvian, Lithuanian, Maltese, Polish, Portuguese, Romanian, Russian, Slovak, Slovenian, Spanish, Swedish and Ukrainian. Three scripts (Latin, Greek, Cyrillic), no right-to-left language. The set was not chosen for the App Store: it is the set the on-device transcription supports, and an app that transcribes Maltese but greets you in English would be odd.
What lives in the catalogs
There is not one catalog but five, because each bundle that shows text needs its own and some system features insist on their own table names.
| Catalog | Keys | What it holds |
|---|---|---|
ClamNotes/Localizable.xcstrings | 701 | The app, shared by the iPhone, iPad and Mac targets |
LiveActivity/Localizable.xcstrings | 12 | The Lock Screen and Dynamic Island, a separate extension bundle |
AppIntents.xcstrings | 17 | Siri and Shortcuts: intent titles and parameters |
AppShortcuts.xcstrings | 8 | The spoken App Shortcut phrases |
InfoPlist.xcstrings | 5 | Display name, permission prompts, the document type's name |
The main catalog's English keys add up to 5,453 words. Seventeen keys are longer than 200 characters, the longest 547. Each key is the English text itself, which is SwiftUI's default: Text("Stop and write note") uses "Stop and write note" as both the key and the English value. That is convenient until you fix a comma in the English, at which point the key changes and the 24 translations of the old key are orphaned. The script below reports them as unused, and the new key as missing, which is exactly right: the translations should be looked at again.
Finding every string: .stringsdata and a script
Apple's documented workflow is to build in Xcode and let it populate the catalog. That works in the IDE. I mostly build from the command line with xcodebuild, for two schemes (ClamNotes and ClamNotesMac), and I wanted a check that runs there and fails loudly.
The piece that makes this possible is a build setting. With SWIFT_EMIT_LOC_STRINGS ("Use Compiler to Extract Swift Strings") on, the Swift compiler writes a .stringsdata file per source file into DerivedData (the reference documents STRINGSDATA_DIR as "the location to write .stringsdata files to"). Each is a small JSON file listing the localizable keys that file uses, grouped by table. The project generator sets it for the iPhone, Mac and Live Activity targets, and LOCALIZATION_PREFERS_STRING_CATALOGS for the project.
iOS/scripts/sync-strings.py reads those files for both targets, adds the keys it finds in the source by pattern (more on those below), and compares the union with the catalog:
# simplified
LANGUAGES = "bg cs da de el es et fi fr hr hu it lt lv mt nl pl pt ro ru sk sl sv uk".split()
def build_keys(folder):
keys = set()
# The iPhone app and the Mac app (ClamNotesMac), which share the catalog.
for target in ["ClamNotes", "ClamNotesMac"]:
pattern = os.path.join(folder, "Build/Intermediates.noindex/ClamNotes.build", "*",
f"{target}.build/Objects-normal/*/*.stringsdata")
for path in glob.glob(pattern):
data = json.load(open(path))
for entry in data.get("tables", {}).get("Localizable", []):
keys.add(entry["key"])
return keys
used = build_keys(folder) | source_keys()
have = set(catalog["strings"])
missing = sorted(used - have)
untranslated = sorted(key for key in used & have
if set(LANGUAGES) - set(catalog["strings"][key].get("localizations", {})))
unused = sorted(key for key in have - used if key not in literals)
if "--check" in sys.argv:
sys.exit(1 if missing or untranslated else 0)
Three outputs: keys the code uses that the catalog lacks, keys the catalog has that nothing uses, and keys present but missing a language. --check exits 1 on the first or third; --write adds the missing keys and drops the unused ones.
That last part answers a question that comes up a lot: how do you remove stale strings from a String Catalog? Xcode's own behavior, as described in Discover String Catalogs (WWDC23): a string removed from code is deleted from the catalog only if it has no translations; once it has some, Xcode leaves it and marks it Stale, for you to delete by hand. In a catalog where every string has 24 translations, that means nothing is ever cleaned up for you. The script deletes unused keys itself. It also writes new keys as manually managed ("extractionState": "manual"), which the same session describes as strings Xcode "will never be updated or removed" during its own sync, so Xcode's own sync leaves them alone.
--check runs again at the end and must exit 0 before the change is done.One caveat: Apple documents where .stringsdata files go, not what is inside them. If Xcode changes the format, ten lines of the script change with it.
Strings the compiler can't see
Compiler extraction finds string literals passed to localizable types. SwiftUI's views take LocalizedStringKey, so Text("Record") is found. Anything that arrives as a plain String is not, and Apple's Text documentation says so directly: initialized with a variable, the view uses the StringProtocol initializer, "which doesn't localize the string". ClamNotes has four kinds of such text, and each needed a decision.
- Text chosen at run time. A failure stored on a note, a progress line from the transcription engine. These go through a tiny helper, and the script finds its call sites by regex.
- English from a Swift package.
NotesCorehas no resources and no catalog. Its enums return English (NoteSubject.titlereturns"Civics"), and the app looks that English up. The script collects everyreturn "…"inside apublic var titleornamein that package. - Per-device wording. "On this iPhone", "on this iPad", "on this Mac". Catalogs have Vary by Device for this; I used separate keys through
Device.string(iPhone:iPad:mac:), so every entry stays a plain string or a plural. The script matches the call and takes each argument as a key. - A web view's words. Interactive parts of a note are drawn by HTML and JavaScript. Their 81 words live in
strings.jsonin English; the app localizes the values with the same helper and passes them in. The script adds the file's values to the used keys.
/// Text chosen at run time (a stored failure, a model's progress) looked up in the app's
/// string catalog, so it shows in Hungarian on a Hungarian iPhone. Text written in a view
/// is looked up by SwiftUI itself.
func localized(_ english: String) -> String {
Bundle.main.localizedString(forKey: english, value: english, table: nil)
}
/// A catalog entry with `%@` or `%lld` in it, filled in.
func localized(_ english: String, _ arguments: CVarArg...) -> String {
String(format: localized(english), locale: Locale.current, arguments: arguments)
}
Passing the English as value matters: localizedString(forKey:value:table:) returns value when the key isn't found, so a gap degrades to English rather than to nothing.
The package convention bit me once. The rule "every title in NotesCore is a key" also matched two developer-only model names that are deliberately never translated and shown with Text(verbatim:). So --check exited 1 on every build, and a check that always fails is a check nobody reads. An audit on 11 October flagged it; the fix was renaming that property to developerName, outside the convention. If a gate is noisy, fix the noise first.
Plurals: 25 languages, seven shapes
Plural variants in a catalog follow the CLDR plural rules. English needs one and other. Across these 25 languages there are seven different sets:
| Categories | Languages |
|---|---|
| one, other | Bulgarian, Danish, Dutch, English, Estonian, Finnish, German, Greek, Hungarian, Swedish |
| one, many, other | French, Italian, Portuguese, Spanish |
| one, few, other | Croatian, Romanian |
| zero, one, other | Latvian |
| one, few, many, other | Czech, Lithuanian, Polish, Russian, Slovak, Ukrainian |
| one, two, few, other | Slovenian |
| one, two, few, many, other | Maltese |
The mechanics of a plural in a String Catalog are simple once you see them. Interpolate an integer in a localizable string, Text("\(count) notes"), and the key becomes "%lld notes". In the catalog editor, Control-click the key and choose Vary by Plural; Xcode then adds the categories each language needs (Apple's guide uses One, Few, Many and Other for Russian as its example). When translations arrive as files instead, they only need the same shape: an object of categories per language.
In ClamNotes, one plural string means 74 forms across the 25 languages. There are eight such strings in the main catalog (note counts, photo counts, "hours left", the words Claude is reading), each with every category of every language filled in. In the catalog JSON a Polish entry looks like this:
"%lld notes" : {
"localizations" : {
"pl" : {
"variations" : {
"plural" : {
"one" : { "stringUnit" : { "state" : "translated", "value" : "%lld notatka" } },
"few" : { "stringUnit" : { "state" : "translated", "value" : "%lld notatki" } },
"many" : { "stringUnit" : { "state" : "translated", "value" : "%lld notatek" } },
"other" : { "stringUnit" : { "state" : "translated", "value" : "%lld notatki" } }
}
}
}
}
}
Two things in that table surprised me. First, the names lie. Latvian zero is not about zero alone: CLDR puts 0, 10 to 20, 30, 40 and so on in it. My catalog uses the same word there as in other ("%lld piezīmes"). Whether that reads right for every number in the category is the first thing I would ask a Latvian reader.
Second, some categories never fire for a count. many in French, Italian, Portuguese and Spanish is for a million and up in compact form (CLDR's sample is "1 M de jours"); in Czech, Slovak and Lithuanian it is for decimals only. With an integer %lld of notes, those forms are filled in but never shown. They are filled in anyway. Note that my script only checks that a language is present for a key, not that it has every category; that is a gap worth closing.
At run time nothing special is needed. localized("~%lld hours left", hours) goes through String(format:locale:arguments:), and Foundation picks the form from the locale and the number.
Format specifiers and word order
Thirty-eight keys in the main catalog have %@ or %lld in them. Two kinds of mistakes are possible in a translation: a specifier that changes type or goes missing, which can crash or print garbage, and a sentence that only works in English word order.
The first is mechanical, so I check it mechanically. This is the check I ran over the catalog while writing this post; it found no mismatches, and 20 translations use positional specifiers (%1$@, %2$lld) to reorder their arguments.
# A minimal check: every translation keeps the key's specifiers (order aside).
import json, re
SPEC = re.compile(r"%(?:\d+\$)?(?:lld|ld|d|@|f)")
def specs(text):
return sorted(re.sub(r"\d+\$", "", s) for s in SPEC.findall(text))
catalog = json.load(open("iOS/ClamNotes/Localizable.xcstrings"))["strings"]
for key, entry in catalog.items():
for language, loc in entry.get("localizations", {}).items():
units = [loc["stringUnit"]] if "stringUnit" in loc else \
[form["stringUnit"] for form in loc["variations"]["plural"].values()]
for unit in units:
if specs(unit["value"]) != specs(key):
print(language, repr(key), "->", repr(unit["value"]))
The second kind needs a pattern rather than a script. The consent line used to be "I agree to the %@ and I have read the %@.", where each %@ was a link: "Terms of Use", "Privacy Policy". In Hungarian a document you accept takes an accusative ending, and the link text was a fixed, nominative title. Gluing a suffix onto a link doesn't work, so the Hungarian translation sidestepped the grammar with a colon: "Elfogadom a következőt: %@", roughly "I accept the following: %@". Since 24 October the sentence carries its links as Markdown instead, "I agree to the [Terms of Use](terms) and I have read the [Privacy Policy](privacy).", read with AttributedString(markdown:), so each language inflects the link text itself: "Elfogadom a [Felhasználási feltételeket](terms)". The app only swaps each link's target for the document. The renewal date in Settings, "Renews on %@", gets the same treatment in Hungarian, Estonian and Slovenian ("Megújul: november 9."), because the date would otherwise need a case ending the formatter doesn't produce.
When a placeholder stands for a noun, assume some language needs to inflect it. Put the noun inside the translatable sentence where you can (Markdown links make that possible for links), and where you can't, prefer a colon or a label-style sentence to a grammatically wrong one.
Length, truncation, scripts and fonts
Measured over the whole catalog, the longest translations run 23% longer than English (Greek), then French at 22% and German at 20%; Danish and Czech only 4%. Averages hide the problem, though. Short strings are where layouts break, and for the 298 keys of 15 characters or fewer, Greek averages 37% longer, Russian 31%, German and Lithuanian 30%. The record is a subject name: "Civics" becomes "Κοινωνική και Πολιτική Αγωγή", 4.7 times the length. Polish has "Wiedza o społeczeństwie", Hungarian "Állampolgári ismeretek".
What I changed because of it:
- The quality setting on the iPhone was a segmented control. It became a list with a row per level, because the segments had no room for the name "Recommended" and its badge in every language.
- Lines that pair a value with a label (the usage meter, the renewal date) are wrapped in
ViewThatFits(in: .horizontal): one line where it fits, two where it doesn't, which covers both long languages and the narrow iPad and Mac sidebars.
Right-to-left I can't speak to from experience: none of the 25 is written right to left, and I won't pretend the app has been tested for it. Fonts were a non-issue for the same reason. All text uses the system font, which covers Latin with Maltese ħ ġ ż and Romanian ș ț, Greek and Cyrillic. The only custom font in the app is a glyph font for the Live Activity's sound bars, and it contains no letters at all.
One small thing worth copying: the language picker lists each language by its own name, built from Locale rather than typed in, with the first letter uppercased in that language's own rules (Locale.localizedString(forLanguageCode:) returns "magyar" for Hungarian, lowercase, as Hungarian writes it).
extension SpeechLanguage {
/// The language's name in itself: magyar → Magyar, Deutsch, Ελληνικά.
var nativeName: String {
let locale = Locale(identifier: rawValue)
let name = locale.localizedString(forLanguageCode: rawValue) ?? rawValue
return name.prefix(1).uppercased(with: locale) + name.dropFirst()
}
}
InfoPlist.xcstrings: when English showed the keys
InfoPlist.xcstrings localizes Info.plist values: the display name under the icon, the microphone and camera prompts. It differs from the main catalog in one important way. Its keys are plist keys (CFBundleDisplayName, NSMicrophoneUsageDescription), not English sentences. In the main catalog an entry with no English value still has a sensible fallback, because the key is the English. Here the key is an identifier.
This is also the answer to "how do I localize the app name with a String Catalog": add an InfoPlist.xcstrings to the target, make sure the Info.plist has a CFBundleDisplayName (ClamNotes sets it with the INFOPLIST_KEY_CFBundleDisplayName build setting), and give that key a value in every language, English included. Xcode adds a known set of localizable Info.plist keys to the catalog when it builds; the permission prompts work the same way.
ClamNotes' InfoPlist catalog had translations for all 24 other languages and no English values. On a non-English device everything looked right. On an English device the app's name and the microphone prompt read as raw keys, "CFBundleDisplayName" among them. It was found on 7 October and fixed in a development build the same day; the TestFlight build that was out at the time still had it. The fix was five English entries.
The same property causes a second, quieter problem. When I change the English wording of a permission prompt, the key doesn't change, so nothing in my scripts marks the 24 translations as outdated. They keep saying what the old English said. For most strings that would be a style problem; for a prompt that says where the audio goes, it is a privacy problem. The merge script therefore always replaces those two keys, while it keeps any other existing translation unless told otherwise:
# The permission texts say where the data goes, so a new translation always replaces the old one.
ALWAYS_REPLACE = {"NSMicrophoneUsageDescription", "NSCameraUsageDescription"}
def localization(value):
if isinstance(value, str):
return unit(value)
return {"variations": {"plural": {form: unit(text) for form, text in value.items()}}}
The project generator carries the English of those prompts with a comment, "Translated in ClamNotes/InfoPlist.xcstrings, which has to change with it." A comment is a weak guard, but it sits exactly where the edit happens.
Legal documents in 25 languages
The Terms of Use (which double as the EULA) and the Privacy Policy are Markdown files in iOS/ClamNotes/Legal/: terms-hu.md, privacy-mt.md and so on, 50 files and roughly 325,000 words in total at version 1.7. The app shows the one that matches the device and falls back to English, which is also the governing text:
// simplified
var markdown: String {
let languages = Bundle.main.preferredLocalizations
.map { String($0.prefix { $0 != "-" && $0 != "_" }) } + ["en"]
for language in languages {
if let url = Bundle.main.url(forResource: "\(rawValue)-\(language)", withExtension: "md"),
let text = try? String(contentsOf: url, encoding: .utf8) {
return text
}
}
return ""
}
A subtle dependency: preferredLocalizations is the bundle's localizations ordered by the user's preferences, and the bundle has a localization for a language because the string catalogs compile into a .lproj folder for it. The Markdown files aren't in those folders, yet their selection works because the catalogs are complete.
The documents change often. Versions 1.6, 1.7 and 1.8 were written on 11, 13 and 15 October, each in all 25 languages (the commits read "Legal documents 1.6 in 25 languages" and "Legal documents 1.7 in 25 languages"). A new version goes into Consent.version, which asks everyone to agree again, and the website's legal pages are generated from the English.
The rule that keeps 50 files honest is structural: every language has the same headings and the same lines as the English. That turns "are the translations in step?" into something a shell can answer:
cd iOS/ClamNotes/Legal
for f in *.md; do echo "$(wc -l < $f) $(grep -c '^#' $f) ${f%-*}"; done | sort | uniq -c
# 25 316 24 terms
# 25 332 33 privacy
That is the output at version 1.7: two lines, 25 files each. Anything else means a language fell behind. It did catch one while I was writing this: in the middle of an update, seven privacy files were still a section short. It can't tell you a sentence is mistranslated. It does tell you a sentence is missing, which is the more common failure when one person edits 25 files.
The note is written in the language spoken
Localizing the interface is half of it. The other half is that the app's output follows the class, not the phone. A Hungarian student's phone may be in English; the note for a Hungarian history class should still be in Hungarian. The note-writing prompts are written once, in English, and say which language to write in:
static func noteLanguage(_ subject: NoteSubject, _ main: SpeechLanguage?) -> String {
guard subject.isForeignLanguage else { return "the language that was mostly spoken" }
let around = "the language taught kept in its own words as the subject's rules below say"
guard let main else { return "the language the teacher explains in, \(around)" }
return "\(main.name), the class's main language, \(around)"
}
Foreign-language classes are the exception: a German lesson in a Hungarian school produces a bilingual note, the German kept exactly as taught and the explanations in Hungarian. Each subject's guidance is written for any language, so there are not 25 prompts to keep in step, only one.
Subject names needed more than translation. The mother-tongue subject is stored as one case and shown as each language's schools name it: "Magyar nyelv és irodalom" in Hungarian, "Deutsch" in German, "Äidinkieli ja kirjallisuus" (mother tongue and literature) in Finnish, "Lengua castellana y literatura" in Spanish.
Producing translations and checking them without speaking them
I write ClamNotes with Claude, in Claude Code, and every change to the catalog in my Git history was made that way. The translations are written by the agent that adds the string, in the same change: one JSON file per language, each mapping the English key to a string or to an object of CLDR plural forms, which merge-translations.py folds into whichever of the three catalogs holds the key. Apple now documents the same idea inside Xcode, in Localizing your app using agents, including a suggestion to keep translation guidance in an AGENTS.md, which is where my 25-language rule lives.
Apple's version does one thing mine doesn't: Xcode marks agent translations as Machine Translated in the catalog editor (and leveraged-mt in an XLIFF export), so you can tell them from reviewed ones. My merge script writes every entry as plain translated. If I started again, I would keep that distinction, because the honest state of most of these strings is "machine-written, structurally checked, not reviewed by a native speaker".
What I can check without reading the languages:
- Completeness.
sync-strings.py --checkexits 0, after building both apps. - Specifiers. Same types and counts in every translation, as above.
- Structure. Same lines and headings in all 50 legal files.
- Layout. Debug builds take a launch argument,
-ClamNotesDebugScreen settings(orrecord,notes, an onboarding page), that opens a screen directly, so a long language can be checked screen by screen. The language itself comes from the scheme's App Language option (Apple's guide), or from-AppleLanguageson the command line. On 24 October every screen was captured in all 25 languages and read language by language, again by AI reviewers rather than native speakers; that pass fixed about 1,400 translations and a long list of layouts that didn't fit. - Missing lookups. Foundation's
NSShowNonLocalizedStringsdefault makeslocalizedString(forKey:value:table:)log a key it can't find and return it in capitals, which is hard to miss on screen.
What I can't check that way is whether a sentence sounds like a person wrote it, and whether a term matches what a Slovenian teacher would say. Hungarian is the one language I read as a native. Native readers for the other 24 are the step still missing.
Takeaways
- Make "every language, same change" the rule, then make it cheap: a single command that exits non-zero is what turns a rule into a habit.
.stringsdatafiles fromSWIFT_EMIT_LOC_STRINGSlet you check a String Catalog fromxcodebuild, without opening Xcode.- Give text the compiler can't see one helper and one pattern the script knows.
- Look up the CLDR categories before writing plurals: seven shapes for 25 languages, and the names don't mean what they say.
- Keys that aren't English text (Info.plist, identifiers) need an explicit English value and a way to force retranslation when the English changes.
- For long documents, keep every language line-for-line with the source. Structure is checkable; quality needs people.
Built for ClamNotes
All of this exists so that a class in any of 25 languages gets its note in that language.
ClamNotes records a class, transcribes it on the device and writes a study note in the language that was spoken. For iPhone, iPad and Mac.
See ClamNotes