User talk:Zhaofeng Li/Reflinks.js

From Meta, a Wikimedia project coordination wiki

Wiki project identification[edit]

Hello @Zhaofeng Li:!

Thanks for creating this tool!

I've noticed a minor issue:

This line:
var rlWiki = mw.config.get( "wgContentLanguage" );
Gets the result 'en' on metawiki, commonswiki and simplewiki.

mw.config.get( "wgWikiID" );
However returns the DB id: metawiki, commonswiki, simplewiki, enwiki, eswiki, idwiki, cebwiki, etc.

The refill tool (pywikibot library) accepts simplewiki, enwiki, eswiki, idwiki, cebwiki, I assume all of ??wiki in the wikiPedia family. But those in the wikiMedia family don't work: metawiki, commonswiki. This is an exhaustive list, there are no other projects offered on https://tools.wmflabs.org/refill/

Mapping wgWikiID

To make it work metawiki, commonswiki could be mapped to meta.wikimedia, commons.wikimedia, respectively in either Reflinks.js or the refill backend. Maybe pywikibot could also find out the appropriate family for these DB ids, but I don't know that library.

Aron Man.🍂 hist🌾 08:43, 9 November 2019 (UTC)[reply]

Even better:
mw.config.get( "wgServerName" );
Returns meta.wikimedia.org, en.wikipedia.org, etc. This work well for the wiki parameter, without any mapping.

Aron Man.🍂 hist🌾 08:57, 9 November 2019 (UTC)[reply]

@Aron Manning: This tool is unmaintained by Zhaofeng li (Cyberpower678 has volunteered as a maintainer but has not started any maintenance work that I've seen). I would recommend you do put your concern in the Github prominently displayed at the top of this file so that feedback is centralized. --Izno (talk) 16:31, 8 January 2020 (UTC)[reply]
@Izno: Thanks for the heads-up. The github repo seems to be unmaintained as well for the last year. This fix is not that important as the script is most useful on wikipedias, not other wikimedia wikis, where this bug would surface.
I've forked the script with the fix for commons and metawiki just in case... https://meta.wikimedia.org/wiki/User:Aron_Manning/Reflinks.js?oldid=19693089
To load from global.js:
// [[en:User:Zhaofeng Li/reFill]]
mw.loader.load( "//meta.wikimedia.org/wiki/User:Aron_Manning/Reflinks.js?oldid=19693089&action=raw&ctype=text/javascript" );