[Bug] Language selector in [[Special:NewItem]] doesn't recognize certain languages
Closed, ResolvedPublic

Description

The language selector in [[Special:NewItem]] should of course default to the interface language you use. However, for Norwegian Bokmål users, it currently defaults to Qafár af (Afar, the first one in the list). After some testing it seems this happens for languages with ISO code vs. Wikimedia language code issues, and luckily we can test it using ?uselang:

Incorrect Wikimedia code/Correct code (used as interface language)
no/nb: https://www.wikidata.org/wiki/Special:NewItem?uselang=nb
zh-min-nan/nan: https://www.wikidata.org/wiki/Special:NewItem?uselang=nan
zh-classical/lzh: https://www.wikidata.org/wiki/Special:NewItem?uselang=lzh

jhsoby created this task.Oct 17 2015, 7:31 PM
jhsoby updated the task description. (Show Details)
jhsoby raised the priority of this task from to Needs Triage.
jhsoby added a project: Wikidata.
jhsoby added a subscriber: jhsoby.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 17 2015, 7:31 PM
hoo added a subscriber: hoo.Oct 17 2015, 8:55 PM

We would need to take $wgDummyLanguageCodes into account in order to fix this. That should probably be implemented in WikibaseContentLanguages, in a method named getAlternateLanguageCodes (or so).

@hoo, any idea when this can be fixed/who I can bug to fix it? It's getting annoying having to change the language all the time...

Restricted Application added a subscriber: StudiesWorld. · View Herald TranscriptNov 29 2015, 10:13 PM
jeblad added a subscriber: jeblad.Jan 11 2016, 1:34 PM

This is a minor fix and should be done asap.

hoo added a comment.Feb 4 2016, 1:22 PM

This is not a minor fix we can just apply, but I think we have to look at the bigger picture where we have nb and no (probably) mixed up. Just changing one for the other will probably cause more harm than good. This needs to be investigated.

Lydia_Pintscher renamed this task from Language selector in [[Special:NewItem]] doesn't recognize certain languages to [Bug] Language selector in [[Special:NewItem]] doesn't recognize certain languages.Feb 19 2016, 9:57 AM
Lydia_Pintscher triaged this task as Normal priority.

It is now several months since this bug was first reported, is there any progress?

Cocu awarded a token.Mar 7 2016, 8:26 AM
Cocu added a subscriber: Cocu.
Stigmj added a subscriber: Stigmj.Mar 7 2016, 10:59 AM

Can we get some attention to this bug. This is a very irritating behaviour and discourages any new additions from norwegian users. The language dropdown also seems to the naked eye to be sorted in some strange way. Typing in the language works, but shouldn't be necessary.

I'll look into this. There are various issues around terms languages :/

Nikki added a subscriber: Nikki.Mar 23 2016, 10:16 PM

This also seems problematic for other tools, e.g. as I explained in https://www.wikidata.org/wiki/Topic:Szxlu94k4l8qx7zx, Duplicity doesn't work very well for zh_min_nanwiki right now. To fix it, it would currently need to use "nan" as the language code for the API and "zh-min-nan" for Special:NewItem. It would be better if the same code could be used in both places.

This bug is half a year old now... Any progress??

Any progress?

Kjetil added a subscriber: Kjetil.May 11 2016, 6:40 PM

Any update?

Danmichaelo added a subscriber: Danmichaelo.

Change 291878 had a related patch set uploaded (by Adrian Heine):
Allow all term languages in Special:New*, use combobox

https://gerrit.wikimedia.org/r/291878

Change 291878 merged by jenkins-bot:
Allow all term languages in Special:New*, use combobox

https://gerrit.wikimedia.org/r/291878

adrianheine closed this task as Resolved.Jun 2 2016, 9:44 AM

Fix is merged, might be deployed next week.

@adrianheine Thank you very much!! 😊😊😊

Mika77 added a subscriber: Mika77.EditedJun 24 2016, 4:10 PM

This seems to produce a new bug,
Internal error

[7ec35341] /wiki/index.php/Spezial:Neues_Datenelement_erstellen MWException from line 423 of /var/www/server/wiki/includes/htmlform/HTMLForm.php: Descriptor with no class for lang: Array
(
[name] => lang
[options] => Array
(
[Qafár af (aa)] => aa
[Аҧсшәа (ab)] => ab

[default] => en
[type] => combobox
[id] => wb-newentity-language
[label-message] => wikibase-newentity-language
[class] =>
)

Backtrace:

#0 /var/www/server/wiki/includes/htmlform/HTMLForm.php(443): HTMLForm::getClassFromDescriptor(string, array)
#1 /var/www/server/wiki/includes/htmlform/OOUIHTMLForm.php(43): HTMLForm::loadInputFromParameters(string, array, OOUIHTMLForm)
#2 /var/www/server/wiki/includes/htmlform/HTMLForm.php(318): OOUIHTMLForm::loadInputFromParameters(string, array, OOUIHTMLForm)
#3 /var/www/wiki/includes/htmlform/OOUIHTMLForm.php(31): HTMLForm->construct(array, RequestContext, string)
#4 [internal function]: OOUIHTMLForm->
construct(array, RequestContext)
#5 /var/www/server/wiki/includes/htmlform/HTMLForm.php(265): ReflectionClass->newInstanceArgs(array)
#6 /var/www/server/wiki/extensions/Wikibase/repo/includes/Specials/SpecialNewEntity.php(327): HTMLForm::factory(string, array, RequestContext)
#7 /var/www/server/wiki/extensions/Wikibase/repo/includes/Specials/SpecialNewEntity.php(167): Wikibase\Repo\Specials\SpecialNewEntity->createForm(Message, array)