LiveTranscriber uses semantic localization keys for new and migrated UI text.
Currently supported app UI locales are en, zh-Hans, zh-Hant, de, nl, and ja.
Do not add new user-visible strings as Chinese source keys in Swift code. Avoid this pattern:
Text("录音文件")
String(localized: "正在分析")
Instead, add a semantic key to LiveTranscriber/Semantic.xcstrings, expose it from LiveTranscriber/L10n.swift, and reference that resource from Swift.
Text(L10n.Recordings.title)
String(localized: L10n.Recordings.analyzing)
LiveTranscriber/Semantic.xcstrings: the primary string catalog for semantic app strings.LiveTranscriber/L10n.swift: typed accessors grouped by feature area, such as L10n.Recordings, L10n.Source, L10n.ICloud, and L10n.Intelligence.LiveTranscriber/en.lproj/InfoPlist.strings and LiveTranscriber/zh-Hans.lproj/InfoPlist.strings: system-facing strings such as privacy permission prompts.Semantic.xcstrings.
recordings.delete_failed, not source text.en and zh-Hans values together.defaultValue in code.L10n.swift.
LocalizedStringResource directly in SwiftUI when possible.
Text(L10n.Recordings.title)Button { save() } label: { Text(L10n.Common.save) }EmptyStateView(icon: "map", titleResource: L10n.Recordings.noLocatedRecordings)String(localized:) only when an API needs a String.
.navigationTitle(String(localized: L10n.Recordings.mapTitle))errorText = String(localized: L10n.Recordings.locationUnavailable)For formatted strings, keep the format in the catalog and pass values from code:
String(
format: String(localized: L10n.Recordings.deleteConfirmationFormat),
recordingName
)
Do not localize user data such as recording names, tags, transcript text, location names, language display names, or system error descriptions.
If a shared SwiftUI helper only accepts LocalizedStringKey, add an overload that accepts LocalizedStringResource instead of converting a semantic string back into a source-text key.
Preferred:
init(titleResource: LocalizedStringResource) {
self.title = Text(titleResource)
}
Avoid:
init(title: String) {
self.title = Text(LocalizedStringKey(title))
}
The string-based initializer may remain for legacy callers, but migrated callers should use the resource initializer.
LiveTranscriber/Semantic.xcstrings in Xcode.
ja, fr, or de.L10n.Feature.key.InfoPlist.strings or legacy .lproj file if they are not already in a string catalog.Localizable.strings for app UI. Add app UI text to Semantic.xcstrings instead.L10n.swift accessor.Before finishing localization work, run:
jq empty LiveTranscriber/Semantic.xcstrings
git diff --check
rg -n "[\\p{Han}]" --glob '*.swift' LiveTranscriber LiveTranscriberWidget
/Applications/Xcode-beta.app/Contents/Developer/usr/bin/xcodebuild \
-project LiveTranscriber.xcodeproj \
-scheme LiveTranscriber \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath /tmp/LiveTranscriberDerivedDataLocalization \
-quiet build
For migrated Swift code, the rg command should return no user-visible Chinese source text. Chinese translations belong in .xcstrings or .strings files, not Swift source.