Created
July 7, 2014 06:57
-
-
Save amitkot/3316ef8b0691c73efb74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Creating localization directories in an Andorid project | |
The script creates the required directories and copies the default strings.xml | |
file to each of them. | |
Those xml files can later be editted. | |
""" | |
from path import path | |
VALUES = "values" | |
languages = ["ar", "fr", "de", "gr", "he", "it", "jp", "kr", "pt", "ru", | |
"es", "sv", "tr", "cn", ] | |
val_file = path("values/strings.xml") | |
for lang in languages: | |
lang_dir = path(VALUES + '-' + lang) | |
try: | |
lang_dir.mkdir() | |
print "created ", lang_dir | |
except: | |
pass | |
try: | |
path.copy(val_file, lang_dir) | |
print "copied ", val_file, "to", lang_dir | |
except Exception, e: | |
raise e | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment