Jump to content

MediaWiki talk:Wdsearch.js

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Kizar (talk | contribs) at 12:50, 14 December 2013 (→‎es). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Screenshot of the Earth test search, with this script adding links to Wikidata, Reasonator, Commons, and Wikipedia.

See screenshot at right. See more info via Magnus and Gerard.

USAGE

On en.wikipedia, add the following line to your common.js page:

importScript('MediaWiki:Wdsearch.js');

On other Wikipedias, add this line, instead:

mw.loader.load("//en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript");

Translations

To change the header line to your language: add the appropriate line below, and request an admin to update the script.

pt and pt-BR

Hi!

Could you add the following translations?

		'pt' : {
			'header' : 'Resultados da busca no Wikidata'
		} ,
		'pt-br' : {
			'header' : 'Resultados da busca no Wikidata'
		}

Helder 17:07, 9 November 2013 (UTC)[reply]

 Done - Hoo man (talk) 10:41, 11 November 2013 (UTC)[reply]

Updated version:

		'pt' : {
			'commons_cat' : 'Categoria no Commons' ,
			'wikipedias' : 'Artigos da Wikipédia' ,
			'header' : 'Resultados da busca no Wikidata'
		},
		'pt-br' : {
			'commons_cat' : 'Categoria no Commons' ,
			'wikipedias' : 'Artigos da Wikipédia' ,
			'header' : 'Resultados da busca no Wikidata'
		},

Helder 09:15, 5 December 2013 (UTC)[reply]

 DoneMr. Stradivarius ♪ talk ♪ 10:03, 5 December 2013 (UTC)[reply]

it

Please add Italian translation "Categoria in Commons", "Voci di Wikipedia", "Risultati da Wikidata". --Nemo 11:37, 17 November 2013 (UTC)[reply]

 Done - Hoo man (talk) 16:41, 17 November 2013 (UTC)[reply]

fr

Could you add the French translation: "Catégorie sur Commons", "Articles sur Wikipédia" and "Résultats sur Wikidata"? Thanks. --Coyau (talk) 10:51, 18 November 2013 (UTC)[reply]

 Done --Magnus Manske (talk) 13:58, 2 December 2013 (UTC)[reply]

el

Please add Greek (el) translation:

