Page MenuHomePhabricator

[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

Event Timeline

jhsoby raised the priority of this task from to Needs Triage.
jhsoby updated the task description. (Show Details)
jhsoby added a project: Wikidata.
jhsoby subscribed.

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...

This is a minor fix and should be done asap.

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 Medium priority.

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

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 :/

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??

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

Fix is merged, might be deployed next week.

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)