summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-03-01 14:26:59 +0300
committerAndrew Dolgov <[email protected]>2019-03-01 14:26:59 +0300
commit51777e75e843bab05b6fdce5fead6cd0bf46ee97 (patch)
tree307c903fabaae2512e2527b541de1f1d53adade1
parent1b00f4043083d17bc128c0bc616d61955e47ea12 (diff)
add gettext stuff
-rw-r--r--init.js2
-rw-r--r--init.php10
-rw-r--r--locale/ru_RU/LC_MESSAGES/time_to_read.mobin0 -> 712 bytes
-rw-r--r--locale/ru_RU/LC_MESSAGES/time_to_read.po28
-rw-r--r--locale/ru_RU/LC_MESSAGES/time_to_read.po~26
-rw-r--r--time_to_read.pot26
-rwxr-xr-xupdate-translations.sh28
7 files changed, 119 insertions, 1 deletions
diff --git a/init.js b/init.js
index abfc805..129571b 100644
--- a/init.js
+++ b/init.js
@@ -10,7 +10,7 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
const pr = document.createElement("span");
pr.className = 'time-to-read insensitive';
- pr.innerHTML = "Time to read: ~" + ttr + " minutes.";
+ pr.innerHTML = __("Time to read: ~%s minutes.").replace("%s", ttr);
row.querySelector(".titleWrap").appendChild(pr);
}
diff --git a/init.php b/init.php
index 8103739..33224f3 100644
--- a/init.php
+++ b/init.php
@@ -11,6 +11,7 @@ class Time_to_Read extends Plugin {
function init($host) {
$this->host = $host;
+ //$host->add_hook($host::HOOK_PREFS_TAB, $this);
}
function get_js() {
@@ -25,4 +26,13 @@ class Time_to_Read extends Plugin {
return 2;
}
+ /*function hook_prefs_tab($args) {
+ if ($args != "prefPrefs") return;
+
+ print "<div dojoType='dijit.layout.AccordionPane'
+ title=\"<i class='material-icons'>photo</i> ".P__($this, 'Test-Test')."\">";
+
+ print "</div>";
+
+ }*/
}
diff --git a/locale/ru_RU/LC_MESSAGES/time_to_read.mo b/locale/ru_RU/LC_MESSAGES/time_to_read.mo
new file mode 100644
index 0000000..47133ce
--- /dev/null
+++ b/locale/ru_RU/LC_MESSAGES/time_to_read.mo
Binary files differ
diff --git a/locale/ru_RU/LC_MESSAGES/time_to_read.po b/locale/ru_RU/LC_MESSAGES/time_to_read.po
new file mode 100644
index 0000000..add0d50
--- /dev/null
+++ b/locale/ru_RU/LC_MESSAGES/time_to_read.po
@@ -0,0 +1,28 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: tt-rss git\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-02-22 06:58+0300\n"
+"PO-Revision-Date: 2019-02-07 14:36+0000\n"
+"Last-Translator: Nikolay Korotkiy <[email protected]>\n"
+"Language-Team: Russian <https://weblate.tt-rss.org/projects/tt-rss/messages/ru/>\n"
+"Language: ru_RU\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
+"X-Generator: Weblate 3.3\n"
+
+#: init.php:33
+msgid "Test-Test"
+msgstr "Тест-Тест"
+
+#: init.js:13
+msgid "Time to read: ~%s minutes."
+msgstr "Время чтения: ~%s минут(ы)"
diff --git a/locale/ru_RU/LC_MESSAGES/time_to_read.po~ b/locale/ru_RU/LC_MESSAGES/time_to_read.po~
new file mode 100644
index 0000000..ed0742c
--- /dev/null
+++ b/locale/ru_RU/LC_MESSAGES/time_to_read.po~
@@ -0,0 +1,26 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 1.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-03-01 13:37+0300\n"
+"PO-Revision-Date: 2019-03-01 13:17+0300\n"
+"Last-Translator: Andrew Dolgov <[email protected]>\n"
+"Language-Team: Russian <[email protected]>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.php:33
+msgid "Test"
+msgstr "Тест"
+
+#: init.js:13
+msgid "Time to read: ~%s minutes."
+msgstr "Время чтения: ~%s минут(ы)"
diff --git a/time_to_read.pot b/time_to_read.pot
new file mode 100644
index 0000000..64a9001
--- /dev/null
+++ b/time_to_read.pot
@@ -0,0 +1,26 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2019-03-01 14:08+0300\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <[email protected]>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: init.php:33
+msgid "Test-Test"
+msgstr ""
+
+#: init.js:13
+msgid "Time to read: ~%s minutes."
+msgstr ""
diff --git a/update-translations.sh b/update-translations.sh
new file mode 100755
index 0000000..8539e83
--- /dev/null
+++ b/update-translations.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+TEMPLATE=time_to_read.pot
+
+xgettext -kT_js_decl -kT_sprintf -k_ngettext:1,2 -kT_ngettext:1,2 -k__ -L PHP -o $TEMPLATE *.php
+
+xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Perl -j -o $TEMPLATE *.js
+
+xgettext --from-code utf-8 -k__ -kNotify.info -kNotify.error -kNotify.progress -kngettext -L Java -j -o $TEMPLATE *.js
+
+
+update_lang() {
+ if [ -f $1.po ]; then
+ msgmerge --no-wrap --width 1 -U $1.po $TEMPLATE
+ msgfmt --statistics $1.po -o $1.mo
+ else
+ echo "Usage: $0 [-p|<basename>]"
+ fi
+}
+
+LANGS=`find locale -name 'time_to_read.po'`
+
+for lang in $LANGS; do
+ echo Updating $lang...
+ PO_BASENAME=`echo $lang | sed s/.po//`
+ update_lang $PO_BASENAME
+done
+
+#./utils/update-js-translations.sh