This is a tool for extracting string resources from an Android project.
Project description
Android Text Tool
Description
This script is useful for extracting all strings from a multimodule Android project. It supports different output formats which may be useful for you. Currently supported csv, yaml, dynodict-yaml. JSON is coming soon.
NOTE: Before starting using this tool, please run in your project root otherwise you may get a lot of rubbish strings in the output file:
./gradlew clean
Installation
This tool can be installed via PIP repositiory by running the following command:
pip install android-text-tool
or if you use Poetry, run this:
poetry add android-text-tool
Usage
Basic usage
Run the tool in the root directory of your project(please, don't forget to clean it before to prevent extracting strings from different libraries you use).
android-text-tool . -f csv
As a result, you'll get a CSV file which contains all string resources from your project.
Advanced usage
android-text-tool [-h] -f {csv,yaml,dynodict} [-l DEFAULT_LANGUAGE] path
Positional arguments:
path- the path of the Android project to scan.
Optional arguments:
-f {csv,yaml,dynodict},--format {csv,yaml,dynodict}- the output format to save the translations. Default is csv.-l DEFAULT_LANGUAGE,--default-language DEFAULT_LANGUAGE- the default language for the translations. This language code will be used for strings insidevaluefolder. Default is en.
Supported output formats
CSV
This is a comma-separated sheet.
Example:
key,es,ht,fr,en
translation1,Test1,Test1,Test1,Test1
translation2,Test1,Test1,Test1,Test1
translation3,Test1,Test1,Test1,Test1
YAML
Example:
languages:
- en
- ht
- es
- fr
name: Exported project - 2023-11-03T02:29:50
translations:
- key: strings.xml
translations:
- key: translation1
values:
en: Test1
fr: Test1
ht: Test1
- key: translation2
values:
en: Test1
fr: Test1
ht: Test1
Dynodict YAML
This format is for a tool which is going to be released soon. It's under development. Please, do not use it.
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file android_text_tool-0.1.2.tar.gz.
File metadata
- Download URL: android_text_tool-0.1.2.tar.gz
- Upload date:
- Size: 6.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-88-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eaaac3fce601b9dd3683dd10fb26e3969357523402b450964e76171a5e1a8d12
|
|
| MD5 |
fafb73bdbff200658c41812dc6387d0a
|
|
| BLAKE2b-256 |
ed59e84917ebe05b9d873c017d516369b7aabd2856838c4b9d9654b000cf11c8
|
File details
Details for the file android_text_tool-0.1.2-py3-none-any.whl.
File metadata
- Download URL: android_text_tool-0.1.2-py3-none-any.whl
- Upload date:
- Size: 10.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Linux/5.15.0-88-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc48d56966572ccded046f306a503c37c431d58cec19ce305b842e23a53196d5
|
|
| MD5 |
c9ff1809a8fc0136e226e2b9c693e1fe
|
|
| BLAKE2b-256 |
0e4b4b37ec61d1aaa0feb07ab53779ce4bc2f6d6531fb039ba87e7dfead3a68c
|