Topic on Extension talk:ContactPage

Summary by Wgkderdicke

Upcoming change of the extension possibly brings a little bit of normalization, so that no double colon appears there anymore.

Wgkderdicke (talkcontribs)

I just installed this extension here in that wiki there. That wiki runs with German language. I discoverd that the email text comes with a prefix. In German language there comes "Nachricht" (means Message), a double colon and a blank space, followed by the actual text of the email. I was wondering why there comes this odd double colon. I found out that the system message ("Nachricht:") already comes with a colon and SpecialContact.php simply adds another colon whether there is a colon yet or not (line 402 in the 1.31 version of SpecialContact.php). I changed line 402 from

$text .= "{$name}: $value\n"; to
$text .= $name.(substr($name, -1) !== ":" ? ": " : " ").$value."\n";.

That works for me.

BDavis (WMF) (talkcontribs)

This is the emailmessage message string. The English message in languages/i18n/en.json is "Message:" which includes the trailing colon as well. There appear to be a few localized versions of this message in mediawiki/core.git which do not include the trailing colon, but the overwhelming majority of the emailmessage strings do include it. It seems reasonable to actually submit a patch to the extension which assumes that no additional colon needs to be placed in the output between the value of emailmessage and the value entered by the user, or perhaps better to add a normalization step that will ensure that all label messages will end with a colon.

BDavis (WMF) (talkcontribs)
Wgkderdicke (talkcontribs)

Thanks.