A Rust-based command-line tool for synchronizing iOS/macOS .strings localization files. This tool helps maintain consistency across multiple localization files by ensuring all translations contain the same keys in the same order as the original file.
When working with iOS/macOS localization, it's common to have a primary .strings file (usually en.lproj/Localizable.strings) and multiple localized versions. Over time, these files can get out of sync:
- New keys are added to the original but missing in translations
- Keys appear in different orders across files
- Deprecated keys remain in translation files
This tool solves these problems by:
- Synchronizing keys: Ensures all localization files contain the same keys as the original
- Preserving order: Maintains the same key order across all files
- Keeping translations: Retains existing translations for keys that haven't changed
- Adding missing keys: Automatically adds new keys from the original to all localization files
- Preserving comments: Keeps file headers and comments intact
- Support multiline keys: Handles keys with multiple lines of text
-
Download the latest release archive from the Releases page
-
Extract the archive:
# For .zip
unzip synclproj.zip- Make the binary executable:
chmod +x synclproj- (Optional) Move to a directory in your PATH:
sudo mv synclproj /usr/local/bin/- Run the tool:
synclproj <original.strings> <lproj_folder>- Rust toolchain (1.70 or later)
cargo build --releaseThe compiled binary will be available at target/release/synclproj.
synclproj <original.strings> <lproj_folder><original.strings>- Path to the original/master.stringsfile (e.g.,en.lproj/Localizable.strings)<lproj_folder>- Path to the folder containing localization directories (e.g.,MyApp/Resources/)
# Sync all .strings files in the localization folder
synclproj en.lproj/Localizable.strings ./Resources/
# Sync specific language folder
synclproj en.lproj/Localizable.strings fr.lproj/-
Scans the specified folder recursively for all
.stringsfiles -
Parses the original file to extract keys and their order
-
For each localization file:
- Identifies existing keys and their translations
- Adds missing keys from the original (with original values as placeholders)
- Reorders all entries to match the original file's order
- Preserves file header comments
- Removes excessive empty lines
-
Reports which keys were added to each file
Scanning folder: ./Resources/
Syncing: ./Resources/fr.lproj/Localizable.strings
Adding missing key: new_feature_title
Adding missing key: new_feature_description
Syncing: ./Resources/de.lproj/Localizable.strings
Adding missing key: new_feature_title
Adding missing key: new_feature_description
All .strings files synchronized successfully!
The tool supports standard iOS/macOS .strings file format:
/* Header comment */
"key1" = "value1";
"key2" = "value2";
"multiline_key" = "This is a \
multiline value";
- The tool overwrites localization files in place
- Consider committing your changes to version control before running the tool
- Always review the changes after synchronization
This project is open source and available for use and modification.
Contributions are welcome! Feel free to submit issues or pull requests.