User talk:Yair rand/WikidataInfo.js/Archive 1

Latest comment: 2 years ago by Jon Harald Søby in topic wgWikibaseItemId

Italian translation

Thank you. Raoli (talk) 16:32, 12 November 2012 (UTC)

    'it': {
      notfound: "Elemento di Wikidata non trovato.",
      intro: "Wikidata: ",
      nolabel: "(Nessuna etichetta)",
      nodescription: "Nessuna descrizione fornita",
      aliases: "Alias: ",
      noaliases: "Nessuno"
    }
Added to the script, thanks. --Yair rand (talk) 23:04, 12 November 2012 (UTC)
Thanks Raoli (talk) 00:38, 13 November 2012 (UTC)

Ilokano translation

   'ilo': {
      notfound: "Saan a nabirukan ti Wikidata a banag.",
      intro: "Wikidata: ",
      nolabel: "(Awan ti etiketa)",
      nodescription: "awan ti deskripsion a naited",
      aliases: "Sabali a nagan: ",
      noaliases: "Awan"
    },

Request adding lang/ilo translations, thanks in advance.--Lam-ang (talk) 16:26, 16 November 2012 (UTC)

Added, thank you. --Yair rand (talk) 08:04, 18 November 2012 (UTC)

Russian translation

    'ru': {
      notfound: "Элемент Wikidata не найден.",
      intro: "Wikidata: ",
      nolabel: "(нет метки)",
      nodescription: "нет описания",
      aliases: "Синонимы: ",
      noaliases: "нет"
    }

Perhaps it makes sense to change the link to create a new element, using the title of an article on the wiki, an example:


French and catalan traduction

I added two traductions, in french and in catalan.

    'ca': {
      notfound: "No s'ha trobat l'element de Wikidata.",
      intro: "Wikidata: ",
      nolabel: "(Cap etiqueta)",
      nodescription: "cap descripció introduïda",
      aliases: "Àlies: ",
      noaliases: "Cap"
     },
    'fr': {
      notfound: "Élement de Wikidata non trouvé.",
      intro: "Wikidata: ",
      nolabel: "(Aucun label)",
      nodescription: "Aucune description fournie",
      aliases: "Alias : ",
      noaliases: "Aucun"
     },

-- Bertrand GRONDIN   → (écrire) 05:56, 12 December 2012 (UTC)

pl transtation

I added pl transtation:

    'pl': {
      notfound: "Brak elementu Wikidata.",
      intro: "Wikidata: ",
      nolabel: "(Brak etykiety)",
      nodescription: "brak opisu",
      aliases: "Inne nazwy: ",
      noaliases: "Brak"
    },

On pl wiki I see this script, but only in english language. What is wrong? Rzuwig 17:02, 15 December 2012 (UTC)

German translation

I offer you the following translation for German (de)

    'de': {
      notfound: "Wikidata-Eintrag nicht gefunden",
      intro: "Wikidata: ",
      nolabel: "(Keine Bezeichnung)",
      nodescription: "Keine Beschreibung vorhanden",
      aliases: "Alternative Bezeichnungen: ",
      noaliases: "keine"
    },

Thank you for this very interesting script. --MSchnitzler2000 (talk) 23:57, 13 January 2013 (UTC)

Added, thanks. --Yair rand (talk) 00:25, 14 January 2013 (UTC)

Hungarian translation

    'hu': {
      notfound: "Nincs még ilyen fogalom a Wikidatában",
      intro: "Wikidata: ",
      nolabel: "(nincs címke)",
      nodescription: "nincs leírás",
      aliases: "Más nevek: ",
      noaliases: "nincs"
    },

--Tgr (talk) 22:42, 14 January 2013 (UTC)

Added to the script. Thank you. --Yair rand (talk) 22:49, 14 January 2013 (UTC)


Greek translation

    'el': {
      notfound: "Δεν βρέθηκε αντικείμενο στο Wikidata.",
      intro: "Wikidata: ",
      nolabel: "(Χωρίς ετικέτα)",
      nodescription: "δεν δίνεται περιγραφή",
      aliases: "Επίσης γνωστό ως: ",
      noaliases: "Κανένα"
    },

--Geraki (talk) 07:29, 16 January 2013 (UTC)

  Added, thanks. --Yair rand (talk) 07:39, 16 January 2013 (UTC)

Only on mainspace

It would be better if it appears only in mainspace wikipedia pages, since (at least for the moment) we can create items only for them. -geraki talk 10:23, 16 January 2013 (UTC)

I mention I have made it a gadget in el.wikipedia: http://el.wikipedia.org/wiki/MediaWiki:Gadget-WikidataInfo.js -geraki talk 11:09, 16 January 2013 (UTC)

Czech translation

   'cs': {
     notfound: "Položka nebyla ve Wikidatech nalezena.",
     intro: "Wikidata: ",
     nolabel: "(bez názvu)",
     nodescription: "bez popisu",
     aliases: "Alternativní názvy: ",
     noaliases: "žádné"
   },

Thanks for this useful tool. --09:23, 14 February 2013 (UTC), Utar (talk)

Added, thanks. --Yair rand (talk) 09:32, 14 February 2013 (UTC)
Tried, works for me. Thanks once more :D --10:05, 14 February 2013 (UTC), Utar (talk)

suggestions

I have two suggestions

  1. now for en:shiraz it shows Wikidata: Shiraz (Q41535) at the top . in my opinion it should be better to show Wikidata:Q41535 (Shiraz) because user except clicking on link also can copy Wikidata:Q41535 in local wiki search box but Wikidata: Shiraz or Wikidata: Shiraz (Q41535) doesn't have any page in wikidata.
  2. to have an option for text highlighting (i.e. ysellow) ▬ Reza1615 / T 13:36, 3 March 2013 (UTC)

user namespace

please set not show in user page and user talk because they are not Notable for wikidata▬ Reza1615 / T 19:53, 3 March 2013 (UTC)

  Done. --Yair rand (talk) 22:30, 3 March 2013 (UTC)

