summaryrefslogtreecommitdiff
path: root/classes/plugin.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-03-05 10:26:23 +0300
committerAndrew Dolgov <[email protected]>2019-03-05 10:26:23 +0300
commit614a4b3b4a0831098217f1d3a66c3d98d2e16db1 (patch)
tree3f4f69bae92413778be0f5ab2bd2a6087ea1ff39 /classes/plugin.php
parentc1175070a2ef0b6d40a4a3c10063cc615780d06e (diff)
pluginhost: remove plugin gettext helpers (moved to plugin base class)
Diffstat (limited to 'classes/plugin.php')
-rw-r--r--classes/plugin.php19
1 files changed, 18 insertions, 1 deletions
diff --git a/classes/plugin.php b/classes/plugin.php
index b90c603b7..5ac4a6a9a 100644
--- a/classes/plugin.php
+++ b/classes/plugin.php
@@ -40,4 +40,21 @@ abstract class Plugin {
function api_version() {
return Plugin::API_VERSION_COMPAT;
}
-} \ No newline at end of file
+
+ /* gettext-related helpers */
+
+ function __($msgid) {
+ return _dgettext(PluginHost::object_to_domain($this), $msgid);
+ }
+
+ function _ngettext($singular, $plural, $number) {
+ return _dngettext(PluginHost::object_to_domain($this), $singular, $plural, $number);
+ }
+
+ function T_sprintf() {
+ $args = func_get_args();
+ $msgid = array_shift($args);
+
+ return vsprintf($this->__($msgid), $args);
+ }
+}