Phabricator のプロジェクト名 #Pywikibot-i18n


Jump to navigation Jump to search
This page is a translated version of the page Manual:Pywikibot/i18n and the translation is 22% complete.
Other languages:
English • ‎español • ‎français • ‎slovenščina • ‎čeština • ‎Ελληνικά • ‎العربية • ‎中文 • ‎日本語

This page is dedicated to help you understand i18n system in pywikibot.


I18n submodule is vital for running bots. It doesn't matter if you want to run pywikibot in an English-based wiki or not. If you want to install it you can run the following commands:

cd scripts
git clone
If you cloned pywikibot with --recursive option or downloaded nightly, i18n submodule is already there and there is no need to install anything.

With SVN submodule must be always configured and updated separately using:

cd scripts
svn co i18n

I18n files are json files in scripts/i18n folder separated by language and script e.g. Persian i18n phrases related to exist in:

scripts --> i18n --> category --> fa.json


If you wish to change or add i18n for certain script in your language, use and update your i18n submodule after one week or two. In order to update i18n submodule run the following commands:

cd scripts
cd i18n
git pull

or in root run:

git pull --recurse-submodules

If you can't wait, change it manually, but we don't recommend this since it may cause failure in next updates.


I18n class is in in pywikibot folder, the related documents can be found in the documentation. As an easy example:

>>> from pywikibot import i18n
>>> print(i18n.twtranslate('es', 'pywikibot-enter-new-text'))
Escribe el nuevo texto:
>>> print(i18n.twtranslate('arz', 'featured-good'))
بوت: %(page)s هي مقالة جيدة # Since arz translation doesn't exist, it returned ar i18n

You can give a site object instead of language code:

>>> import pywikibot
>>> print(pywikibot.i18n.twtranslate(pywikibot.Site('el'), 'featured-good'))
Ρομπότ: το %(page)s είναι καλό άρθρο

ご使用の Pywikibot のセットアップにさらなるヘルプが必要な場合は、IRC チャンネル #pywikibot 接続する または pywikibot@ メーリング リストにお問い合わせください。