From acc4d8b1c3e5a702ab957527d76e359ceae921fb Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 5 Jun 2011 20:51:50 +0200 Subject: [PATCH] Use language specific truncation symbol. Add translator documentation. --- plugins/ShareNotice/ShareNoticePlugin.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/ShareNotice/ShareNoticePlugin.php b/plugins/ShareNotice/ShareNoticePlugin.php index 0cd248e213..08362f7932 100644 --- a/plugins/ShareNotice/ShareNoticePlugin.php +++ b/plugins/ShareNotice/ShareNoticePlugin.php @@ -102,15 +102,18 @@ abstract class GenericNoticeShareTarget extends NoticeShareTarget protected function statusText() { - // TRANS: Leave this message unchanged. + // TRANS: %s is notice content that is shared on Twitter, Facebook or another platform. $pattern = _m('"%s"'); $url = $this->notice->bestUrl(); $suffix = ' ' . $url; $room = $this->maxLength() - mb_strlen($suffix) - (mb_strlen($pattern) - mb_strlen('%s')); $content = $this->notice->content; + // TRANS: Truncation symbol. + $truncation_symbol = _m('…'); + $truncation_symbol_length = mb_strlen($truncation_symbol); if (mb_strlen($content) > $room) { - $content = mb_substr($content, 0, $room - 1) . '…'; + $content = mb_substr($content, 0, $room - $truncation_symbol_length) . $truncation_symbol; } return sprintf($pattern, $content) . $suffix; -- 2.39.5