|
@@ -0,0 +1,15 @@
|
|
1
|
+#!/bin/bash
|
|
2
|
+#best use ./gen_lang_template >> ../data/locales/XX.lua
|
|
3
|
+#it wont run if you type "sh gen_lang_template", type "./gen_lang_template.sh" instead
|
|
4
|
+#based on gen_needed_translations.sh
|
|
5
|
+echo '-- generated by ./tools/gen_lang_template.sh'
|
|
6
|
+echo 'locale ={'
|
|
7
|
+echo ' name="",'
|
|
8
|
+echo ' languageName="",'
|
|
9
|
+echo ' translation = {'
|
|
10
|
+cat <(find -L ../ \( -name "*.lua" -o -name "*.otui" \) -exec grep -oE "tr\\('(\\\\'|[^'])*'" {} \;) \
|
|
11
|
+ <(find -L ../ \( -name "*.lua" -o -name "*.otui" \) -exec grep -oE "tr\\(\"(\\\\\"|[^\"])*\"" {} \;) \
|
|
12
|
+ | sort | uniq | sed "s/^tr(.\(.*\).$/ [\"\1\"] = \"\",/"
|
|
13
|
+echo ' }'
|
|
14
|
+echo '}'
|
|
15
|
+echo 'modules.client_locales.installLocale(locale)'
|