Merge branch 'master' of git.tt-rss.org:fox/tt-rss

master
Andrew Dolgov 6 years ago
commit 79945082b3

@ -1,4 +1,18 @@
<?php
/* gettext helpers for plugins */
function P__($plugin, $msgid) {
return P_gettext($plugin, $msgid);
}
function P_gettext($plugin, $msgid) {
return _dgettext(PLuginHost::object_to_domain($plugin), $msgid);
}
function P_ngettext($plugin, $singular, $plural, $number) {
return _dngettext(PLuginHost::object_to_domain($plugin), $singular, $plural, $number);
}
class PluginHost {
private $pdo;
private $hooks = array();
@ -63,6 +77,10 @@ class PluginHost {
const KIND_SYSTEM = 2;
const KIND_USER = 3;
static function object_to_domain($plugin) {
return strtolower(get_class($plugin));
}
function __construct() {
$this->pdo = Db::pdo();
@ -211,6 +229,11 @@ class PluginHost {
continue;
}
if (file_exists(dirname($file) . "/locale")) {
_bindtextdomain($class, dirname($file) . "/locale");
_bind_textdomain_codeset($class, "UTF-8");
}
$this->last_registered = $class;
switch ($kind) {

@ -932,6 +932,26 @@ body.ttrss_utility .alert .close {
line-height: 20px;
cursor: pointer;
}
body.ttrss_main .pull-right,
body.ttrss_utility .pull-right {
float: right;
}
body.ttrss_main .pull-left,
body.ttrss_utility .pull-left {
float: left;
}
body.ttrss_main .text-error,
body.ttrss_utility .text-error {
color: #b94a48;
}
body.ttrss_main .text-info,
body.ttrss_utility .text-info {
color: #3a87ad;
}
body.ttrss_main .text-success,
body.ttrss_utility .text-success {
color: #468847;
}
body.ttrss_main .alert,
body.ttrss_utility .alert,
body.ttrss_main .alert h4,

File diff suppressed because one or more lines are too long

@ -1109,6 +1109,26 @@ body.ttrss_main, body.ttrss_utility {
}
}
.pull-right {
float : right;
}
.pull-left {
float : left;
}
.text-error {
color: #b94a48;
}
.text-info {
color: #3a87ad;
}
.text-success {
color: #468847;
}
.alert,
.alert h4 {
color: #c09853;

@ -141,7 +141,6 @@
}
_bindtextdomain("messages", "locale");
_textdomain("messages");
_bind_textdomain_codeset("messages", "UTF-8");
}
@ -2403,7 +2402,10 @@
return __((parseInt(n) > 1) ? msg2 : msg1);
}';
$l10n = _get_reader();
global $text_domains;
foreach (array_keys($text_domains) as $domain) {
$l10n = _get_reader($domain);
for ($i = 0; $i < $l10n->total; $i++) {
$orig = $l10n->get_original_string($i);
@ -2412,10 +2414,12 @@
print T_js_decl($key[0], _ngettext($key[0], $key[1], 1)); // Singular
print T_js_decl($key[1], _ngettext($key[0], $key[1], 2)); // Plural
} else {
$translation = __($orig);
$translation = _dgettext($domain,$orig);
print T_js_decl($orig, $translation);
}
}
}
}
function get_theme_path($theme) {

@ -933,6 +933,26 @@ body.ttrss_utility .alert .close {
line-height: 20px;
cursor: pointer;
}
body.ttrss_main .pull-right,
body.ttrss_utility .pull-right {
float: right;
}
body.ttrss_main .pull-left,
body.ttrss_utility .pull-left {
float: left;
}
body.ttrss_main .text-error,
body.ttrss_utility .text-error {
color: #b94a48;
}
body.ttrss_main .text-info,
body.ttrss_utility .text-info {
color: #3a87ad;
}
body.ttrss_main .text-success,
body.ttrss_utility .text-success {
color: #468847;
}
body.ttrss_main .alert,
body.ttrss_utility .alert,
body.ttrss_main .alert h4,

File diff suppressed because one or more lines are too long

@ -933,6 +933,26 @@ body.ttrss_utility .alert .close {
line-height: 20px;
cursor: pointer;
}
body.ttrss_main .pull-right,
body.ttrss_utility .pull-right {
float: right;
}
body.ttrss_main .pull-left,
body.ttrss_utility .pull-left {
float: left;
}
body.ttrss_main .text-error,
body.ttrss_utility .text-error {
color: #b94a48;
}
body.ttrss_main .text-info,
body.ttrss_utility .text-info {
color: #3a87ad;
}
body.ttrss_main .text-success,
body.ttrss_utility .text-success {
color: #468847;
}
body.ttrss_main .alert,
body.ttrss_utility .alert,
body.ttrss_main .alert h4,

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save