Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dulacp/igenstrings
Apple genstrings command on steroids by adding merging superpowers
https://github.com/dulacp/igenstrings
i18n internationalization ios localization macos xcode
Last synced: about 2 months ago
JSON representation
Apple genstrings command on steroids by adding merging superpowers
- Host: GitHub
- URL: https://github.com/dulacp/igenstrings
- Owner: dulacp
- License: mit
- Created: 2012-06-26T12:32:20.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2021-11-09T17:29:55.000Z (about 3 years ago)
- Last Synced: 2024-07-05T09:21:44.224Z (6 months ago)
- Topics: i18n, internationalization, ios, localization, macos, xcode
- Language: Python
- Homepage:
- Size: 84 KB
- Stars: 39
- Watchers: 2
- Forks: 11
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# igenstrings
[![build-status-image]][travis]
[![build-coverage-image]][codecov]
[![pypi-version-image]][pypi]
[![docs-image]][docs]> Eventually, all things merge into one, and a river runs through it.
Enhance the genstrings command by adding merging capabilities
Documentation is available at [https://igenstrings.readthedocs.org][docs].## Features
* Ensure your files are encoded in UTF-8 (as [recommended by Apple](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) now)
* Takes care of runing the genstrings command on all files `\*.m`, `\*.mm` and `\*.swift`
* Merge the results with previous version of the Localizable.string files you may have
* Inform you if it works correctly## Installation
```sh
$ pip install igenstrings
```## Support
Python 2.7
Python 3.4+## Requirements
Ensure your `*.strings` files are UTF-8 encoded as [Apple recommends it](https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html) now :
> It is recommended that you save strings files using the UTF-8 encoding, which is the default encoding for standard strings files. Xcode automatically transcodes strings files from UTF-8 to UTF-16 when they’re copied into the product.
## Usage
```sh
$ igenstrings ./MyXcodeProjectDir
```*output*
```sh
Running the script on path ./MyXcodeProjectDir
Excluded path regex: None
languages found : ['./MyXcodeProjectDir/en.lproj', './MyXcodeProjectDir/fr.lproj']
Job done for language: ./MyXcodeProjectDir/en.lproj
Job done for language: ./MyXcodeProjectDir/fr.lproj
```## Known Issues
* The Apple `genstrings` command doesn't like path that contains spaces.
So avoid subfolders containing spaces, otherwise the Localizable.string will not be complete
* You need to respect the format used by the genstrings command unless it will breaks.
So, to avoid issues use strictly the format below for each translated text.
Also do not remove the line break between two fields or it will breaks too.```ruby
/* Comment for localizable string */
"Your string" = "Translated string";/* Comment for localizable string */
"Your string #2" = "Translated string #2";
```## Credits
Tools used in rendering this package:
* [`Cookiecutter`][Cookiecutter]
* [`cookiecutter-pypackage`][cookiecutter]## Contact
[Pierre Dulac][github-dulacp]
[@\_dulacp][twitter-dulacp]## License
`igenstrings` is available under the MIT license. See the [LICENSE](LICENSE) file for more info.
[build-status-image]: https://img.shields.io/travis/dulacp/igenstrings.svg
[build-coverage-image]: https://img.shields.io/codecov/c/github/dulacp/igenstrings.svg
[travis]: https://travis-ci.org/dulacp/igenstrings
[codecov]: https://codecov.io/github/dulacp/igenstrings?branch=master
[pypi-version-image]: https://img.shields.io/pypi/v/igenstrings.svg
[pypi]: https://pypi.python.org/pypi/igenstrings
[docs-image]: https://readthedocs.org/projects/igenstrings/badge/?version=latest
[docs]: http://igenstrings.readthedocs.org/en/latest/[Cookiecutter]: https://github.com/audreyr/cookiecutter
[cookiecutter-pypackage]: https://github.com/audreyr/cookiecutter-pypackage
[github-dulacp]: https://github.com/dulacp
[twitter-dulacp]: https://twitter.com/_dulacp