summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2010-11-29 13:08:31 +0300
committerAndrew Dolgov <[email protected]>2010-11-29 13:08:31 +0300
commit2cd992574a5ce73a3d99d52c70184e442226f38b (patch)
tree4a36dbbcd2eb2873ed678d6cc237692d21d8956c /utils
parent30b6ee8c08a5c5d0201be95864706ab529298a70 (diff)
add script to extract preference translations from the schema; update translations
Diffstat (limited to 'utils')
-rw-r--r--utils/localized_schema.txt12
-rwxr-xr-xutils/update-schema-translations.sh18
2 files changed, 30 insertions, 0 deletions
diff --git a/utils/localized_schema.txt b/utils/localized_schema.txt
new file mode 100644
index 000000000..f140d0bc2
--- /dev/null
+++ b/utils/localized_schema.txt
@@ -0,0 +1,12 @@
+__("Title");
+__("Title or Content");
+__("Link");
+__("Content");
+__("Article Date");
+
+__("Filter article");
+__("Mark as read");
+__("Set starred");
+__("Publish article");
+__("Assign tags");
+__("Assign label");
diff --git a/utils/update-schema-translations.sh b/utils/update-schema-translations.sh
new file mode 100755
index 000000000..dff446506
--- /dev/null
+++ b/utils/update-schema-translations.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+BASENAME=`basename $0`
+TMPFILE="/tmp/$BASENAME-$$.tmp"
+
+cat schema/ttrss_schema_pgsql.sql | grep 'insert.*pref_name' | awk -F\' '{ print $8 }' > $TMPFILE
+cat schema/ttrss_schema_pgsql.sql | grep 'insert.*pref_name' | awk -F\' '{ print $6 }' >> $TMPFILE
+
+echo "<?php # This file has been generated at: " `date` > localized_schema.php
+echo >> localized_schema.php
+cat utils/localized_schema.txt >> localized_schema.php
+echo >> localized_schema.php
+
+cat $TMPFILE | grep -v '^$' | sed "s/.*/__('&');/" >> localized_schema.php
+
+echo "?>" >> localized_schema.php
+
+rm $TMPFILE