Skip to content

ty0x2333/TyStrings

Repository files navigation

_______     _____ _        _
/ ____| | (_)
(___ | |_ _ __ _ _ __ __ _ ___
| | | '__| | '_ / _` / __|
| | | | | | | (_| __ \
__, _| _| __, __/ |

___/

strings file tool for iOS / macOS developers

Python Package Index Python Version Support Continuous Integration Coverage Testing Results MIT License Codebeat Badge

TyStrings Screenshot

Installation

$ sudo pip install tystrings

Usage

$ tystrings -h
  usage: tystrings [-h] [-v] [--utf8] [--version] {generate,translate,lint,diff} ...

    _______     _____ _        _
   |__   __|   / ____| |      (_)
      | |_   _| (___ | |_ _ __ _ _ __   __ _ ___
      | | | | |\___ \| __| '__| | '_ \ / _` / __|
      | | |_| |____) | |_| |  | | | | | (_| \__ \
      |_|\__, |_____/ \__|_|  |_|_| |_|\__, |___/
          __/ |                         __/ |
         |___/                         |___/


  optional arguments:
    -h, --help            show this help message and exit
    -v, --verbose         show more debugging information
    --utf8                use encoding UTF-8
    --version             show program's version number and exit

  subcommands:
    {generate,translate,lint,diff}
      generate            generate `.strings` file from source code files.
      translate           using Baidu Translate Service to translate `.strings` file.
      lint                Validates a `.strings` file.
      diff                Compare `.strings` files line by line.

To run tystrings generate over all .m files in your project, you can invoke it, for example, like this:

$ tystrings generate $(find . -name \*.m) -o en.lproj zh-Hans.lprog -v

translate .strings file to another language:

$ tystrings translate en.lproj/Localizable.strings zh-Hans.lproj/Localizable.strings --src-lang en --dst-lang zh

validates .strings file:

$ tystrings lint en.lproj/Localizable.strings

compare two .strings files:

$ tystrings diff Localizable1.strings Localizable2.strings