From ac23b8e624f1423f45806990da237ab0e4a82cea Mon Sep 17 00:00:00 2001 From: cymruu Date: Mon, 15 Sep 2014 19:43:05 +0200 Subject: [PATCH] made a tool which generates empty locales template --- tools/gen_lang_template.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tools/gen_lang_template.sh diff --git a/tools/gen_lang_template.sh b/tools/gen_lang_template.sh new file mode 100644 index 00000000..83332a64 --- /dev/null +++ b/tools/gen_lang_template.sh @@ -0,0 +1,15 @@ +#!/bin/bash +#best use ./gen_lang_template >> ../data/locales/XX.lua +#it wont run if you type "sh gen_lang_template", type "./gen_lang_template.sh" instead +#based on gen_needed_translations.sh +echo '-- generated by ./tools/gen_lang_template.sh' +echo 'locale ={' +echo ' name="",' +echo ' languageName="",' +echo ' translation = {' +cat <(find -L ../ \( -name "*.lua" -o -name "*.otui" \) -exec grep -oE "tr\\('(\\\\'|[^'])*'" {} \;) \ + <(find -L ../ \( -name "*.lua" -o -name "*.otui" \) -exec grep -oE "tr\\(\"(\\\\\"|[^\"])*\"" {} \;) \ + | sort | uniq | sed "s/^tr(.\(.*\).$/ [\"\1\"] = \"\",/" +echo ' }' +echo '}' +echo 'modules.client_locales.installLocale(locale)'