Problem on Japan pages

WikidataInfo in japan pages work only if I am in edit mode. Can you check? --ValterVB (talk) 21:05, 3 March 2013 (UTC)

It seems to be working fine on ja: for me. --Yair rand (talk) 22:31, 3 March 2013 (UTC)
Strange thing, home page work but, (for ex.) ja:内眼角贅皮 no, then I go to edit mode and work --ValterVB (talk) 19:24, 4 March 2013 (UTC)

Arabic translation

    'ar': {
      notfound: "لم يتم العثور على هذه المقالة في ويكي بيانات.",
      intro: "ويكي بيانات: ",
      nolabel: "(لا توجد تسمية)",
      nodescription: "لا يوجد توصف",
      aliases: "أسماء أخرى: ",
      noaliases: "لا توجد أسماء أخرى"
    }
 – The preceding unsigned comment was added by Elph (talk • contribs).

  Done--▬ Reza1615 / T 22:55, 3 March 2013 (UTC)

Thanks. I'm so sorry. "لا يوجد توصف" is wrong and "لا يوجد توصيف" is correct.--عباس 10:29, 4 March 2013 (UTC)

Also change the first line to: "لم يعثر على هذه المادة في ويكي بيانات.". Cheers! --Zack (talk) 15:14, 30 March 2013 (UTC)

Limiting tool to work on pages

Please set it to work only in (0,4, 10, 12, 14, 100) namespaces because number of excepts are more. exception namespaces:(-1, -2, 6, 8, 1, 3, 5, 7, 9, 11, 13, 15, 101). thanks,▬ Reza1615 / T 10:11, 4 March 2013 (UTC)

Indonesian and Minang translation

    'id': {
      notfound: "Item Wikidata belum ada.",
      intro: "Wikidata: ",
      nolabel: "(Belum ada label)",
      nodescription: "belum ada deskripsi",
      aliases: "Nama lain: ",
      noaliases: "Belum ada"
    },
    'min': {
      notfound: "Item Wikidata alun ado.",
      intro: "Wikidata: ",
      nolabel: "(Alun ado label)",
      nodescription: "alun ado deskripsi",
      aliases: "Namo lain: ",
      noaliases: "Alun ado"
    }
Thanks in advance.  Ę-oиė  >>> 10:38, 4 March 2013 (UTC)
  Done, thanks. --Yair rand (talk) 15:41, 4 March 2013 (UTC)

@Yair rand:, please update the translation for Indonesian, Javanese and also Minangkabaunese. Item - > butir, deskripsi -> pemerian.

    'id': {
      notfound: "Butir Wikidata belum ada.",
      intro: "Wikidata: ",
      nolabel: "(Belum ada label)",
      nodescription: "belum ada pemerian",
      aliases: "Nama lain: ",
      noaliases: "Belum ada"
    },
    'min': {
      notfound: "Butir Wikidata alun ado.",
      intro: "Wikidata: ",
      nolabel: "(Alun ado label)",
      nodescription: "alun ado pemerian",
      aliases: "Namo lain: ",
      noaliases: "Alun ado"
    }
    'jv': {
      notfound: "Butir Wikidata durung ana.",
      intro: "Wikidata: ",
      nolabel: "(Durung ana label)",
      nodescription: "Durung ana wedharan",
      aliases: "Jeneng liya: ",
      noaliases: "Durung ana"
    }

Beeyan (talk) 04:46, 17 July 2017 (UTC)

  Done Matěj Suchánek (talk) 07:57, 17 July 2017 (UTC)

How to launch script?

How to launch the script? I mean, how to use it for searching in Wikidata on Wikipedia when embedded script in my common.js — Polda18 (talk) 16:41, 4 March 2013 (UTC)

You should use it in locale wiki and you will see the wikidata's link at the top of the page under title ▬ Reza1615 / T 16:44, 4 March 2013 (UTC)
Oh yes, thanks :) I've seen it when choosen random page :)) — Polda18 (talk) 16:47, 4 March 2013 (UTC)

Special and Talk pages don't have interwiki

Can you please set not showing link on special pages? They haven't implemented the interwiki so they should't show link under the page name… In other words, there's nothing to connect special pages throuhout the Wikimedia as they're the wiki specific. — Polda18 (talk) 17:24, 4 March 2013 (UTC)

Please see Wikidata:Requests for comment/Inclusion of non-article pages. I don't think the script should exclude any namespaces unless there's a consensus that no pages in the namespace should have Wikidata items. --Yair rand (talk) 23:21, 4 March 2013 (UTC)
Well, at least for talk pages it should be disabled (or use the info from the item corresponding to the associated content page), because there is no intent to fix bugzilla:26085 (see also bugzilla:28604). Helder 23:35, 6 March 2013 (UTC)
Changed to use the info from the item corresponding to the associated content page. --Yair rand (talk) 00:45, 7 March 2013 (UTC)

Esperanto and slovak translations

   'eo': {
     notfound: "Vikidatuma ero ne trovita.",
     intro: "Vikidatumoj: ",
     nolabel: "(sen etikedo)",
     nodescription: "sen priskribo",
     aliases: "Alternativaj nomoj: ",
     noaliases: "neniu"
   },
   'sk': {
     notfound: "Položka nebola vo Wikiúdajoch nájdená.",
     intro: "Wikiúdaje: ",
     nolabel: "(bez názvu)",
     nodescription: "bez popisu",
     aliases: "Alternatívne názvy: ",
     noaliases: "žiadne"
   },

Thanks! --KuboF (talk) 21:48, 5 March 2013 (UTC)

"Wikidatumoj"? Are you sure about that? --Yair rand (talk) 21:55, 5 March 2013 (UTC)
Thanks, Vikidatumoj. Corrected! --KuboF (talk) 22:23, 5 March 2013 (UTC)
Thank you.   Done. --Yair rand (talk) 22:25, 5 March 2013 (UTC)

