https://bugzilla.wikimedia.org/show_bug.cgi?id=55075
Web browser: ---
Bug ID: 55075
Summary: Replace in-code translations by gettext
Product: Pywikibot
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: Unprioritized
Component: General
Assignee: Pywikipedia-bugs(a)lists.wikimedia.org
Reporter: legoktm.wikipedia(a)gmail.com
Classification: Unclassified
Mobile Platform: ---
Originally from:
http://sourceforge.net/p/pywikipediabot/feature-requests/222/
Reported by: vvinet
Created on: 2009-08-28 20:48:57
Subject: Replace in-code translations by gettext
Original description:
Having thousands of lines of translations in the text is not very elegant, plus
it requires people to look at the code to make translations.
Using gettext could make this a lot easier to manage.
Attached is a patch that changes the family.py to use gettext translations in
some places, as well as a simple script to generate and compile translation
files.
Since the translation is not dependant on the user's locale, but on the wiki's,
the i18n.py file created by the patch allows choosing the language to get the
translation from, and then getting the translation string.
In order to translate, "Category" for a French wiki, for example, you just need
to do \_GT\("fr"\).ugettext\("Category"\) where \_GT is a short alias
for the
get\_translation function in i18n.py
The .po file for "fr" language code is partly filled up for some of the
translations.
Sorry if this does not cover all strings so far. It only covers those I needed
so far. If there is interest for this feature, I can help to continue the
integration, as well as automatically generate the .po files for every language
based on the current namespace dictionary.
--
You are receiving this mail because:
You are the assignee for the bug.