[localization] Remove extra scripts and files for countries_names

This commit is contained in:
Ilya Zverev 2016-04-26 16:26:02 +03:00
parent 40d41aa0eb
commit 296f75f864
6 changed files with 9 additions and 78 deletions

View file

@ -1 +0,0 @@
en zh-Hans vi it zh-Hant ar cs id es ru nl pt nb tr th ro pl fr de da fi hu ja he ko sv sk uk

View file

@ -1,30 +0,0 @@
#!/usr/bin/python
import sys, csv
if len(sys.argv) < 4:
print 'Converting Google Docs translation CSV to strings.txt format'
print 'Translation valid only for page "Small mwm names" in document:'
print 'https://docs.google.com/spreadsheets/d/1dKhThUersOGoUyOCx5OfGMXEjs1LBmTFcIsTc_nGxZc/edit#gid=1022107578'
print 'Usage: {0} <source.csv> <output.txt> <languages.txt>'.format(sys.argv[0])
sys.exit(1)
def GetName(n):
return n[:n.index(' ')]
languages = set()
with open(sys.argv[2], 'w') as o:
with open(sys.argv[1], 'r') as f:
reader = csv.reader(f)
reader.next()
header = reader.next()
for row in reader:
print >> o, '[{0}]'.format(row[0])
for i in range(1, len(header)):
languages.add(GetName(format(header[i])))
print >> o, '{0}{1}'.format(header[i], row[i])
print >> o
with open(sys.argv[3], 'w') as l:
print >> l, " ".join(languages)

View file

@ -1,26 +0,0 @@
#!/bin/bash
set -e -u -x
MY_PATH="`dirname \"$0\"`" # relative
MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
readonly TMP_DIR=$MY_PATH/../../../localization/countries_names-tmp
readonly DATA_DIR=$MY_PATH/../../../localization/countries_names
rm -rf $TMP_DIR
mkdir $TMP_DIR
python $MY_PATH/csv_to_txt.py $DATA_DIR/countries_names.csv $DATA_DIR/countries_names.txt $DATA_DIR/languages.txt
mkdir $TMP_DIR/json
python $MY_PATH/mk_lang_dirs.py $DATA_DIR/languages.txt $TMP_DIR/json/
$MY_PATH/../../twine/twine --format jquery generate-all-string-files $DATA_DIR/countries_names.txt $TMP_DIR/json
readonly OUTPUT_DIR=$MY_PATH/../../../data/countries-strings/
if [ ! -d $OUTPUT_DIR ]; then
mkdir $OUTPUT_DIR
fi
cp -R $TMP_DIR/json/ $OUTPUT_DIR
rm -rf $TMP_DIR

View file

@ -1,14 +0,0 @@
#!/usr/bin/python
import os, sys
if len(sys.argv) < 3:
print 'Creation or resource directories for the languages'
print 'Usage: {0} <languages.txt> <path_to_dir_with_jsons>'.format(sys.argv[0])
sys.exit(1)
with open(sys.argv[1], "r") as langs_file:
for lang in langs_file.read().split():
new_dir = os.path.join(sys.argv[2], lang + ".json")
if not os.path.exists(new_dir):
os.makedirs(new_dir)

View file

@ -1,12 +1,14 @@
#!/bin/bash
set -e -u -x
OMIM_PATH="$(dirname "$0")/../.."
TWINE="$OMIM_PATH/tools/twine/twine"
# TODO: Add "--untagged --tags android" when tags are properly set.
# TODO: Add validate-strings-file call to check for duplicates (and avoid Android build errors) when tags are properly set.
./tools/twine/twine --format android generate-all-string-files ./strings.txt ./android/res/
./tools/twine/twine --format apple generate-all-string-files ./strings.txt ./iphone/Maps/
./tools/twine/twine --format apple --file-name InfoPlist.strings generate-all-string-files ./iphone/plist.txt ./iphone/Maps/
./tools/twine/twine --format jquery generate-all-string-files ./data/cuisines.txt ./data/cuisine-strings/
#./tools/twine/twine --format tizen generate-all-string-files ./strings.txt ./tizen/MapsWithMe/res/ --tags tizen
$TWINE --format android generate-all-string-files "$OMIM_PATH/strings.txt" "$OMIM_PATH/android/res/"
$TWINE --format apple generate-all-string-files "$OMIM_PATH/strings.txt" "$OMIM_PATH/iphone/Maps/"
$TWINE --format apple --file-name InfoPlist.strings generate-all-string-files "$OMIM_PATH/iphone/plist.txt" "$OMIM_PATH/iphone/Maps/"
$TWINE --format jquery generate-all-string-files "$OMIM_PATH/data/cuisines.txt" "$OMIM_PATH/data/cuisine-strings/"
$TWINE --format jquery generate-all-string-files "$OMIM_PATH/data/countries_names.txt" "$OMIM_PATH/data/countries-strings/"
#$TWINE --format tizen generate-all-string-files "$OMIM_PATH/strings.txt" "$OMIM_PATH/tizen/MapsWithMe/res/" --tags tizen