Urdu Translation

    'ur': {
      notfound: "یہ مضمون ویکی ڈیٹا میں نہیں ملا۔",
      intro: "ویکی ڈیٹا: ",
      nolabel: "(نام موجود نہیں)",
      nodescription: "تعریف موجود نہیں",
      aliases: "دیگر نام: ",
      noaliases: "دیگر نام موجود نہیں ہے"
    }

--محمد شعیب (talk) 01:25, 6 March 2013 (UTC)

  Done. --Yair rand (talk) 03:05, 6 March 2013 (UTC)

Portuguese translations

Please translate:

'pt': {
notfound: "Item do Wikidata não encontrado",
intro: "Wikidata: ",
nolabel: "(Nenhum rótulo)",
nodescription: "nenhuma descrição dada",
aliases: "Nomes alternativos: ",
noaliases: "Nenhum"
},

Thank you, Lucasdj98talk 01:28, 6 March 2013 (UTC)

  Done. --Yair rand (talk) 03:06, 6 March 2013 (UTC)
This should also be used for 'pt-br'. Helder 23:20, 6 March 2013 (UTC)
The script interface is still in English at
http://en.wikipedia.org/wiki/Test?uselang=pt-br
while the remaining of the MediaWiki interface is in Portuguese. The code should be using mw.config.get('wgUserLanguage') instead of mw.config.get('wgPageContentLanguage'). Helder 17:56, 7 March 2013 (UTC)

Limiting tool for showing aliases

Now tool shows every aliases which are in the item and for items like this it damage top part of article's page.▬ Reza1615 / T 18:05, 8 March 2013 (UTC)

I don't quite understand what you mean. How is it damaging the top part of the article? --Yair rand (talk) 19:48, 10 March 2013 (UTC)
when the number are aliases are more than 5-6 it will mess the top of article in that example if you check it's article in fa.wikipedia you can see tool used most top part of the article an it is not good▬ Reza1615 / T 20:21, 10 March 2013 (UTC)
I don't see any problem on that article... Is it a problem that it takes up so much space? Or does it actually damage the top of the article for you? Could you perhaps post a screenshot? --Yair rand (talk) 20:24, 10 March 2013 (UTC)
I mean it takes up so much spaces also Now it active only in edit mode and view mode for talk page not article page!▬ Reza1615 / T 20:51, 10 March 2013 (UTC)
at least please add an option that user can set it in his common.js to disable showing aliases or limiting the number of showing▬ Reza1615 / T 22:05, 11 March 2013 (UTC)
  Done. WDIlimitaliases can be set to add a limit to the number of aliases to be displayed. For example, WDIlimitaliases = 10; will cause it not to display more than 10 aliases. --Yair rand (talk) 22:29, 11 March 2013 (UTC)
Where I put the code when I use your script on others wiki (ie: idwiki & minwiki)? On my common.js?  Ę-oиė  >>> 13:28, 12 March 2013 (UTC)
Yes. --Yair rand (talk) 18:09, 12 March 2013 (UTC)

Korean translation

    'ko': {
      notfound: "위키데이터에 항목이 없습니다.",
      intro: "위키데이터: ",
      nolabel: "(레이블이 지정되지 않았습니다)",
      nodescription: "설명이 없습니다",
      aliases: "다른 이름: ",
      noaliases: "없음"
    }

-- DangSunM (T · C) 18:13, 9 March 2013 (UTC)

  DoneReza1615 / T 22:06, 9 March 2013 (UTC)

Japanese translation

Please add

    'ja': {
      notfound: "ウィキデータの項目が見つかりません。",
      intro: "ウィキデータ: ",
      nolabel: "(ラベルなし)",
      nodescription: "説明がありません",
      aliases: "別名: ",
      noaliases: "なし"
    },

Thanks in advance. --fryed-peach (talk) 05:48, 10 March 2013 (UTC)

  DoneReza1615 / T 09:26, 10 March 2013 (UTC)

Update Russian translation

