Localization tool for Android Studio Projects

Overview

Android Strings Resource Language Diff tool

In the event any additional languages are intended to be supported by your app.
You can use this strings-diff tool to ensure all translations from english to the language in question are accounted for.

To use this tool simply first copy and paste the language-diff-tool.jar tool into the root directory of the current project you are attempting to apply language changes.

This tool offers the following features:

  • Search for any string resources in english not supported in an alternte language and provide a xml document containing the missing strings found.
  • Process a CSV file witch in the following formats:
    • A simple 2 column file containing english to alternate language translations
    • An advanced 3 column file containing english text, the alternate language translation, and the shared string res id
  • Export a csv of all string in application for both english anf the alternate language

Searching for missing translations

WHen using this tool to search for missing translations within your app simply open a terminal window inside the current project directory and type the following:

C:\Users\...\android-project> java -jar language-diff-tool.jar -les  

The -l option is where you specify the language to diff against.
Once the program executes a missing-es-translations.xml file will be generated listing any strings in english that need to be translated to the respective language.

Passing a CSV file

This will allow you to automate updating your project with any translations that may need to be updated or added within your resource file. To pass a csv file to the tool simply type the following in the terminal within your project:

C:\Users\...\android-project> java -jar language-diff-tool.jar -les -csv path/to/file.csv

It's important to note that the csv file path is relative to the source directory provided to the tool which can be set with the -s command which is also used to find the string files within your project. So be sure to include the csv file within the project directory you are using this tool in.

Once started the csv file will be scanned for any matching english strings with the values provided. After the tool has run a diff report will be provided which generates a skipped-english-translations.xml file for any skipped translations that could not be found as well as a skipped-alt-lang-translations for any translations that could not be found in the alt res file. Please note that the tool is not case sensative when processing a simple 2 column csv file and allows for minor grammatical errors when searching for matching english strings.

Expected Simple CSV format

To correctly process the csv file it must be in the following format:

English Spanish
Hello Hola
Goodbye! Adios!
System Error Error del sistema

The csv must consist of only 2 columns with english on the left and spanish/german/etc. on the other column. This is great for quick imports of translations when you only need to update a few translations in the alternate language. However, this only updates strings in the alternate resource file, to update both english and spanish resources refer to the second csv format below.

Expected Advanced CSV format

To correctly process the csv file it must be in the following format:

English Spanish ResId
Hello Hola greeting_msg
Goodbye! Adios! exit_title
System Error Error del sistema error_result_title

The csv must consist of only 3 columns with english, alternate-language, & string-res-id. Once the tool has finished processing, a diff report will be provided listing any skipped translations during processing. This format can be generated manually or automatically via csv export as described below. This format is great if you want to update both english strings & the alternate language at the same time when importing the translations.

Exporting A CSV File

To export all the strings within your app you can use the following command -exportcsv. This will generate a csv file containing 3 columns english, alternate-resource, and string-res-id which can be updated and used by this tool to modify the same strings with the res-id's found in the file.

Below is an example of using the export command:

C:\Users\...\android-project> java -jar language-diff-tool.jar -les -exportcsv path/to/file.csv

Once the command has run a file named string-translations.csv will be generated.

Ignoring strings

In the event if you do not want a string to be considered by this tool to be "not translated" and included in the missing translations file.
You can add the translatable="false" flag to the string resource to have it not considered by the tool.

You might also like...
Android Material Design Theme UI and Tool Library. Support: 4.0.3~O
Android Material Design Theme UI and Tool Library. Support: 4.0.3~O

GitHub OSChina 中文 English Genius-Android Genius-Android: by Material Design style and some commonly used packages. Starting in 2015, The divided into

Android Merge Tool
Android Merge Tool

AMT The Android Merge Tool (AMT) does what the name suggests: it merges arbitrary Android apps into a single merged app. As input it takes a number of

A command line tool that helps bulk manage resources in an Android project

Resource Mover ResourceMover is a command line tool that helps bulk manage resources in an Android project. Installation Clone project Build CLI jar u

A surgical debugging tool to uncover the layers under your app.
A surgical debugging tool to uncover the layers under your app.

Scalpel DEPRECATED! Android Studio 4.0's layout inspector now includes a live-updating 3D view. Use it! A surgical debugging tool to uncover the layer

Tool for create complex morphing animations using VectorDrawables (allows morphing between any pair of SVG images)

VectAlign VectAlign (a.k.a. VectorDrawableAlign) is a developer's tool which automagically aligns two VectorDrawable "pathData" strings (or SVG images

GPS tracking tool for OpenStreetMap
GPS tracking tool for OpenStreetMap

OSMTracker for Android™ official source code repository is https://github.com/labexp/osmtracker-android. For more information about the project, docum

A tool that enables advanced features through adb installing and uninstalling apps like wildcards and multi device support. Useful if you want to clean your test device from all company apks or install a lot of apks in one go.  Written in Java so it should run on your platform. GPS tracking tool for OpenStreetMap
GPS tracking tool for OpenStreetMap

OSMTracker for Android™ official source code repository is https://github.com/labexp/osmtracker-android. For more information about the project, docum

Custom content tool for The Ponies.

PoneCrafter A sneak preview of the custom content tool for The Ponies. The Ponies is a work in progress life simulator game. The game itself has not b

Owner
Braxton Nunnally
Braxton Nunnally
Android Studio's Vector Drawable conversion tool in convenient packaging.

Vector Drawable Tool This repository is simply a repackaging of the vector drawable tool from the Android Studio source code. The included Gradle file

Ryan Harter 55 Sep 26, 2022
This is a Android Studio/ IntelliJ IDEA plugin to localize your Android app, translate your string resources automactically.

#Android Localizationer This is a Android Studio/ IntelliJ IDEA plugin to localize your Android app, translate your string resources automactically. T

Wesley Lin 822 Dec 8, 2022
Android Studio Arctic Fox (Canary) for Apple Sillicon

This is a unofficial canary version of Android Studio Arctic Fox on the Apple Silicon. (e.g M1 Chip)

Dora Lee 249 Oct 23, 2022
A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

simpligility 1.4k Dec 27, 2022
A simple utility to remove unused resources in your Android app to lower the size of the APK. It's based on the Android lint tool output.

android-resource-remover android-resource-remover is utility that removes unused resources reported by Android Lint from your project. The goal is to

Keepsafe 1.3k Dec 16, 2022
A tool to install components of the Android SDK into a Maven repository or repository manager to use with the Android Maven Plugin, Gradle and other tools.

Maven Android SDK Deployer Original author including numerous fixes and changes: Manfred Moser [email protected] at simpligility technologies i

simpligility 1.4k Dec 27, 2022
A super fast build tool for Android, an alternative to Instant Run

Freeline Freeline is a super fast build tool for Android and an alternative to Instant Run. Caching reusable class files and resource indices, it enab

Alibaba 5.5k Jan 2, 2023
Command-line tool to count per-package methods in Android .dex files

dex-method-counts Simple tool to output per-package method counts in an Android DEX executable grouped by package, to aid in getting under the 65,536

Mihai Parparita 2.6k Nov 25, 2022