mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-23 22:13:34 +00:00
Parse a message correctly
Follow-up to I2495fe32c2d540be50450d715b049173f2f8727d Done with the help of Matma Rex at Wikimedia Hackathon 2024. Bug: T361103 Change-Id: Ica328233cb6172277e66d2341cfb53f87f8aff67
This commit is contained in:
parent
f049c5f76a
commit
3ab0128bfd
|
@ -84,8 +84,10 @@ ve.ui.MWLanguageVariantNodeContextItem.prototype.renderBody = function () {
|
|||
|
||||
function languageNameIfKnown( code ) {
|
||||
return ve.init.platform.hasLanguageCode( code ) ?
|
||||
ve.init.platform.getLanguageName( code ) :
|
||||
ve.msg( 'visualeditor-mwlanguagevariantcontextitem-rule-invalid-language-label' );
|
||||
mw.html.escape( ve.init.platform.getLanguageName( code ) ) :
|
||||
mw.message(
|
||||
'visualeditor-mwlanguagevariantcontextitem-rule-invalid-language-label'
|
||||
).parse();
|
||||
}
|
||||
|
||||
switch ( type ) {
|
||||
|
@ -106,7 +108,8 @@ ve.ui.MWLanguageVariantNodeContextItem.prototype.renderBody = function () {
|
|||
|
||||
$table
|
||||
.append( $( '<tr>' )
|
||||
.append( $( '<td>' ).text( name ).attr( 'lang', code ) )
|
||||
// eslint-disable-next-line no-jquery/no-html
|
||||
.append( $( '<td>' ).html( name ).attr( 'lang', code ) )
|
||||
.append( $( '<td>' ).text( code ) )
|
||||
);
|
||||
} );
|
||||
|
@ -137,7 +140,8 @@ ve.ui.MWLanguageVariantNodeContextItem.prototype.renderBody = function () {
|
|||
name = languageNameIfKnown( code.toLowerCase() );
|
||||
$table
|
||||
.append( $( '<tr>' )
|
||||
.append( $( '<td>' ).text( name ).attr( 'lang', code ) )
|
||||
// eslint-disable-next-line no-jquery/no-html
|
||||
.append( $( '<td>' ).html( name ).attr( 'lang', code ) )
|
||||
.append( $( '<td>' ).text( code ) )
|
||||
.append( $fromText )
|
||||
.append( $toText )
|
||||
|
@ -167,7 +171,8 @@ ve.ui.MWLanguageVariantNodeContextItem.prototype.renderBody = function () {
|
|||
);
|
||||
$table
|
||||
.append( $( '<tr>' )
|
||||
.append( $( '<td>' ).text( name ).attr( 'lang', code ) )
|
||||
// eslint-disable-next-line no-jquery/no-html
|
||||
.append( $( '<td>' ).html( name ).attr( 'lang', code ) )
|
||||
.append( $( '<td>' ).text( code ) )
|
||||
.append( $text )
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue