Skip to content

Commit e40c358

Browse files
authored
Add localization support (#2)
1 parent 435e631 commit e40c358

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

localization/en_US.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
$labels = array();
4+
5+
$labels['internal'] = "Mail was internal";
6+
$labels['unencrypted'] = "Message received over an unencrypted connection!";

localization/ru_RU.inc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?php
2+
3+
$labels = array();
4+
5+
$labels['internal'] = "Письмо было внутренним";
6+
$labels['unencrypted'] = "Сообщение получено по незашифрованному соединению!";

tls_icon.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ function init()
1414
$this->add_hook('storage_init', array($this, 'storage_init'));
1515

1616
$this->include_stylesheet('tls_icon.css');
17+
18+
$this->add_texts('localization/');
1719
}
1820

1921
public function storage_init($p)
@@ -23,7 +25,7 @@ public function storage_init($p)
2325
}
2426

2527
public function message_headers($p)
26-
{
28+
{
2729
if($this->message_headers_done===false)
2830
{
2931
$this->message_headers_done = true;
@@ -53,11 +55,11 @@ public function message_headers($p)
5355

5456
$this->icon_img .= '<img class="lock_icon" src="plugins/tls_icon/lock.svg" title="'. htmlentities($data) .'" />';
5557
} else if(preg_match_all('/\([a-zA-Z]*, from userid [0-9]*\)/im', $Received, $items, PREG_PATTERN_ORDER)){
56-
$this->icon_img .= '<img class="lock_icon" src="plugins/tls_icon/blue_lock.svg" title="Mail was internal" />';
58+
$this->icon_img .= '<img class="lock_icon" src="plugins/tls_icon/blue_lock.svg" title="' . $this->gettext('internal') . '" />';
5759
}
5860
else {
5961
// TODO: Mails received from localhost but without TLS are currently flagged insecure
60-
$this->icon_img .= '<img class="lock_icon" src="plugins/tls_icon/unlock.svg" title="Message received over an unencrypted connection!" />';
62+
$this->icon_img .= '<img class="lock_icon" src="plugins/tls_icon/unlock.svg" title="' . $this->gettext('unencrypted') . '" />';
6163
}
6264
}
6365

0 commit comments

Comments
 (0)