Lingo.dev + .strings (Xcode)
Lingo.dev CLI translates Xcode .strings files while preserving key-value structure, comments, and iOS localization conventions. The CLI works with older Xcode projects and workflows, maintains developer context and instructions in comments, preserves iOS format specifiers like %@
and %d
, handles UTF-16 and UTF-8 encodings properly, and integrates with standard iOS localization pipelines.
Quick Setup
Configure for legacy Xcode strings files:
{
"locale": {
"source": "en",
"targets": ["es", "fr", "de", "ja"]
},
"buckets": {
"xcode-strings": {
"include": ["Resources/[locale].lproj/Localizable.strings"]
}
}
}
Reminder: [locale]
is a placeholder that should remain in the config literally, as it's replaced with the actual locale during CLI run.
Translate Strings Files
npx lingo.dev@latest i18n
Preserves strings file format, developer comments, and iOS-specific conventions while translating values.
Strings File Structure
Basic Key-Value Pairs
/* Main navigation */
"nav.home" = "Home";
"nav.settings" = "Settings";
"nav.profile" = "Profile";
/* Authentication */
"auth.login" = "Log In";
"auth.logout" = "Log Out";
"auth.register" = "Sign Up";
Format Specifiers
/* User messages with placeholders */
"welcome.user" = "Welcome back, %@!";
"items.count" = "You have %d items in your cart";
"download.progress" = "Downloading... %.1f%% complete";
Multiline Strings
/* Long content */
"terms.agreement" = "By using this app, you agree to our terms of service and privacy policy. Please read them carefully before proceeding.";
"help.description" = "This feature helps you manage your tasks efficiently. You can create, edit, and organize your work items.";
iOS-Specific Features
Localization Comments
/* Appears in the tab bar at the bottom */
"tab.home" = "Home";
/* Button text for submitting a form */
"button.submit" = "Submit";
/* Error message when network is unavailable */
"error.network" = "Please check your internet connection";
Developer comments provide context for translators.
Special Characters
/* Strings with quotes and special characters */
"message.quote" = "She said, \"Hello there!\"";
"path.file" = "Documents\\MyFile.txt";
"symbol.copyright" = "© 2024 Company Name";
Proper escaping for quotes and backslashes is preserved.
Storyboard Integration
/* Storyboard localizations */
"A8K-3L-9X7.text" = "Welcome";
"B9M-4N-0Y8.placeholder" = "Enter your name";
"C0P-5Q-1Z9.title" = "Settings";
Interface Builder generated keys are handled correctly.
Advanced Configuration
Multiple Strings Files
"xcode-strings": {
"include": [
"Resources/[locale].lproj/Localizable.strings",
"Resources/[locale].lproj/InfoPlist.strings"
]
}
Lock System Keys
"xcode-strings": {
"include": ["Resources/[locale].lproj/Localizable.strings"],
"lockedKeys": ["CFBundleName", "CFBundleDisplayName"]
}