Skip to main content

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 inside value folder. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

android_text_tool-0.1.1.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

android_text_tool-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file android_text_tool-0.1.1.tar.gz.

File metadata

  • Download URL: android_text_tool-0.1.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.11.5 Darwin/23.0.0

File hashes

Hashes for android_text_tool-0.1.1.tar.gz
Algorithm Hash digest
SHA256 dedc0906e0171d194b1861071e242cdae3e33e4932919a40de737617ea0bd9e6
MD5 03b2df49b093df6d424603f28a952dad
BLAKE2b-256 8453aa092ad4d4871b026f402f4016c5a4778f36c3de4c7c2d146e863fe4e0d9

See more details on using hashes here.

File details

Details for the file android_text_tool-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: android_text_tool-0.1.1-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 Darwin/23.0.0

File hashes

Hashes for android_text_tool-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f0e039b6bc52c49ff996a736554a78c668b781b4cf5ade30243d3c65bd367b86
MD5 3194eabff7608b35b2cdb07ce7b76a92
BLAKE2b-256 62bba03e634bd303f4c5b6fb7f5bc2f190bea9379e9791ec4a710c5c226e93d1

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