Steps to replicate the issue (include links if applicable):
- Set your user language to a language that a chart and data has labels in, other than English (can also be done using uselang)
- Go to a chart on Wikimedia Commons that has labels in both that language and English, for example: https://commons.wikimedia.org/wiki/Data:Swedish_aid.chart?uselang=sv
What happens?:
The axis values and the values on hover are using the language of the user, but the other labels are in English.
What should have happened instead?:
All labels should have been in the user language.
Other information (browser name/version, screenshots, etc.):
This patch's acceptance criteria:
- String localization language in charts on wiki pages should match the target language of the page render (content language by default, page view language if a page has overridden its language), not the user language
- Number formatting localization in charts on the above pages should match the target language of the page render, not the user language
- -> test the above on a Commons page with default English -- strings in English, formatting in English
- -> and one that has been changed to another language via https://commons.wikimedia.org/wiki/Special:PageLanguage (requires admin) -- strings in other language, formatting in other language
See also follow-up patches on T392725;

