Advertisement
Guest User

Untitled

a guest
Jan 16th, 2011
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. #-*- coding: utf-8 -*-
  2. import isbn
  3. import codecs
  4. import pywikibot
  5.  
  6. f = codecs.open('i18n/isbn.py', 'w', 'utf-8')
  7. print >>f,"# coding=utf-8"
  8. print >>f,"msg = {"
  9.  
  10. for lang in pywikibot.getSite().family.languages_by_size:
  11.     print >>f, u"'%s': {" % lang
  12.     for src, name in [(isbn.msg,'isbn-formatting'),]:
  13.        if lang in src:
  14.             trans = src[lang].replace("'", "\\'")
  15.             if name == "category-was-moved":
  16.                 trans=trans.replace("%s", "%(newcat)s", 1).replace("%s", "%(title)s", 1)
  17.             print >>f,u"'" + name + "': u'" + trans + "',"
  18.     print >>f, u"},"
  19. print >>f,"}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement