MobileStringsToolkit


Source link: https://github.com/ezaquarii/MobileStringsToolkit

About

Mobile String Toolkit is a handy Python 3 script that helps managing translation texts for mobile applications.

Normally we put our app translations directly to proper resource files. This is however very challenging when working with non-technical... clients.

Non-technical people are familiar with Excel or Google Docs, but rarely with any decent development tools. This creates endless trails of e-mails with requests for updates or fixes and copy-n-paste sessions that are cumbersome and boring.

I found that providing a simple interface, where a client can update application resources easily, is a huge win four me. No more lost e-mails - I can build my complete set of resources from CSV file of Google Spreadsheet delivered by the client.

MST is just for that - it will take CSV or google spreadsheet and generate XML files with translations.

Features:

  • generate Android string resources
  • loading data from CSV or Google Docs
  • support normal strings, string arrays or quantity strings
  • easily extendable with new output formats (plans for iOS) or data loaders

Installation

Currently there is no installation "bundle". Unpack MST somewhere and run:

python3 /path/to/MST/generate.py

You must be running Python 3 to use this script.

Usage

After "installation" the script is ready to use. Type

python3 /path/to/mst/generate.py --help

to obtain usage instructions.

To generate proper resources we must create a configuration file in project root. This file contains information about generator (ie. output format) and list of files we want to write our translations to. Parameter sorted tells if output strings should be sorted by key alphabetically. This should mitigate large commits when somebody sorts spreadsheet. Configuration file is in JSON format:

{
  "generator": "android",  "sorted": true  "paths": {

"en": "res/values/strings.xml",
"de": "res/values-de/strings.xml", 
}

Examples:

In both examples we expect /project/mst.cfg configuration files to be properly written.

  1. Generate resources in /project using CSV files. Print operation status.
python3 generate.py --project-root /project -C /project/strings.csv --verbose
  1. Generate resources in /project using Google Docs. Print operation status.
python3 generate.py --project-root /project -G [email protected] password spreadsheet worksheet --verbose

If running this script becomes cumbersome, I advice you to set a launcher in your IDE. For Eclipse go to External Tools Configuration and you're set. Enjoy!

Limitations

So far there was no extensive testing by the masses, so if you find any bugs - please report them or fix them and send me patches. This script worked for me for some time, buy you may find more corner cases.

Wondering why you can't put your google credentials directly into a configuration file? This is a design decision. Configuration file will probably become part of your repository contents and I don't want to be responsible for anybody uploading his username/password to public GitHub repository. :)

This is a feature and I don't plan to change it.

Resources

Make your native android toast look beautiful.

ViewFrom is an android library that allows you to easily find and animate child views from one or multiple ViewGroups using their tag, type, visibility and much more.

Simple dateHelper, that can help you to make your life easy. Just give date to dateHelper and get in different format

DrawingView is a simple view that lets you draw on screen using your fingers and lets you save the drawings as images.

Expressive conditions in Java.

A photopicker to select and click photos and document picker to select different types of documents.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes