Skip to main content

Android localization helper

Project description

[travis-url]: http://travis-ci.org/#!/jordanjoz1/android-localization-helper [travis-build-image]: https://secure.travis-ci.org/jordanjoz1/android-localization-helper.svg

[pypi-url]: https://badge.fury.io/py/android-localization-helper [pypi-image]: https://badge.fury.io/py/android-localization-helper.svg

[downloads-url]: https://pypi.python.org/pypi/android-localization-helper/ [downloads-image]: https://pypip.in/d/android-localization-helper/badge.svg

[arsenal-url]: https://android-arsenal.com/details/1/1367 [arsenal-image]: https://img.shields.io/badge/Android%20Arsenal-android–localization–helper-brightgreen.svg?style=flat

[![Travis build image][travis-build-image]][travis-url] [![PyPi version][pypi-image]][pypi-url] [![PyPi download count image][downloads-image]][downloads-url] [![Android Arsenal][arsenal-image]][arsenal-url]

android-localization-helper

Python script that checks for missing string translations in your project’s localized languages.

Ever lose track of what strings have and haven’t been translated in each language? Android Studio [made an awesome GUI](http://tools.android.com/recent/androidstudio087released) to help deal with this issue, but there is no easy way to export missing strings, so if you are missing more than a few strings in a language it can become a tenuous problem. Here’s a solution!

This python package will output a directory with all the string translations that are missing for each localized values directory. It can also clean-up localized strings.xml to remove translations that are no longer used in the default strings.xml file.

## Getting started Requirements:

![Project structure](art/project_structure.png)

To install run: `bash pip install android-localization-helper `

## Usage cd into your res/ folder, and run:

` android-localization-helper `

By default, this creates an output directory to_translate/ ([sample output](./sample_output)) with separate files for the missing strings in each language. Now that you have the untranslated strings for each language in a standard format, you can [send them out for translation](https://developer.android.com/distribute/tools/localization-checklist.html#gp-trans)!

#### Change output directory (–output) Use the output option to change the output directory path

` android-localization-helper --output ~/Desktop/to_translate `

#### Clean-up translated string files (–clean)

This option will remove strings that aren’t in the default file and sort strings to match the default strings.xml order. Warning: this will overwrite your existing localized `strings.xml` files, so make sure you have a back-up in case of any unexpected changes ` android-localization-helper --clean `

### Options

#### -h, –help Prints help message.

#### –res Path to the app’s /res folder. Like, ./main/res

By default assumes the current directory

#### –input List of file names to include from default values directory (e.g. strings.xml plurals.xml). By default, only strings.xml is used

#### –output Output directory path (directory will be created automatically). Like, ~/Desktop/to_translate

By default creates to_translate folder in the current directory.

#### –clean Clean the existing string.xml files for each language. This will remove strings that are in the localized language but not in the default language (they presumably got removed from the default langauge). It will also sort the strings so that they are in the same order as the default language.

## Release History * 2015-05-31   v0.1.3   support for multiple default string sources * 2015-01-05   v0.1.2   support for more language folders, better feedback and error handling * 2015-01-04   v0.1.1   xliff namespace support, better indentation handling * 2015-01-03   v0.1.0   Initial release

## License

See the [LICENSE](LICENSE) file for license rights and limitations (MIT).

CHANGES

0.1.3 (2015-05-31)

  • support for multiple default string sources

0.1.2 (2015-01-05)

  • Support for more language folders

  • Better feedback

  • Better error handling

0.1.1 (2015-01-04)

  • Support for xliff namespace.

  • Preserves original indentation for tags

  • Added tests for plurals

0.1.0 (2015-01-03)

  • Initial release.

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

android-localization-helper-0.1.3.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

android_localization_helper-0.1.3-py2.py3-none-any.whl (9.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file android-localization-helper-0.1.3.tar.gz.

File metadata

File hashes

Hashes for android-localization-helper-0.1.3.tar.gz
Algorithm Hash digest
SHA256 74bdc6d32b997dd87e16cf5df543e43afabd19d2d6e2b9511e6a59a9e41bdeef
MD5 f91492ec01aec8f88dfbd2ce15d4d991
BLAKE2b-256 52bc64d74d146ab16e76c3b07da84b29171d479306a63ce5321fae9e6521faab

See more details on using hashes here.

File details

Details for the file android_localization_helper-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for android_localization_helper-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 7d0f6698ecf373e6879464fa1562949debd19f1f48d1ba3b5a47fbdd5e0e3706
MD5 7ba4bf1666c1c3b9fd244b35068dc732
BLAKE2b-256 047c07e1fe28e1c5b8708a23e6d9ac1c3f007fae8affc32cdb56fb54915ee3b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page