MediaWiki REL1_33
PageLangLogFormatter.php
Go to the documentation of this file.
1<?php
32 protected function getMessageParameters() {
33 // Get the user language for displaying language names
34 $userLang = $this->context->getLanguage()->getCode();
35 $params = parent::getMessageParameters();
36
37 // Get the language codes from log
38 $oldLang = $params[3];
39 $kOld = strrpos( $oldLang, '[' );
40 if ( $kOld ) {
41 $oldLang = substr( $oldLang, 0, $kOld );
42 }
43
44 $newLang = $params[4];
45 $kNew = strrpos( $newLang, '[' );
46 if ( $kNew ) {
47 $newLang = substr( $newLang, 0, $kNew );
48 }
49
50 // Convert language codes to names in user language
51 $logOld = Language::fetchLanguageName( $oldLang, $userLang )
52 . ' (' . $oldLang . ')';
53 $logNew = Language::fetchLanguageName( $newLang, $userLang )
54 . ' (' . $newLang . ')';
55
56 // Add the default message to languages if required
57 $params[3] = !$kOld ? $logOld : $logOld . ' [' . $this->msg( 'default' ) . ']';
58 $params[4] = !$kNew ? $logNew : $logNew . ' [' . $this->msg( 'default' ) . ']';
59 return $params;
60 }
61}
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
Implements the default log formatting.
msg( $key)
Shortcut for wfMessage which honors local context.
This class formats language change log entries.
getMessageParameters()
Formats parameters intented for action message from array of all parameters.
$params