Skip to content

Instantly share code, notes, and snippets.

@putnik
Created October 2, 2019 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save putnik/dda7118e274e045bd343575ca26d0c02 to your computer and use it in GitHub Desktop.
Save putnik/dda7118e274e045bd343575ca26d0c02 to your computer and use it in GitHub Desktop.
MediaWiki:Gadget-wikidataInfoboxExport.js for bewiki
var wieConfig = {
units: {
Q531: { search: [ 'св(?:\\.|етлавых|етлавыя)\\s*(?:гадоў|гады?)' ] },
Q4916: { search: [ '^€', '^EUR' ] },
Q4917: { search: [ '^(?:-|US)?\\$', 'долараў(?:\\sЗША)?', 'дол.' ] },
Q7727: { search: [ 'хвілін' ] },
Q8146: { search: [ 'ен' ] },
Q11573: { search: [ 'метр(?:ы|аш)' ] },
Q25344: { search: [ '^CHF' ] },
Q160680: { search: [ 'рублёў' ] },
Q81292: { search: [ 'акр(?:ы|аў)' ] },
Q21074767: { search: [ '(?:вёрст²|кв\.\s*вёрст)' ] }
},
fixedValues: [
{ property: 'P21', regexp: /жан/, item: 'Q6581072', label: 'жаночы' },
{ property: 'P21', regexp: /муж/, item: 'Q6581097', label: 'мужчынскі' },
{ property: 'P423', regexp: /праў/, item: 'Q10927630', label: 'праварукі ўдар' },
{ property: 'P423', regexp: /леў/, item: 'Q10927615', label: 'леварукі ўдар' },
{ property: 'P552', regexp: /праў/, item: 'Q3039938', label: 'праўша' },
{ property: 'P552', regexp: /ляў/, item: 'Q789447', label: 'ляўша' },
{ property: 'P741', regexp: /праў/, item: 'Q3039938', label: 'праўша' },
{ property: 'P741', regexp: /ляў/, item: 'Q789447', label: 'ляўша' },
],
};
mw.loader.load( '//www.wikidata.org/w/index.php?title=MediaWiki:Gadget-infoboxExport.js&action=raw&ctype=text/javascript' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment