http://www.mediawiki.org/wiki/Special:Code/pywikipedia/9034
Revision: 9034 Author: xqt Date: 2011-03-10 06:49:58 +0000 (Thu, 10 Mar 2011) Log Message: ----------- change langcode fallback for tt and ku-wiki; update from rewrite r9031 (duplicate code stuff, sorry)
Modified Paths: -------------- trunk/pywikipedia/pywikibot/i18n.py
Modified: trunk/pywikipedia/pywikibot/i18n.py =================================================================== --- trunk/pywikipedia/pywikibot/i18n.py 2011-03-10 06:44:32 UTC (rev 9033) +++ trunk/pywikipedia/pywikibot/i18n.py 2011-03-10 06:49:58 UTC (rev 9034) @@ -23,7 +23,7 @@ If no translation is available to a specified language, translate() will try each of the specified fallback languages, in order, until it finds one with a translation, with 'en' and '_default' as a last resort. - + For example, if for language 'xx', you want the preference of languages to be: xx > fr > ru > en, you let altlang return ['fr', 'ru']. """ @@ -123,9 +123,11 @@ return ['ro'] #Russian and Belarusian if code in ['ab', 'av', 'ba', 'bxr', 'ce', 'cv', 'kk', 'koi', 'ky', 'lbe', - 'mdf', 'mhr', 'mrj', 'myv', 'os', 'rue', 'sah', 'tg', 'tt', - 'udm', 'uk', 'xal']: + 'mdf', 'mhr', 'mrj', 'myv', 'os', 'rue', 'sah', 'tg', 'udm', + 'uk', 'xal']: return ['ru'] + if code == 'tt': + return ['tt-cyrl', 'ru'] if code in ['be', 'be-x-old']: return ['be', 'be-x-old', 'ru'] if code == 'kaa': @@ -137,7 +139,7 @@ return ['sr-el', 'sh', 'hr', 'bs'] #Turkish and Kurdish if code in ['diq', 'ku']: - return ['ku', 'tr'] + return ['ku', 'ku-latn', 'tr'] if code == 'gag': return ['tr'] if code == 'ckb':
pywikipedia-svn@lists.wikimedia.org