MediaWiki talk:Wdsearch-autodesc.js: Difference between revisions
Content deleted Content added
→Please ignore claims marked with deprecated rank: new section |
Petr Matas (talk | contribs) →Language selection bugfix: new section |
||
Line 120:
Would you be able to avoid listing claims that are marked with a [https://www.wikidata.org/wiki/Help:Ranking#Deprecated_rank deprecated rank]? Example: P31 for {{Q|1596}}.
Thanks, --[[User:Aeroid|Aeroid]] ([[User talk:Aeroid|talk]]) 06:49, 26 October 2016 (UTC)
== Language selection bugfix ==
{{editprotected}}
There is a bug in this script. If the label in user's language is not present in the Wikidata item, then the first available language is used and the list of fallback languages (introduced by {{u|Magnus Manske}} in [[Special:Diff/600430404|Diff/600430404]]) is ignored.
Fix: Please replace current lines 516–528 with
<nowiki>
if ( v.labels[curlang] === undefined ) { // Try main languages
$.each ( ['en','de','fr','es','it','pl','pt','ja','ru','hu','nl'] , function ( i2 , lang ) {
if ( v.labels[lang] === undefined ) return ;
curlang = lang ;
return false ;
} ) ;
}
if ( v.labels[curlang] === undefined ) { // Take any language
$.each ( v.labels , function ( lang , label ) {
curlang = lang ;
return false ;
} ) ;
}</nowiki>
<span style="font-family:Segoe Script">[[User:Petr Matas|Petr Matas]]</span> 21:29, 27 December 2016 (UTC)
|