Translatable text strings generation

set out of the main tomb script, into extras
This commit is contained in:
Jaromil 2013-05-28 11:59:11 +02:00
parent 671350585e
commit 7cbd03d370
2 changed files with 60 additions and 0 deletions

4
extras/po/Makefile Normal file
View File

@ -0,0 +1,4 @@
all:
@rm -f tomb.pot
@./generate_translatable_strings.sh > tomb.pot
@echo "Strings generated in tomb.pot"

View File

@ -0,0 +1,56 @@
#!/bin/zsh
cat <<EOF
# Tomb - The Crypto Undertaker.
# Copyright (C) 2007-2013 Dyne.org Foundation
# Denis Roio <jaromil@dyne.org>, 2013.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: Tomb $VERSION\n"
"PO-Revision-Date: `date`\n"
"Last-Translator: Denis Roio <jaromil@dyne.org>\n"
"Language-Team: Tomb developers <crypto@lists.dyne.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#
#: commandline help
#
msgid ""
EOF
../../tomb help | awk '
{ print "\"" $0 "\"" }'
cat <<EOF
msgstr ""
#
# tomb internal messages
#
EOF
cat ../../tomb | awk '
/(_verbose|xxx) ".*"$/ { sub( /^(_verbose|xxx)/ , "");
print "#: _verbose"; shift; print "msgid " substr($0, index($0,$2)); print "msgstr \"\"\n" }
/(_success|yes) ".*"$/ { sub( /^(_success|yes)/ , "");
print "#: _success"; print "msgid " substr($0, index($0,$2)); print "msgstr \"\"\n" }
/(_warning|no) ".*"$/ { sub( /^(_warning|no)/ , "");
print "#: _warning"; print "msgid " substr($0, index($0,$2)); print "msgstr \"\"\n" }
/(_failure|die) ".*"$/ { sub( /^(_failure|die)/ , "");
print "#: _failure"; print "msgid " substr($0, index($0,$2)); print "msgstr \"\"\n" }
/(_message|say) ".*"$/ { sub( /^(_message|say)/ , "");
print "#: _message"; print "msgid " substr($0, index($0,$2)); print "msgstr \"\"\n" }
/(_message -n|act) ".*"$/ { sub( /^(_message -n|act)/ , "");
print "#: _message -n"; print "msgid " substr($0, index($0,$2)); print "msgstr \"\"\n" }
'