Xml::closeElement( 'form' );
if ( $wgUser->isAllowed( 'editinterface' ) ) {
- $title = Title::makeTitle( NS_MEDIAWIKI, 'Filedelete-reason-dropdown' );
+ $title = wfMessage( 'filedelete-reason-dropdown' )->inContentLanguage()->getTitle();
$link = Linker::link(
$title,
wfMessage( 'filedelete-edit-reasonlist' )->escaped(),
return new self( $keys );
}
+ /**
+ * Get a title object for a mediawiki message, where it can be found in the mediawiki namespace.
+ * The title will be for the current language, if the message key is in
+ * $wgForceUIMsgAsContentMsg it will be append with the language code (except content
+ * language), because Message::inContentLanguage will also return in user language.
+ *
+ * @see $wgForceUIMsgAsContentMsg
+ * @return Title
+ * @since 1.26
+ */
+ public function getTitle() {
+ global $wgContLang, $wgForceUIMsgAsContentMsg;
+
+ $code = $this->language->getCode();
+ $title = $this->key;
+ if (
+ $wgContLang->getCode() !== $code
+ && in_array( $this->key, (array)$wgForceUIMsgAsContentMsg )
+ ) {
+ $title .= '/' . $code;
+ }
+
+ return Title::makeTitle( NS_MEDIAWIKI, $wgContLang->ucfirst( strtr( $title, ' ', '_' ) ) );
+ }
+
/**
* Adds parameters to the parameter list of this message.
*
$out .= Xml::closeElement( 'fieldset' );
if ( $user->isAllowed( 'editinterface' ) ) {
- $title = Title::makeTitle( NS_MEDIAWIKI, 'Protect-dropdown' );
$link = Linker::link(
- $title,
+ $context->msg( 'protect-dropdown' )->inContentLanguage()->getTitle(),
$context->msg( 'protect-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )
Xml::closeElement( 'form' );
if ( $user->isAllowed( 'editinterface' ) ) {
- $dropdownTitle = Title::makeTitle( NS_MEDIAWIKI, 'Deletereason-dropdown' );
$link = Linker::link(
- $dropdownTitle,
+ $ctx->msg( 'deletereason-dropdown' )->inContentLanguage()->getTitle(),
wfMessage( 'delete-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )
# Link to edit the block dropdown reasons, if applicable
if ( $user->isAllowed( 'editinterface' ) ) {
$links[] = Linker::link(
- Title::makeTitle( NS_MEDIAWIKI, 'Ipbreason-dropdown' ),
+ $this->msg( 'ipbreason-dropdown' )->inContentLanguage()->getTitle(),
$this->msg( 'ipb-edit-dropdown' )->escaped(),
array(),
array( 'action' => 'edit' )
Xml::closeElement( 'form' ) . "\n";
// Show link to edit the dropdown reasons
if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
- $title = Title::makeTitle( NS_MEDIAWIKI, 'Revdelete-reason-dropdown' );
$link = Linker::link(
- $title,
+ $this->msg( 'revdelete-reason-dropdown' )->inContentLanguage()->getTitle(),
$this->msg( 'revdelete-edit-reasonlist' )->escaped(),
array(),
array( 'action' => 'edit' )
if ( $user->isAllowed( 'editinterface' ) ) {
$disp .= ' ';
$editLink = Linker::link(
- Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag" ),
+ $this->msg( "tag-$tag" )->inContentLanguage()->getTitle(),
$this->msg( 'tags-edit' )->escaped()
);
$disp .= $this->msg( 'parentheses' )->rawParams( $editLink )->escaped();
if ( $user->isAllowed( 'editinterface' ) ) {
$desc .= ' ';
$editDescLink = Linker::link(
- Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag-description" ),
+ $this->msg( "tag-$tag-description" )->inContentLanguage()->getTitle(),
$this->msg( 'tags-edit' )->escaped()
);
$desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink )->escaped();
# Add a link to edit MediaWik:Licenses
if ( $this->getUser()->isAllowed( 'editinterface' ) ) {
$licensesLink = Linker::link(
- Title::makeTitle( NS_MEDIAWIKI, 'Licenses' ),
+ $this->msg( 'licenses' )->inContentLanguage()->getTitle(),
$this->msg( 'licenses-edit' )->escaped(),
array(),
array( 'action' => 'edit' )