Hello. Thank you for your script, it is very useful. Please, change Russian transcription as following:

    'ru': {
      notfound: "Объект Викиданных не найден.",
      intro: "Викиданные: ",

Doff (talk) 19:03, 10 March 2013 (UTC)

  DoneReza1615 / T 19:08, 10 March 2013 (UTC)

Custom option(s)

Hi, Yair rand. Would you be able to add the same functionality that Wikidata:Tools#Ancestry viewer has, so that you can add a snippet with your own custom options before loading this script? I would like to be able to browse the English Wikipedia, but see if there is a label or description for an article in Norwegian. So, I could just put WikidataInfo_opts = { lang: 'nb' };. I tried doing it myself, but I have no idea what I'm doing, so it didn't work. If you could add this functionality, that'd be great. Jon Harald Søby (talk) 23:58, 16 March 2013 (UTC)

look what i did on de: diff - together with the unchanged original script it looks like this: File:WikidataInfo-two-languages.png --Akkakk (talk) 01:08, 17 March 2013 (UTC)
Yeah, I was able to do that too – but I think it would be nice if there was an easier way than copying the entire script to your own /common.js (which may become outdated if this original is updated, and so forth). Jon Harald Søby (talk) 01:50, 17 March 2013 (UTC)

Bengali translation

Add this -

   'bn': {
     notfound: "উইকিউপাত্তের আইটেম পাওয়া যায়নি।",
     intro: "উইকিউপাত্ত: ",
     nolabel: "(লেবেল নেই)",
     nodescription: "বিবরণ দেওয়া হয়নি",
     aliases: "উপনামগুলি: ",
     noaliases: "কোনটি না"
   },

--Leemontalk 17:10, 17 March 2013 (UTC)

a suggestion

Can you change

var namespace = mw.config.get('wgNamespaceNumber'),
page = ( namespace -= ( namespace > 0 && namespace % 2 ) ) === 0 ? mw.config.get('wgTitle') : mw.config.get('wgFormattedNamespaces')[ namespace ] + ':' + mw.config.get('wgTitle');

to

var namespace = mw.config.get('wgNamespaceNumber');
if (namespace!=2&&(namespace%2==0&&namespace>=0))
 {
var page = (mw.config.get('wgCanonicalNamespace')===''?'':mw.config.get('wgFormattedNamespaces')[namespace]+":")+mw.config.get('wgTitle');
 }

?

then I think your tool will stop working in special page.——Cwek (talk) 14:58, 28 March 2013 (UTC)

Nynorsk translation

This:

'nn': {
      notfound: "Fann ikkje noko Wikidata-datasett.",
      intro: "Wikidata: ",
      nolabel: "(ingen merkelapp)",
      nodescription: "inga skildring oppgjeven",
      aliases: "Tilleggsnamn: ",
      noaliases: "Ingen"
    }

--Njardarlogar (talk) 22:45, 29 March 2013 (UTC)

  Done. --Yair rand (talk) 21:56, 3 April 2013 (UTC)

Sorbian translations

Hello. Could you add the following Sorbian translations, please?

'dsb': {
      notfound: "Wikidatowa sajźba se njejo namakana.",
      intro: "Wikidaty: ",
      nolabel: "(bźez pomjenjenja)",
      nodescription: "bźez wopisa",
      aliases: "Alternatiwne mjenja: ",
      noaliases: "žedne"
    },
'hsb': {
      notfound: "Wikidatowa sadźba so njeje namakana.",
      intro: "Wikidaty: ",
      nolabel: "(bjez pomjenjowanja)",
      nodescription: "bjez wopisa",
      aliases: "Alternatiwne mjena: ",
      noaliases: "žadne"
    },

Thanks and greetings --Tlustulimu (talk) 16:32, 24 April 2013 (UTC)

isAnon

There is a race condition, where mediawiki.user is not loaded yet when you call it. You can fix this by wrapping the whole script, like:

mw.loader.using( 'mediawiki.user', function () {
  // mainCodeHere();
} );

--Superm401 - Talk 02:44, 31 May 2013 (UTC)

+1. I just run into this problem on ptwiki: Uncaught TypeError: Object #<Object> has no method 'isAnon' . Helder 12:22, 1 June 2013 (UTC)
I just switched mw.user.isAnon() for mw.config.get("wgUserName") == null, which should fix it. --Yair rand (talk) 07:47, 2 June 2013 (UTC)

class for div

Would you please give a class or id to the div container for custom styling? I want to control the width of the message area. --fryed-peach (talk) 01:27, 8 June 2013 (UTC)

Done: .WDI-box . --Yair rand (talk) 15:13, 9 June 2013 (UTC)
Thank you! --fryed-peach (talk) 01:47, 10 June 2013 (UTC)

Showing English language in module namespace

Just notice recently while using WikidataInfo.js on module namespace in ilowiki, it shows the Wikidata label in English instead of Ilokano (for example ilo:Modulo:Turay a panagtengngel gives the label as Wikidata: Module:Authority control (Q11640331)) , I'm not sure if this is a bug for WikidataInfo, MediaWiki software, extension Scribunto or something else. Maybe you can shed a light on this. Thanks.--Lam-ang (talk) 18:32, 26 October 2013 (UTC)

Apparently, having the wgPageContentLanguage set to English for Lua/JS/CSS pages is deliberate, so this would be a bug in WikidataInfo. I've changed the script to use wgContentLanguage instead, so this should be fixed. --Yair rand (talk) 02:47, 28 October 2013 (UTC)
Thanks. --Lam-ang (talk) 06:03, 28 October 2013 (UTC)

Belarusan translation

  'be-tarask': {
     notfound: "Элемэнт ВікіЗьвестак ня знойдзены.",
     intro: "ВікіЗьвесткі: ",
     nolabel: "(Няма меткі)",
     nodescription: "няма апісаньня",
     aliases: "Сынонімы: ",
     noaliases: "Няма"
   },

Please add. --Renessaince (talk) 06:38, 26 November 2013 (UTC)

  Done, thank you. --Yair rand (talk) 08:07, 26 November 2013 (UTC)

Bosnian translation

    'bs': {
      notfound: "Nije pronađena stavka na Wikipodacima.",
      intro: "Wikipodaci: ",
      nolabel: "(bez oznake)",
      nodescription: "opis nije naveden",
      aliases: "Alternativne oznake: ",
      noaliases: "Nema"
    },

-- Edinwiki (talk) 12:21, 18 February 2014 (UTC)

  Done, thank you. --Yair rand (talk) 22:41, 18 February 2014 (UTC)

Title encoding

The page title isn't properly encoded (see it:Speciale:Diff/65251634). If you agree, I can fix your script. --Ricordisamoa 16:27, 9 April 2014 (UTC)

Fixed. --Yair rand (talk) 05:11, 10 April 2014 (UTC)

Spanish translation

Please translate:

'es': {
notfound: "Elemento de Wikidata no encontrado",
intro: "Wikidata: ",
nolabel: "(No etiquetado)",
nodescription: "sin descripción",
aliases: "Nombres alternativos: ",
noaliases: "No"
},

Thank you! Fúlvio (talk) 16:03, 6 May 2014 (UTC)

  Done, thank you. --Yair rand (talk) 16:23, 6 May 2014 (UTC)

Display tweak request

I've just started using WikidataInfo and it has made life a lot easier; thank you. On the English Wikipedia, the display looks like:

Wikidata: Andricus aries (Q14678420), Gall-forming wasp species

please can it be changed to something like:

Wikidata: Andricus aries (Q14678420), Gall-forming wasp species

or:

Wikidata: Andricus aries (Q14678420), Gall-forming wasp species

or even:

Wikidata: Andricus aries (Q14678420), Gall-forming wasp species ?

I use a "copy link text" extension in my browser, and any of the above would make it easier to capture the Q ID. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:02, 4 September 2014 (UTC)

Also, it would be helpful to style "no description given" warnings in red or orange, or some other noticeable way. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 16:33, 5 September 2014 (UTC)

@Pigsonthewing: I've split the Q ID into a separate link, and added a class to the description line when the item has no description. To turn it orange, you can add the following to your personal CSS:
.WDI-nodesc {
    color: orange; 
}
--Yair rand (talk) 18:45, 7 September 2014 (UTC)
Thank you. When I said "it would be helpful...", I meant in terms of getting more people to add descriptions ;-) Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 19:06, 7 September 2014 (UTC)

