From: Platonides Date: Thu, 12 Aug 2010 12:30:47 +0000 (+0000) Subject: Followup r70783. Give doEditSectionLink an extra parameter with the language to use... X-Git-Tag: 1.31.0-rc.0~35535 X-Git-Url: http://git.cyclocoop.org//%22%22._DIR_PLUGIN_FULLCALENDAR.%22prive/themes/spip/images/event_edit.png/%22?a=commitdiff_plain;h=69ad72018b660216db5b556d6f0c87710f89e243;p=lhc%2Fweb%2Fwiklou.git Followup r70783. Give doEditSectionLink an extra parameter with the language to use for the editsection. --- diff --git a/includes/Linker.php b/includes/Linker.php index 7531b88062..7b3e5a5856 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1375,16 +1375,17 @@ class Linker { * to be included in the link, like "§ion=$section" * @param $tooltip string The tooltip to use for the link: will be escaped * and wrapped in the 'editsectionhint' message + * @param $lang string Language code * @return string HTML to use for edit link */ - public function doEditSectionLink( Title $nt, $section, $tooltip = null ) { + public function doEditSectionLink( Title $nt, $section, $tooltip = null, $lang = false ) { // HTML generated here should probably have userlangattributes // added to it for LTR text on RTL pages $attribs = array(); if( !is_null( $tooltip ) ) { - $attribs['title'] = wfMsg( 'editsectionhint', $tooltip ); + $attribs['title'] = wfMsgReal( 'editsectionhint', array( $tooltip ), true, $lang ); } - $link = $this->link( $nt, wfMsg('editsection'), + $link = $this->link( $nt, wfMsgExt( 'editsection', array( 'language'=> $lang ) ), $attribs, array( 'action' => 'edit', 'section' => $section ), array( 'noclasses', 'known' ) @@ -1394,7 +1395,7 @@ class Linker { # we can rid of it someday. $attribs = ''; if( $tooltip ) { - $attribs = wfMsgHtml( 'editsectionhint', htmlspecialchars( $tooltip ) ); + $attribs = htmlspecialchars( wfMsgReal( 'editsectionhint', array( $tooltip ), true, $lang ) ); $attribs = " title=\"$attribs\""; } $result = null; @@ -1404,13 +1405,13 @@ class Linker { # run, and even add them to hook-provided text. (This is the main # reason that the EditSectionLink hook is deprecated in favor of # DoEditSectionLink: it can't change the brackets or the span.) - $result = wfMsgHtml( 'editsection-brackets', $result ); + $result = wfMsgExt( 'editsection-brackets', array( 'escape', 'replaceafter', 'language'=>$lang ), $link ); return "$result"; } # Add the brackets and the span, and *then* run the nice new hook, with # clean and non-redundant arguments. - $result = wfMsgHtml( 'editsection-brackets', $link ); + $result = wfMsgExt( 'editsection-brackets', array( 'escape', 'replaceafter', 'language'=>$lang ), $link ); $result = "$result"; wfRunHooks( 'DoEditSectionLink', array( $this, $nt, $section, $tooltip, &$result ) ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 8f507997cd..b1f97e5252 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -3967,9 +3967,9 @@ class Parser { if ( $isTemplate ) { # Put a T flag in the section identifier, to indicate to extractSections() # that sections inside should be counted. - $editlink = $sk->doEditSectionLink( Title::newFromText( $titleText ), "T-$sectionIndex" ); + $editlink = $sk->doEditSectionLink( Title::newFromText( $titleText ), "T-$sectionIndex", null, $this->mOptions->getUserLang() ); } else { - $editlink = $sk->doEditSectionLink( $this->mTitle, $sectionIndex, $headlineHint ); + $editlink = $sk->doEditSectionLink( $this->mTitle, $sectionIndex, $headlineHint, $this->mOptions->getUserLang() ); } } else { $editlink = '';