} if ( $section == 'new' ) {
# Inserting a new section
if ( $sectionTitle ) {
- $subject = wfMsgForContent( 'newsectionheaderdefaultlevel', $sectionTitle ) . "\n\n";
+ $subject = wfMessage( 'newsectionheaderdefaultlevel' )
+ ->inContentLanguage()->params( $sectionTitle )->text();
+ $subject .= "\n\n";
} else {
$subject = '';
}
* @return Content
*/
public function addSectionHeader( $header ) {
- $text = wfMsgForContent( 'newsectionheaderdefaultlevel', $header ) . "\n\n" .
- $this->getNativeData();
+ $text = wfMessage( 'newsectionheaderdefaultlevel' )
+ ->inContentLanguage()->params( $header )->text();
+ $text .= "\n\n";
+ $text .= $this->getNativeData();
return new WikitextContent( $text );
}
}
} elseif ( $this->summary !== '' ) {
// Insert the section title above the content.
- $content = $content->addSectionHeader( $this->sectiontitle );
+ $content = $content->addSectionHeader( $this->summary );
// Jump to the new section
$result['sectionanchor'] = $wgParser->guessLegacySectionNameFromWikiText( $this->summary );