Chinese Translation

  'zh': {
    notfound: "找不到维基数据项。",
    intro: "维基数据: ",
    nolabel: "(无标签)",
    nodescription: "无描述",
    aliases: "别名: ",
    noaliases: "无"
  },
  'zh-cn': {
    notfound: "找不到维基数据项。",
    intro: "维基数据: ",
    nolabel: "(无标签)",
    nodescription: "无描述",
    aliases: "别名: ",
    noaliases: "无"
  },
  'zh-hans': {
    notfound: "找不到维基数据项。",
    intro: "维基数据: ",
    nolabel: "(无标签)",
    nodescription: "无描述",
    aliases: "别名: ",
    noaliases: "无"
  },
  'zh-hant': {
    notfound: "找不到維基數據項。",
    intro: "維基數據: ",
    nolabel: "(無標籤)",
    nodescription: "無描述",
    aliases: "別名: ",
    noaliases: "無"
  },
  'zh-hk': {
    notfound: "找不到維基數據項。",
    intro: "維基數據: ",
    nolabel: "(無標籤)",
    nodescription: "無描述",
    aliases: "別名: ",
    noaliases: "無"
  },
  'zh-mo': {
    notfound: "找不到維基數據項。",
    intro: "維基數據: ",
    nolabel: "(無標籤)",
    nodescription: "無描述",
    aliases: "別名: ",
    noaliases: "無"
  },
  'zh-sg': {
    notfound: "找不到维基数据项。",
    intro: "维基数据: ",
    nolabel: "(无标签)",
    nodescription: "无描述",
    aliases: "别名: ",
    noaliases: "无"
  },
  'zh-tw': {
    notfound: "找不到維基數據項。",
    intro: "維基數據: ",
    nolabel: "(無標籤)",
    nodescription: "無描述",
    aliases: "別名: ",
    noaliases: "無"
  },

The Chinese Translation is more complicated because we have Simplified Chinese and Traditional Chinese, and each of them has some variants. So you need to add all of the above to your code. Thank you very much! 2014Best (talk) 22:34, 9 September 2014 (UTC)

  Done, thank you. --Yair rand (talk) 22:41, 9 September 2014 (UTC)

Reasonator

Please consider adding a link to Reasonator (e.g. R). Abbreviated link text, such as just "R" (without the quote marks; like in the preceding example), should suffice. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 11:59, 11 October 2014 (UTC)

Welsh translation

   'cy': {
     notfound: "Eitem o Wicidata heb ei ganfod.",
     intro: "Wicidata: ",
     nolabel: "(Dim label)",
     nodescription: "ni roddwyd disgrifiad",
     aliases: "Enwau eraill: ",
     noaliases: "Dim"
   },
@Robin Owain (WMUK):   Done, thank you. --Yair rand (talk) 20:12, 22 October 2014 (UTC)

Disable on special-Pages

Hi,

could you make it to ignore on specialpages? I dislike it on my watchlist, since it has no use there and only takes space. Beside of this: Great tool, btw! -- MichaelSchoenitzer (talk) 22:29, 8 March 2015 (UTC)

  Done. --Yair rand (talk) 23:18, 8 March 2015 (UTC)

TypeError

@Yair rand: When I load the a page on ptwiki I get the following TypeError: item.descriptions[lang] is undefined. Helder 23:22, 9 September 2015 (UTC)

The reason is the breaking API change. I fixed this and other things in my fork. --Fomafix (talk) 12:11, 10 September 2015 (UTC)
Fixed here as well. @Fomafix: Do you want to merge the two versions? You're an administrator, so you can make edits directly to the script. I don't mind people going ahead and adding improvements and fixes directly, so long as it doesn't break anything that worked previously. If you want them to remain separate, that's fine as well. --Yair rand (talk) 13:06, 10 September 2015 (UTC)

Not working on fiwiki

Since today (or yesterday) this is not working on fi.wikipedia.org anymore. Browser console says that "TypeError: item.descriptions[lang] is undefined". What's wrong? --Stryn (talk) 17:41, 10 September 2015 (UTC)

See one section above. The problem is fixed in the code here. You have to update your copy of the code. --Fomafix (talk) 18:33, 10 September 2015 (UTC)
Oh, thanks! --Stryn (talk) 18:44, 10 September 2015 (UTC)

Hebrew translation

   'he': {
     notfound: "אין פריט ויקינתונים.",
     intro: "ויקינתונים: ",
     nolabel: "(ללא תווית)",
     nodescription: "ללא תאור",
     aliases: "כינויים: ",
     noaliases: "אין"
   },


Kotz (talk) 10:56, 10 October 2015 (UTC)

  Done, thank you. --Yair rand (talk) 00:59, 13 October 2015 (UTC)

Needs mediawiki.jqueryMsg dependency

The {{PLURAL}} in the messages isn't parsed if the mediawiki.jqueryMsg module isn't loaded. Legoktm (talk) 08:04, 26 November 2015 (UTC)

@Legoktm: Are there actually any situations where mediawiki.jqueryMsg isn't loaded? --Yair rand (talk) 10:35, 26 November 2015 (UTC)
All modules gets loaded asynchronous so it is a race condition if the module is loaded or not. In my fork I explicit load the dependencies. --Fomafix (talk) 12:41, 26 November 2015 (UTC)
Merged changes, thank you. --Yair rand (talk) 13:51, 26 November 2015 (UTC)
Thanks! Legoktm (talk) 05:53, 5 December 2015 (UTC)

not working

This great tool suddenly stopped working for me. From browser console related error seems to be "Use of "wgContentLanguage" is deprecated. Use mw.config instead." Any workaround? --Jklamo (talk) 22:10, 15 May 2016 (UTC)

