Remove unused lang argument from Dialog.updateParamDetailsLanguage

It's always `this.language` anyway.

Change-Id: Iaad6db9c5406c36307e827416ab8c08d80003f8b
This commit is contained in:
thiemowmde 2023-09-14 17:36:03 +02:00
parent 9eb2e46f37
commit 61ac3f9645

View file

@ -704,7 +704,7 @@ Dialog.prototype.onLanguageDropdownWidgetSelect = function ( item ) {
this.repopulateParamSelectWidget();
// Update the parameter detail page
this.updateParamDetailsLanguage( this.language );
this.updateParamDetailsLanguage();
this.emit( 'change-language', this.language );
}
@ -1226,20 +1226,16 @@ Dialog.prototype.createParamDetails = function () {
paramFieldset.$element.append( this.propFieldLayout[ property ].$element );
}
// Update parameter property fields with languages
this.updateParamDetailsLanguage( this.language );
this.updateParamDetailsLanguage();
return paramFieldset.$element;
};
/**
* Update the labels for parameter property inputs that include language, so
* they show the currently used language.
*
* @param {string} [lang] Language. If not used, will use currently defined
* language.
*/
Dialog.prototype.updateParamDetailsLanguage = function ( lang ) {
Dialog.prototype.updateParamDetailsLanguage = function () {
var languageProps = Model.static.getPropertiesWithLanguage();
lang = lang || this.language;
for ( var i = 0; i < languageProps.length; i++ ) {
var prop = languageProps[ i ];
@ -1259,9 +1255,9 @@ Dialog.prototype.updateParamDetailsLanguage = function ( lang ) {
// * templatedata-modal-table-param-suggested
// * templatedata-modal-table-param-suggestedvalues
// * templatedata-modal-table-param-type
var label = mw.msg( 'templatedata-modal-table-param-' + prop, lang );
var label = mw.msg( 'templatedata-modal-table-param-' + prop, this.language );
this.propFieldLayout[ prop ].setLabel( label );
this.propInputs[ prop ].$input.attr( { lang: lang, dir: 'auto' } );
this.propInputs[ prop ].$input.attr( { lang: this.language, dir: 'auto' } );
}
};