Tool for automatic search and localization of .strings files
Project description
XCodeLocalize
Requirments
Python3.9+
Installation
Using pip:
pip3 install xcodelocalize
Usage
Prepare a project
Go to the project settings, add the desired localization languages. Create localization files for all selected languages.
Localize
cd
to project root folder and run
xcodelocalize [OPTIONS]
or
python3 -m xcodelocalize [OPTIONS]
Options
-
--base-language
: code of the language from which all strings will be translated. [default: 'en'] -
--override / --no-override
: a boolean value that indicates whether strings that already exist in the file will be translated. Retranslate ifoverride
, skip ifno-override
. [default: no-override] -
--file
: Names of the strings files to be translated. Multiple files can be specified. If not specified, all files will be translated. [default: None]
xcodelocalize --file Info
xcodelocalize --file Info --file MainStoryboard --file Localizable
-
--key
: Keys of the strings to be translated. Multiple keys can be specified. If not specified, all keys will be translated. [default: None] -
--language
: Language codes of the strings files to be translated. Multiple language codes can be specified. If not specified, all files will be translated. [default: None] -
--log-level
: One from [progress|errors|group|string]. [default: group] -
--help
: Show info
Features:
-
The tool looks for .strings files in the current directory recursively, grouping and translating fully automatically. You can even run it in the root directory and localize all your projects at once.
-
Regular .strings, Info.plist, storyboards and intentdefinition files are supported.
-
Formated strings with %@ are supported.
-
Multiline strings are supported.
-
Key and value must not contain double quotes
"
. Other quotes are supported. -
Comments are supported and will be copied to all files. Comments must not contain substrings in localizable strings format with comment, such as
/*[comment]*/ "[key]" = "[value]";
.
Automation
You can go to Target -> Build Phases -> New Run Script Phase
in your xcode project and paste xcodelocalize
there. It will localize necessary strings during build and your localization files will always be up to date.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for xcodelocalize-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 898ad2aeaa155e1a3a3d0c48b1a071187b95295487f5bf23fa015e7323148902 |
|
MD5 | a248bb20843e56e522b22daa0b0ee9b3 |
|
BLAKE2b-256 | 352d43377792925cd91b089ddeeb07c15c3326333e5f2ee5a0e4717d584f7424 |