@Jklamo: I'm not getting that message, and this script doesn't directly use wgContentLanguage, so I think that console message is unrelated. The script problem might be a server-side issue. It seems to be regularly lagging by large amounts, causing it to abort. I could remove the maxlag parameter, but I'm not sure that's a good idea... --Yair rand (talk) 22:35, 15 May 2016 (UTC)
@Jklamo: Someone was editing too quickly, and it was causing issues. Seems to be working now. --Yair rand (talk) 23:37, 15 May 2016 (UTC)
Works OK also for me now, seems to be really a server-side issue. --Jklamo (talk) 23:45, 15 May 2016 (UTC)
By way - very thanks for very useful script! --Kaganer (talk) 11:46, 16 May 2016 (UTC)
Anyway pherups is better a more high maxlag. Something like 1.5 / 2. --Valerio Bozzolan (talk) 09:25, 12 June 2017 (UTC)

Doesn’t load after VisualEditor edit

This script runs directly after page load, so since VisualEditor doesn’t refresh the page after save, it doesn’t appear. I created a fork here, seems to work, but some more testing surely won’t harm.   Since it uses a separate function for loading the data, it uses mw.message for all interface messages—therefore it will be easier to migrate to Gadgets 2.0 (if it will be finished ever…). Also it uses the fallback chain so e.g. on Bavarian WP it displays in German, not in English. --Tacsipacsi (talk) 11:18, 18 September 2016 (UTC)

newitem language

When I have some article in some language with [Wikidata item not found.] message, I click on this message to create new item. But there is pre-filled my local language, not language of wiki I am coming from. So I create e.g item for jv.wiki category, but with cs label instead of jv label. JAn Dudík (talk) 12:51, 3 January 2017 (UTC)

mw.user.isAnon

Getting the following error on Wikipedia: TypeError: mw.user.isAnon is not a function Stryn (talk) 15:47, 15 February 2017 (UTC)

Per the suggestions from #isAnon and what I can see in the code, this shouldn't happen unless there is a bug somewhere deeper? Are you using the most up-to-date version? Matěj Suchánek (talk) 16:13, 15 February 2017 (UTC)
Hm, I didn't notice when merging Fomafix's version that it had been changed back to using mw.user.isAnon(). Changed it to use mw.config.get("wgUserName") === null again. --Yair rand (talk) 19:57, 15 February 2017 (UTC)
Stryn didn't use the code here. He used an old copy of the code with mw.user.isAnon and without mw.loader.using( [ 'mediawiki.user' ] ): https://meta.wikimedia.org/w/index.php?title=User:Stryn/global.js&diff=16323468&oldid=16323179 Of course this cause problems with a race condition. With mw.loader.using( [ 'mediawiki.user' ] ) you can safely use mw.user.isAnon. --Fomafix (talk) 13:15, 16 February 2017 (UTC)

hsb translation

Hello. Could you please correct the following Upper Sorbian (hsb) translations:

  • notfound: "Wikidatowa sadźba so njeje namakana." –> "Wikidatowa sadźba njeje so namakała."
  • nolabel: "(bjez pomjenjowanja)" –> "(bjez pomjenowanja)"

Thanks! --J budissin (talk) 12:11, 7 July 2017 (UTC)

  Done Matěj Suchánek (talk) 12:39, 9 July 2017 (UTC)

Not working

At least not on Firefox. Stryn (talk) 15:44, 18 August 2017 (UTC)

See #not working. Wikidata databases are lagging a lot these days. Matěj Suchánek (talk) 16:45, 18 August 2017 (UTC)

Quick documentation section?

Hi Yair rand, this is a great script. Can I request a quick documentation section (at the top of this page, or at User:Yair rand/WikidataInfo) so that we have the basic/advanced info all in a single place? E.g.

  • The screenshot at top here
  • The quick instructions for non-technical users (i.e. "Copy this line [...] into your Special:MyPage/common.js on your home wiki or your m:Special:MyPage/global.js on metawiki")
  • The instructions for multi-lingual users (i.e. the screenshot shows Wikidata info in 2 languages, but I can't easily find how to do that)
  • The instructions for translators, or just a copy & paste empty section for them to easily re-use.

Thanks! Quiddity (talk) 17:04, 14 September 2017 (UTC)

Asturian translation

Hi! This is a translation for Asturian language (ISO code ast)

		'ast': {
			notfound: "Nun s'alcontró l'elementu de Wikidata",
			intro: "Wikidata: ",
			nolabel: "(Ensin etiqueta)",
			nodescription: "ensin descripción",
			aliases: "{{PLURAL:$1|Alcuñu|Alcuños}}: ",
			noaliases: "Non"
		},

Regards, --Oriciu (talk) 15:20, 20 February 2018 (UTC)

@Oriciu:   Done, thank you. --Yair rand (talk) 17:01, 20 February 2018 (UTC)

Unlinking the QID

@Yair rand: as a Wikidata editor, I often want to copy QIDs from pages, so it would be pretty awesome if the QID was not a part of the link, to make this copying easier. NMaia (talk) 12:19, 21 April 2018 (UTC)

@Yair rand, NMaia: I agree, it'd be great to be able to double-click on the QID to select just it. At the moment I'm always selecting one or other parenthesis. The link is already present on the label. Sam Wilson 06:50, 22 November 2018 (UTC)
@Yair rand: This would be really useful as I've adapted your script to also work at the OpenStreetMap Wiki (Q18635431) and this unlinking would save a lot of clicks. NMaia (talk) 04:46, 31 March 2019 (UTC)
@Samwilson: I made a fork with this change. Please see user:NMaia/WikidataInfo.js. @Yair rand: feel free to upstream the changes, if you like. NMaia (talk) 14:19, 18 June 2019 (UTC)
@NMaia: That's great, thanks! I've switch to your fork. Sam Wilson 22:30, 18 June 2019 (UTC)

Something broken

Looks like something broken, am I right? No data displayed more via this script. —evs 💬 04:34, 6 July 2018 (UTC)

It should be back now. maxlag now considers dispatching delay to wikis, so I omitted it from the gadget for now. Matěj Suchánek (talk) 12:55, 6 July 2018 (UTC)
This change contains a syntax error because a , before a } is not allowed. --Fomafix (talk) 12:49, 9 July 2018 (UTC)
@Fomafix: Why do you think it’s not allowed? AFAIK it’s allowed in JavaScript (but not in JSON). I don’t get any error messages on my browser console, either. —Tacsipacsi (talk) 15:52, 9 July 2018 (UTC)
Oh, you're right. Trailing commas are only for forbidden in JSON and in JavaScript before ES5. --Fomafix (talk) 16:40, 9 July 2018 (UTC)
Thanks for this info. I, in turn, haven’t known that this was forbidden in JavaScript ever. I don’t plan to develop anything for IE8 and lower, though. —Tacsipacsi (talk) 17:45, 9 July 2018 (UTC)

