Page MenuHomePhabricator

[regression] wgMonthNames and wgMonthNamesShort are in the wrong language on JavaScript pages
Closed, DeclinedPublic

Description

I'm getting
wgMonthNames = ["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
on https://pt.wikipedia.org/wiki/User:Foo/Bar.js and https://pt.wikipedia.org/wiki/User:Foo/Bar.css but it should be

wgMonthNames = ["", "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"]
as it is on https://pt.wikipedia.org/wiki/User:Foo/Bar.

Why the JS pages are in English instead of the language of the wiki (Portuguese)?
If this was intentional, how can I get the names in Portuguese?

Maybe this was caused by gerrit change I18a53ba0, or the new content handler?


Version: unspecified
Severity: normal

Details

Reference
bz41468

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:50 AM
bzimport set Reference to bz41468.
bzimport added a subscriber: Unknown Object (MLST).

Yes, it's because of gerrit change 14271, because CSS/JS pages are considered to be in English, so the page language is English which makes the month names also in English. So this was more or less intentional.

Do you need them in the wiki language on CSS/JS pages, or is this a "theoretical/supposed" bug?

Maybe we should have a better way to get month names; it probably makes sense to provide them in the user language, wiki content language as wall as the page content language. "wgMonthNames" is a too generic name.

Well, I noticed this when I was reviewing a user script at
https://pt.wikipedia.org/w/index.php?oldid=32552351
and since the author created a "Months" variable to store essentially what is already available at wgMonthNamesShort, I was going to suggest him to use that config variable instead, but when I typed it on console I noticed it didn't work as expected. Hence this bug.

I just ran into a similar problem when I created a script that returns the current date in localized format; it just didn't work in CSS/JS pages.

But I agree with Robin that it is more of a feature than a bug. I'm marking this as WONTFIX.