Automatically translate iOS Localizable.xcstrings files using DeepL API. This plugin helps you efficiently manage app localization by translating untranslated strings while preserving your existing translations.
- Language selection with progress: Shows translation completeness for each language
- Smart targeting: Only translates missing strings, preserves existing translations
- Formality options: Formal/informal translation styles for supported languages
- Context-aware translation: Uses xcstrings comments to improve translation quality
- Progress tracking: Resume interrupted translations without starting over
- Automatic backups: Safe translation with rollback capability
- Error recovery: Handle API failures gracefully with retry options
Add to your Gemfile:
Then run:
-
Get a DeepL API key from https://www.deepl.com/pro#developer
-
Set your API key as an environment variable:
export DEEPL_AUTH_KEY="your-deepl-api-key-here"
After installation, create a lane in your Fastfile and run it:
Simple dedicated lane:
Within complex workflows:
The plugin supports all languages available in both Apple's App Store Connect and DeepL API:
- 🇩🇪 German (de) - supports formality
- 🇫🇷 French (fr) - supports formality
- 🇮🇹 Italian (it) - supports formality
- 🇪🇸 Spanish (es) - supports formality
- 🇳🇱 Dutch (nl) - supports formality
- 🇵🇱 Polish (pl) - supports formality
- 🇵🇹 Portuguese (pt-BR, pt-PT) - supports formality
- 🇯🇵 Japanese (ja) - supports formality
- 🇷🇺 Russian (ru) - supports formality
- 🇬🇧 English (en-US, en-GB)
- 🇨🇳 Chinese (zh-Hans, zh-Hant)
- 🇰🇷 Korean (ko)
- And many more...
Languages marked with "supports formality" offer formal/informal translation options
api_token | DeepL API authentication key | ENV['DEEPL_AUTH_KEY'] | Yes |
xcstrings_path | Path to Localizable.xcstrings file | Auto-detected | No |
target_language | Target language code (e.g., "de", "fr") | User prompted | No |
batch_size | Number of strings per API call | 20 | No |
free_api | Use DeepL Free API endpoint | false | No |
formality | Translation formality level | Auto-detected | No |
For supported languages, you can specify:
- default - Standard formality
- more - More formal language
- less - Less formal language
- prefer_more - Formal if available, otherwise default
- prefer_less - Informal if available, otherwise default
The plugin provides comprehensive error recovery:
The action sets the following shared values for use in other lanes:
- TRANSLATE_WITH_DEEPL_TRANSLATED_COUNT - Number of translated strings
- TRANSLATE_WITH_DEEPL_TARGET_LANGUAGE - Target language code
- TRANSLATE_WITH_DEEPL_BACKUP_FILE - Path to backup file
The plugin automatically saves translation progress:
Progress files are automatically cleaned up after successful completion.
When xcstrings files contain comments, they're used as translation context:
This comment becomes context for better translation quality.
- Ruby >= 2.6
- Fastlane >= 2.0.0
- DeepL API account (Free or Pro)
- Clone the repository
- Run bundle install
Run the full test suite:
Run specific test files:
Run RuboCop for style checking:
Auto-fix correctable issues:
To test the plugin manually with a real project:
- Ruby >= 3.4
- Fastlane >= 2.0.0
- DeepL API account (Free or Pro) for manual testing
For bugs, feature requests, or questions, please create an issue.
This project is licensed under the MIT License - see the LICENSE file for details.
fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To get started with fastlane, check out fastlane.tools.