Hindi Translation

'hi': {
			notfound: "विकिडाटा प्रविष्टि नहीं मिली।",
			intro: "विकिडाटा: ",
			nolabel: "(कोई लेबल नहीं)",
			nodescription: "कोई विवरण नहीं दिया गया",
			aliases: "{{PLURAL:$1|ऊर्फ|अन्य नाम}}: ",
			noaliases: "कुछ भी नहीं"
		},

☆★Sanjeev Kumar (talk) 17:52, 11 July 2018 (UTC)

  Done, thank you. --Yair rand (talk) 19:44, 11 July 2018 (UTC)

Norwegian (bokmål) translation

Hi, could you change the nb translation from

aliases: "Også kjent som: "

to

aliases: "Alias: "

? Discussed on no.wiki here: [1]. Regards, Kjetil_r (talk) 09:12, 23 September 2018 (UTC)

  Done Matěj Suchánek (talk) 09:30, 23 September 2018 (UTC)

Hebrew description correction

Hi,

Can anyone please correct the Hebrew string "ללא תאור" to "ללא תיאור"?

Thanks! --Amir E. Aharoni (talk) 09:38, 5 April 2019 (UTC)

  Done Matěj Suchánek (talk) 17:35, 6 April 2019 (UTC)

Update Czech translation

Using correct current terminology (and added PLURAL, apparently supported):

		'cs': {
			notfound: "Položka nebyla ve Wikidatech nalezena.",
			intro: "Wikidata: ",
			nolabel: "(bez štítku)",
			nodescription: "bez popisu",
			aliases: "{{PLURAL:$1|Alias|Aliasy}}: ",
			noaliases: "žádné"
		},

Thanks, --Mormegil (talk) 08:00, 10 April 2019 (UTC)

  Done Matěj Suchánek (talk) 15:23, 10 April 2019 (UTC)

Venetian translation

    'vec': {
      notfound: "<strong>Elemento mìa catà!</strong>",
      intro: "<strong>Wikidata > </strong>",
      nolabel: "<strong>(Nisuna eticheta)</strong>",
      nodescription: "<strong>Nisuna descrision fornìa</strong>",
      aliases: "<strong>{{PLURAL:$1|Soranome|Soranomi}}: </strong>",
      noaliases: "<strong>Nisun</strong>"
    }

Add please. Thank you Vajotwo (talk) 16:50, 18 April 2020 (UTC)

  Done without <strong>. If your wiki wants this styling, you can locally change CSS of .WDI-box, .WDI-desc and .WDI-nodesc. --Matěj Suchánek (talk) 09:43, 19 April 2020 (UTC)

Show WikidataInfo in the main page only

@Yair rand: and @Matěj Suchánek: Hello, thanks for creating this script. I want to show the WikidataInfo result only in the main page, because I see it in the history page and the diff page. How can I achieve this? I copied the script to my own page: https://meta.wikimedia.org/w/index.php?title=User:Diki_Ananta/WikidataInfo.js&action=raw&ctype=text/javascript. Thanks. Diki Ananta (talk) 15:23, 3 June 2020 (UTC)

@Diki Ananta: Right before the line beginning && mw.loader.using, add this line: && mw.util.getParamValue( 'diff' ) === null && mw.util.getParamValue( 'oldid' ) === null && mw.config.get( 'wgAction' ) === 'view' --Yair rand (talk) 18:29, 3 June 2020 (UTC)
@Yair rand: Thank you! Diki Ananta (talk) 01:15, 4 June 2020 (UTC)

skin cologneblue and skin minerva

Hello! As I have seen, you do some $d.appendTo( '#contentSub' ); at the very end. Well, skin cologneblue and skin minerva do not have an element with id="contentSub". But all skins have some class="mw-parser-output". So what about $d.insertBefore( '.mw-parser-output' );.

BTW: I have the same problem with those two skins and will do that change in my script. During testing I have seen, that your data does not show up either. --Wurgl (talk) 15:03, 24 June 2020 (UTC)

Finally I decided in my script to use insertBefore(document.getElementById("contentSub") || document.getElementById("mw-content-text")) so there is no change of position in the skins with an element id=contentSub and those two skins without it, cologneblue and minerva, show up the information too. --Wurgl (talk) 14:32, 25 June 2020 (UTC)
@Wurgl: appendTo( '#contentSub' ) and insertBefore(document.getElementById('contentSub')) are quite not the same—the first inserts at the end, the second before. For example, the redirect notice is in #contentSub, so it’s before WikidataInfo in the current version, but would be after it with this change. What would work is a bit longer:
if ( $( '#contentSub' ).length ) {
	$d.appendTo( '#contentSub' );
} else {
	$d.insertBefore( '#mw-content-text' );
}
Tacsipacsi (talk) 22:33, 25 June 2020 (UTC)

Does the script works with Minerva now? PAC2 (talk) 21:09, 28 December 2020 (UTC)

Turkish translation

