Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
#
# ---------------------------------------------------------------------
# Android Studio startup script.
# ---------------------------------------------------------------------
#
message()
{
TITLE="Cannot start Android Studio"
@ben-efiz
ben-efiz / gist:4494099
Last active December 10, 2015 21:18
Little python script for replacing all localization with a large arrays.xml with keys and putting the string values into a new strings.xml Why doing so? See here http://developer.sinnerschrader-mobile.com/moving-localization-from-arrays-xml-to-strings-xml/463/
#!/usr/bin/python
import argparse
parser = argparse.ArgumentParser(description='Replacing values in arrays.xml with @string/ links. Generates two new files: <input>.new (edited arrays.xml containing the string links) and <input>.strings (resources file containing the new string keys)')
parser.add_argument('-i', '--input', help='Input file, e.g. arrays.xml', metavar='FILE', required=True)
parser.add_argument('-p', '--prefix', help='Optional prefix added to each new string key, e.g. array_')
args = vars(parser.parse_args())
xmlString = ' <string name=\"{0}\">{1}</string>'