Xqt added a comment.

  You can use Site.getmagicwords() 
<https://doc.wikimedia.org/pywikibot/master/_modules/pywikibot/site/_apisite.html#APISite.getmagicwords>
 to get magic words for translation:
  
    >>> import pywikibot
    >>> site = pywikibot.Site('de')
    >>> words = site.getmagicwords('defaultsort')
    ['SORTIERUNG:', 'DEFAULTSORT:', 'DEFAULTSORTKEY:', 'DEFAULTCATEGORYSORT:']
  
  An example can be found in 
cosmetic_changes.CosmeticChangesToolkit.translateMagicWords() 
<https://doc.wikimedia.org/pywikibot/master/_modules/cosmetic_changes.html#CosmeticChangesToolkit.translateMagicWords>
 which replaces magic words inside File links.

TASK DETAIL
  https://phabricator.wikimedia.org/T345042

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Xqt
Cc: Xqt, Aklapper, pywikibot-bugs-list, Geertivp, PotsdamLamb, Jyoo1011, 
JohnsonLee01, SHEKH, Dijkstra, Khutuck, Zkhalido, Viztor, Wenyi, Tbscho, MayS, 
Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, Masti, 
Alchimista
_______________________________________________
pywikibot-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to