{{Edit request}} Can you add for Turkish translation.

		'tr': {
			notfound: "Vikiveri ögesi bulunamadı.",
			intro: "Vikiveri: ",
			nolabel: "(Etiket yok)",
			nodescription: "açıklama girilmedi",
			aliases: "{{PLURAL:$1|Diğer adı|Diğer adları}}: ",
			noaliases: "Yok"

Thanks. --ToprakM 09:16, 6 July 2020 (UTC)

  Done --Matěj Suchánek (talk) 17:11, 6 July 2020 (UTC)

Vietnamese translation

    'vi': {
      notfound: "Không tìm thấy khoản mục Wikidata.",
      intro: "Wikidata: ",
      nolabel: "(Không có nhãn)",
      nodescription: "không có lời miêu tả",
      aliases: "Biệt danh: ",
      noaliases: "Không có"
    },

Can you please take time to add this translation to WikidataInfo.js, please? Thank you. NgocAnMaster (talk) 15:00, 8 January 2021 (UTC)

Update: My translation edited. Use my latest Vietnamese translation instead. Thank you. NgocAnMaster (talk) 15:11, 8 January 2021 (UTC)
  Done --Matěj Suchánek (talk) 09:53, 9 January 2021 (UTC)

Please add proofread content models to the denylist

Hi! The content model proofread-index and proofread-page to the denylist, as neither of these page models receive sitelinks, so the link is not useful at these Wikisource pages (so every page gets "Wikidata item not found."). E.g.

That is to say, something like this:

[
	'wikibase-item',
	'wikibase-property',
	'wikibase-lexeme',
	'flow-board',
	'EntitySchema',
	'proofread-index',
	'proofread-page'
].indexOf( mw.config.get( 'wgPageContentModel' ) ) === -1 ) {

Thanks! Inductiveload (talk) 20:45, 3 October 2021 (UTC)

  Done --Matěj Suchánek (talk) 11:56, 28 October 2021 (UTC)

Thai Translation

'th': {
	notfound: "ไม่มีรายการวิกิสนเทศสำหรับหน้านี้",
	intro: "วิกิสนเทศ: ",
	nolabel: "(ไม่มีป้ายกำกับ)",
	nodescription: "ไม่มีการกำหนดคำอธิบายไว้",
	aliases: "ชื่ออื่น: ",
	noaliases: "ไม่มี"
},

Please add Thai translation. --Bebiezaza (talk) 15:53, 24 October 2021 (UTC)

  Done --Matěj Suchánek (talk) 11:56, 28 October 2021 (UTC)

Tashlhit translation

Please add the Tashlhit translation --Lhoussine AIT TAYFST (talk) 21:21, 5 December 2021 (UTC)

    'shi': {
      notfound: "Ur ittyafa umgrad ad g Wiki isfka.",
      intro: "Wiki isfka: ",
      nolabel: "(Ur illi ism)",
      nodescription "Ur illi uglam",
      aliases: "Ismawn yaḍni: ",
      noaliases: "Ur llin ismawn yaḍni"
    }
  Done --Matěj Suchánek (talk) 13:52, 6 December 2021 (UTC)
Thank you sir --Lhoussine AIT TAYFST (talk) 20:12, 6 December 2021 (UTC)
Hi sir, I tried to enable this module on Wikipedia Tashlhit without result, please I need some help in adding it if you have some time --Lhoussine AIT TAYFST (talk) 20:38, 6 December 2021 (UTC)
@Lhoussine AIT TAYFST: What does it mean "to enable"? Do you want to have it enabled for yourself? Do you want to give all logged in users the ability to activate it? Would you point me at what you tried to do? Matěj Suchánek (talk) 10:28, 12 December 2021 (UTC)

Wikispecies to Wikidata issue?

Hi, thank you for providing such a useful tool.

I've just tried it and found something wrong.

I accessed a page at Wikispecies and your tool said "Wikidata item not found." although it did as follows.


Q63707946

Creating Penaeus japonicus - Wikispecies (wikimedia.org)


Could you please let me know anything I should do?

Thanks. Yayamamo (talk) 03:55, 17 January 2022 (UTC)

@Yayamamo: The tool only works for pages which are actually connected to Wikidata. That page doesn't exist, so it cannot be connected. --Matěj Suchánek (talk) 11:53, 17 January 2022 (UTC)
I see, thanks. Yayamamo (talk) 15:45, 17 January 2022 (UTC)

Vietnamese label for "alias" property

Hi, please change translate.vi.aliases to "Tên khác: " (lit. "different name(s)"), as "Biệt danh: " (lit. "nickname(s)") doesn't seem to be appropriate. Thanks in advance. NguoiDungKhongDinhDanh 15:41, 6 February 2022 (UTC)

  Done --Matěj Suchánek (talk) 08:09, 7 February 2022 (UTC)

wgWikibaseItemId

Hi Yair rand! Is there a reason this script looks up the Wikidata ID & info using wbgetentities with sites: wgDBName & titles: pagename instead of using mw.config.get( 'wgWikibaseItemId' );? My guess is that wgWikibaseItemId didn't exist yet when the script was first created. Using it would save us an API query when we know the page isn't connected to Wikidata, since wgWikibaseItemId won't be present in mw.config then. Jon Harald Søby (talk) 00:10, 25 September 2022 (UTC)

@Jon Harald Søby: It doesn’t use the page name – it uses the subject page name. wgWikibaseItemId is set only on pages connected to Wikidata, not on their talk pages. As as optimization, it would probably be possible to use mw.config on subject pages and the current behavior on talk pages, but I’m not sure if it’s worth complicating the code. —Tacsipacsi (talk) 09:12, 25 September 2022 (UTC)
@Tacsipacsi: Okay, I see. I wasn't aware that it worked on talk pages as well. The reason I asked is because I've made a gadget in the Wikimedia Incubator which mimics real interwiki links, up to the point of adding wgWikibaseItemId to mw.config, in the hope that it could help user scripts like this one work on the Incubator as well. But since that is added with Javascript after the page is loaded, we might have needed to make other modifications anyways.
Either way, I'd be willing to make the changes required to make this work if you think that'd be useful. Jon Harald Søby (talk) 19:41, 25 September 2022 (UTC)
Return to the user page of "Yair rand/WikidataInfo.js/Archive 1".