mirror of
https://github.com/edubart/otclient.git
synced 2025-04-25 23:39:20 +02:00
made a tool which generates empty locales template
This commit is contained in:
parent
49d62b8225
commit
ac23b8e624
15
tools/gen_lang_template.sh
Normal file
15
tools/gen_lang_template.sh
Normal file
@ -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)'
|
Loading…
x
Reference in New Issue
Block a user