Test.wikipedia.org is on the main cluster and uses Commons as its shared repository, and allows us to test MediaSearch in a non-Commons production equivalent environment, allowing rapid deployment and testing without requiring a community to be our guinea pig.
However, on test wikipedia, the interface language is given as "test", not as any actual interface language. That's likely a bug with test wikipedia. If we can deal with that error handling in MediaSearch - e.g, see if this language is a valid language - then we can handle it gracefully and provide a default value (English).
(Replicated on test.wikipedia.org)
RangeError: Incorrect locale information provided
at Number.toLocaleString (<anonymous>)
at VueComponent.resultsCount ()
resultsCount: function () { return this.$i18n( 'mediasearch-results-count', this.totalHits[ this.mediaType ].toLocaleString( mw.config.get( 'wgUserLanguage' ) ) ); },
Seems we are assuming the value of mw.config.get('wgUserLanguage') is always going to be a valid arg for toLocaleString(). Unfortunately test wiki is returning:
mw.config.get('wgUserLanguage')
"test"
Acceptance Criteria:
- Implement error handling in MediaSearch to determine if the interface language is valid
- Fail gracefully if the language is invalid and default to English
- Determine if there are other production-level issues this uncovers, and create tickets for them