Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@maps.me>2016-03-11 20:12:16 +0300
committerSergey Yershov <yershov@corp.mail.ru>2016-03-23 16:53:07 +0300
commit7c72a8bd86662cfc59c6df689586676fda64b2bb (patch)
treeb236edf7cbdceba67f353cd0a27c6e8cd5ba7923 /tools/unix
parentb4c8c8dc71e5df9ec52f1ec835900f46496292d1 (diff)
Fixed translate categories script.
Diffstat (limited to 'tools/unix')
-rwxr-xr-xtools/unix/translate_categories.sh23
1 files changed, 21 insertions, 2 deletions
diff --git a/tools/unix/translate_categories.sh b/tools/unix/translate_categories.sh
index 2a0cba0c12..5d06e44b8f 100755
--- a/tools/unix/translate_categories.sh
+++ b/tools/unix/translate_categories.sh
@@ -1,5 +1,24 @@
#!/bin/bash
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+set -e -u
-${DIR}/translate.awk {en=en+ru+uk+de+fr+it+es+ko+ja+cs+nl+zh-TW+pl+pt+hu+th+zh-CN+ar+da+tr+sv} "$1"
+case $# in
+ 1) SRC=en
+ WORD="$1"
+ ;;
+ 2) SRC="$1"
+ WORD="$2"
+ ;;
+ *) echo "Usage: $0 word_in_English"
+ echo " or"
+ echo " $0 language_code word_in_given_language"
+ exit 1
+ ;;
+esac
+
+LANGUAGES=( en ar cs da de el es fi fr he hu id it ja ko nb nl pl pt ro ru sk sv sw th tr uk vi zh-Hans zh-Hant )
+
+for lang in "${LANGUAGES[@]}"; do
+ TRANSLATION=$(trans -b "$SRC:$lang" "$WORD" | sed 's/ *//')
+ echo "$lang:$TRANSLATION"
+done