From 5acfc11b481b0aad73baaa2be408a97e1041214f Mon Sep 17 00:00:00 2001 From: Sergei Filinov Date: Mon, 12 Jul 2021 17:53:49 +0700 Subject: [PATCH 1/2] added localization support --- easy_unsubscribe.php | 6 ++++-- localization/en_US.inc | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 localization/en_US.inc diff --git a/easy_unsubscribe.php b/easy_unsubscribe.php index 7a7d5fa..42f5847 100644 --- a/easy_unsubscribe.php +++ b/easy_unsubscribe.php @@ -14,6 +14,8 @@ class easy_unsubscribe extends rcube_plugin $this->add_hook('storage_init', array($this, 'storage_init')); $this->include_stylesheet('easy_unsubscribe.css'); + + $this->add_texts('localization/'); } public function storage_init($p) @@ -31,7 +33,7 @@ class easy_unsubscribe extends rcube_plugin $ListUnsubscribe = $p['headers']->others['list-unsubscribe']; if ( preg_match_all('/<(.+)>/mU', $ListUnsubscribe, $items, PREG_PATTERN_ORDER) ) { foreach ( $items[1] as $uri ) { - $this->unsubscribe_img .= 'Unsubscribe'; + $this->unsubscribe_img .= '' . $this->gettext('unsubscribe') . ''; } } } @@ -44,4 +46,4 @@ class easy_unsubscribe extends rcube_plugin return $p; } -} +} \ No newline at end of file diff --git a/localization/en_US.inc b/localization/en_US.inc new file mode 100644 index 0000000..ccdd683 --- /dev/null +++ b/localization/en_US.inc @@ -0,0 +1,7 @@ + Date: Mon, 12 Jul 2021 18:01:36 +0700 Subject: [PATCH 2/2] added Russian localization --- localization/ru_RU.inc | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 localization/ru_RU.inc diff --git a/localization/ru_RU.inc b/localization/ru_RU.inc new file mode 100644 index 0000000..964f96c --- /dev/null +++ b/localization/ru_RU.inc @@ -0,0 +1,7 @@ +