'el' : {
	 'commons_cat' : 'Κατηγορία στα Commons' ,
	 'wikipedias' : 'Λήμματα στη Βικιπαίδεια' ,
	 'header' : 'Αποτελέσματα αναζήτησης στα Wikidata'

Also in autodesc.js:

	stock : {
		'no_auto_content' : { en:'Cannot determine auto-content' } ,
		'generating_auto_content' : { en:'Generating auto-content...' , de:'Erzeuge automatische Beschreibung...' } ,
		'query_error' : { en:'Query error' , de:'Abfrage-Fehler' } ,
		'not_found' : { en:'Not found' , de:'Nicht gefunden', el:'Δεν βρέθηκε' } , 
		'cannot_describe' : { en:'Cannot auto-describe' , de:'Automatische Beschreibung nicht verfΓΌgbar', el:'Δεν μπορεί να περιγραφεί' } , 
		'disambig' : { en:'Wikipedia disambiguation page' , de:'Wikipedia-BegriffsklΓ€rungsseite', el:'Σελίδα αποσαφήνισης στη Βικιπαίδεια' } ,
		'person' : { en:'person' , de:'Person', el:'Πρόσωπο' } ,
		'in' : { en:'in', el:'στο' } ,
		'by' : { en:'by' , de:'von', el:'του' } ,
		'for' : { en:'for' , de:'fΓΌr', el:'για' } ,
		'from' : { en:'from' , de:'von', el:'από' } ,
		'part of' : { en:'part of' , de:'Teil von', el:'μέρος του' } ,
		'member of' : { en:'member of' , de:'Mitglied von', el:'μέλος του' } ,
		'named after' : { en:'named after' , de:'benannt nach' } ,
		'child of' : { en:'child of' , de:'Kind von', el:'τέκνο του' } ,
		'spouse of' : { en:'spouse of' , de:'verheiratet mit', el:'σύζυγος του' } ,
		'location' : { en:'Location' , de:'LokalitΓ€t', el:'Τοποθεσία' } ,
		'BC' : { en:'BC', el:'π.Χ.' }
	} ,

and

language_specific : {
....
		el : {
			'nationality' : { 'Ελλάδα':'Έλληνας', 'Ρωσία':'Ρώσος','Δανία':'Δανός','Νορβηγία':'Νορβηγός','Ολλανδία':'Ολλανδός','Γερμανία':'Γερμανός', 'Χιλή':'Χιλιανός','Βραζιλία':'Βραζιλιάνος', 'Γαλλία':'Γάλλος', 'Αγγλία':'Άγγλος', 'Ηνωμένο Βασίλειο':'Βρετανός', 'Ηνωμένες Πολιτείες της Αμερικής':'Αμερικανός', 'Ισπανία':'Ισπανός', 'Ιταλία':'Ιταλός', 'Τουρκία':'Τούρκος', 'Βουλγαρία':'Βούλγαρος' }
		}

--geraki TL 11:37, 18 November 2013 (UTC)[reply]

 Done --Magnus Manske (talk) 13:50, 2 December 2013 (UTC)[reply]

sv

Could you please add the following translation?

		'sv' : {
			'commons_cat' : 'Kategorier på Commons' ,
			'wikipedias' : 'Wikipediaartiklar' ,
			'header' : 'Sökresultat från Wikidata'
		} ,

Cheers/ André Costa (WMSE) (talk) 22:52, 20 November 2013 (UTC)[reply]

 Done --Magnus Manske (talk) 13:51, 2 December 2013 (UTC)[reply]

bn

please add the following translation.

'bn' : {
			'commons_cat' : 'কমন্স বিষয়শ্রেণী' ,
			'wikipedias' : 'উইকিপিডিয়া নিবন্ধ' ,
			'header' : 'উইকিউপাত্ত অনুসন্ধানের ফলাফল'
		} ,

--Aftab1995 (talk) 15:24, 3 December 2013 (UTC)[reply]

 Done --Magnus Manske (talk) 00:32, 4 December 2013 (UTC)[reply]

please add following line also.

'reasonator' : 'Reasonator-এ আইটেমের বিস্তারিত দেখাও'

--Aftab1995 (talk) 00:41, 7 December 2013 (UTC)[reply]

 DoneMr. Stradivarius ♪ talk ♪ 10:27, 12 December 2013 (UTC)[reply]

eo

please add the following translation.

		'eo' : {
			'commons_cat' : 'Komuneja kategorio' ,
			'wikipedias' : 'Vikipediaj artikoloj' ,
			'header' : 'Serĉorezultoj de Vikidatumoj' ,
			'reasonator' : 'Montri detalojn en Reasonator'
		} ,

Thanks --KuboF (talk) 22:39, 5 December 2013 (UTC)[reply]

 DoneMr. Stradivarius ♪ talk ♪ 10:27, 12 December 2013 (UTC)[reply]

sk

please add the following translation.

		'sk' : {
			'commons_cat' : 'Kategória na Commons' ,
			'wikipedias' : 'Články na Wikipédii' ,
			'header' : 'Výsledky hľadania na Wikiúdajoch' ,
			'reasonator' : 'Zobraziť podrobnosti v Reasonatore'
		} ,

Thanks --KuboF (talk) 22:39, 5 December 2013 (UTC)[reply]

 DoneMr. Stradivarius ♪ talk ♪ 10:27, 12 December 2013 (UTC)[reply]

he

please add the following translation for the hebrew wikipedia:

	'he' : {
		'commons_cat': 'קטגוריית ויקישיתוף',
		'wikipedias': 'ערכים בוויקיפדיה',
		'header': 'תוצאות חיפוש בוויקינתונים'
	}

Thanks, קובי כרמל (talk) 09:33, 12 December 2013 (UTC)[reply]

 DoneMr. Stradivarius ♪ talk ♪ 10:27, 12 December 2013 (UTC)[reply]

ilo

Please add the following Ilokano translations.

'ilo' : {
	 'commons_cat' : 'Kategoria ti Commons' ,
	 'wikipedias' : 'Dagiti artikulo ti Wikipedia' ,
	 'header' : 'Dagiti resulta ti panagbiruk iti Wikidata' ,
	 'reasonator' : 'Ipakita dagiti salaysay ti banag iti Reasonator'
},

Thanks. Lam-ang (talk) 15:56, 12 December 2013 (UTC)[reply]

Minor correction--Lam-ang (talk) 18:57, 12 December 2013 (UTC)[reply]

 DoneMr. Stradivarius ♪ talk ♪ 21:47, 12 December 2013 (UTC)[reply]

eu

Please add the Basque translation:

'eu' : {
			'commons_cat' : 'Commonseko kategoria' ,
			'wikipedias' : 'Wikipediako artikuluak' ,
			'header' : 'Wikidatako bilaketaren emaitzak' ,
			'reasonator' : 'Erakutsi Reasonatorreko xehetasunak'
		} ,

Thank you. --Xabier Armendaritz(talk) 21:39, 12 December 2013 (UTC)[reply]

 Done --Magnus Manske (talk) 10:46, 13 December 2013 (UTC)[reply]

ru

Please add the Russian translation:

'ru' : {
			'commons_cat' : 'Категория Викисклада' ,
			'wikipedias' : 'Статьи Википедии' ,
			'header' : 'Результаты поиска в Викиданных' ,
			'reasonator' : 'Посмотреть подробности через Reasonator'
		},

Thank you. --Kaganer (talk) 12:26, 13 December 2013 (UTC)[reply]

 Done thank you. Callanecc (talkcontribslogs) 12:33, 13 December 2013 (UTC)[reply]

zh

Please add the Chinese translation:

'zh' : {
			'commons_cat' : '维基共享资源类别' ,
			'wikipedias' : '维基百科文章' ,
			'header' : '维基数据搜索结果' ,
			'reasonator' : '上Reasonator显示项目的详细信息'
		},

Thanks. Jianhui67 talkcontribs 19:50, 13 December 2013 (UTC)[reply]

es

Spanish translation:

		'es' : {
			'commons_cat' : 'Categoría en Commons' ,
			'wikipedias' : 'Artículos en Wikipedia' ,
			'header' : 'Resultados de la búsqueda en Wikidata' ,
			'reasonator' : 'Mostrar los detalles en Reasonator'
		},

Thanks. --Kizar (talk) 12:49, 14 December 2013 (UTC)[reply]

Deprecated code

The function addOnloadHook (used at autodesc.js) was deprecated and now causes a warning in the console. Could you replace it by its jQuery equivalent? Helder 17:07, 9 November 2013 (UTC)[reply]

@Helder.wiki: please can you describe the exact change you are requesting? I'm not familiar with javascript. — Martin (MSGJ · talk) 12:51, 21 November 2013 (UTC)[reply]
Hmm, since this code is on Labs, only Magnus Manske can fix it (by replacing addOnloadHook -> $). Helder 12:58, 21 November 2013 (UTC)[reply]
Done, please check if I broke it... --Magnus Manske (talk) 13:54, 2 December 2013 (UTC)[reply]

Script error

Hi, I would like to report a script error. With this search: [1] I see this error in the browser error console: "Error: TypeError: v.claims is undefined Source File: https://en.wikipedia.org/w/index.php?title=MediaWiki:Wdsearch.js&action=raw&ctype=text/javascript Line: 145". Nice tool btw. --Rotpunkt (talk) 20:14, 26 November 2013 (UTC)[reply]

 Done - Hoo man (talk) 22:44, 28 November 2013 (UTC)[reply]
Thanks. Now I have another error at line 151 (TypeError: v.labels is undefined). I think it's just a cut&paste error, it should be:
if ( undefined !== v.labels && undefined !== v.labels[wgUserLanguage] ) { // Label

instead of:

if ( undefined !== v.descriptions && undefined !== v.labels[wgUserLanguage] ) { // Label
--Rotpunkt (talk) 13:11, 2 December 2013 (UTC)[reply]
Thanks, fixed! --Magnus Manske (talk) 13:55, 2 December 2013 (UTC)[reply]

Don't load external JS

Can we store the JavaScript currently being pulled from tool labs on wiki somewhere? If we enable this as a gadget, we could set it as a dependency so it gets loaded via ResourceLoader. Legoktm (talk) 07:34, 4 December 2013 (UTC)[reply]

 Done Legoktm (talk) 06:24, 5 December 2013 (UTC)[reply]

mw.loader.using

All of the $.dialog calls should be wrapped in mw.loader.using('jquery.ui.dialog', function() { stuff } ); just to be extra safe. Legoktm (talk) 07:35, 4 December 2013 (UTC)[reply]

Script disabled

The script has been disabled for the line: "importScriptURI("https://tools.wmflabs.org/wikidata-todo/autodesc.js");" that it's executed for each visitor on wikipedia when this script is called from a global common.js. Is it possible to move that script autodesc.js somewhere else? and/or refactor a bit that import stuff? --Rotpunkt (talk) 21:09, 4 December 2013 (UTC)[reply]

Yes. I'll update it with [2] which fixes the issue once labs stabilizes a bit. Legoktm (talk) 21:47, 4 December 2013 (UTC)[reply]
 Done a while back. Legoktm (talk) 06:24, 5 December 2013 (UTC)[reply]
Thanks! --Rotpunkt (talk) 09:38, 5 December 2013 (UTC)[reply]

More robust appending to noarticletext

I'm told that the script doesn't display anything with s:it:MediaWiki:Noarticletext because it doesn't include a table element. I see pl:MediaWiki:Noarticletext doesn't either, nor the default, and this is probably why I don't see anything added to pl:Salticoididae and lb:Salticoididae. Ideas? --Nemo 06:21, 13 December 2013 (UTC)[reply]