As a Wikidata editor, I want to see the termbox in all the languages that I’ve declared in my babel, as well as in the user interface language (if that’s not already in the babel).
Problem:
Since 2014 (I38cc93a9db, rEWBAf1f23c217189: Integrated fingerprintgroupview into entityview), Wikibase has had code similar to this determining the languages for the termbox (and possibly other places, not sure what else uses them):
var userLanguages = mw.config.get( 'wbUserSpecifiedLanguages', [] ), isUlsDefined = mw.uls && $.uls && $.uls.data, languages; if ( !userLanguages.length && isUlsDefined ) { languages = mw.uls.getFrequentLanguageList().slice( 1, 4 ); } else { languages = userLanguages.slice(); languages.splice( userLanguages.indexOf( mw.config.get( 'wgUserLanguage' ) ), 1 ); } languages = filterInvalidTermsLanguages( languages ); languages.unshift( mw.config.get( 'wgUserLanguage' ) );
If the wbUserSpecifiedLanguages don’t include the wgUserLanguage, then userLanguages.indexOf( mw.config.get( 'wgUserLanguage' ) ) will return -1, and the splice() call will remove the last element of the array (an arbitrary language), instead of (as intended) the user interface language (to be added to the front of the array with the unshift() call below).
Example:
Q42?uselang=en-gb (assuming your babel doesn’t include en-gb; see also T297393#7910267.
Screenshots/mockups:
Original termbox, before JS runs:
JS-updated termbox, now without Portuguese:
BDD
GIVEN
AND
WHEN
AND
THEN
AND
Acceptance criteria:
Open questions: