Add basic translation support

This commit is contained in:
R. Tyler Ballance 2010-01-30 13:28:40 -08:00
parent 6ccca7c4b4
commit 520e631e14
4 changed files with 88 additions and 8 deletions

View File

@ -18,6 +18,13 @@ from TweepyDeck import util
views = []
util.set_global('views', views)
import locale
import gettext
locale.setlocale(locale.LC_ALL, '')
gettext.bindtextdomain('tweepydeck', 'locale')
gettext.textdomain('tweepydeck')
_ = gettext.gettext
class AbstractRow(bases.BaseChildWidget):
user = None
fullname = None
@ -121,17 +128,19 @@ class BasicRow(AbstractRow):
self._renderStatus(container)
def _avatarTooltip(self):
return '''<b>Name:</b> %s
<b>About:</b> %s
<b>Where:</b> %s
<b>Following back:</b> %s''' % (util.escape(self.fullname),
util.escape(self.user['description']),
util.escape(self.user['time_zone']),
self.user['following'] and 'yes' or 'no')
tooltip = _('''<b>Name:</b> %(name)s
<b>About:</b> %(description)s
<b>Where:</b> %(time_zone)s
<b>Following back:</b> %(following)s''')
return tooltip % {
'name' : util.escape(self.fullname),
'description' : util.escape(self.user['description']),
'time_zone' : util.escape(self.user['time_zone']),
'following' : self.user['following'] and _('yes') or _('no')}
def _markupStatus(self, status):
status = status.replace('\n', ' ').replace('&', '&amp;')
status = util.escape(status)
pieces = status.split(' ')
def markup():
for piece in pieces:

37
de.po Normal file
View File

@ -0,0 +1,37 @@
# German translations for TweepyDeck package
# German messages for TweepyDeck
# Copyright (C) 2010 R. Tyler Ballance <tyler@monkeypox.org>
# This file is distributed under the same license as the TweepyDeck package.
#
msgid ""
msgstr ""
"Project-Id-Version: 0.1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-30 13:27-0800\n"
"PO-Revision-Date: 2010-01-30 13:17-0800\n"
"Last-Translator: R. Tyler Ballance <tyler@monkeypox.org>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: TweepyDeck/views.py:131
#, python-format
msgid ""
"<b>Name:</b> %(name)s\n"
"<b>About:</b> %(description)s\n"
"<b>Where:</b> %(time_zone)s\n"
"<b>Following back:</b> %(following)s"
msgstr "<b>Name:</b> %(name)s\n"
"<b>Uber:</b> %(description)s\n"
"<b>Wo:</b> %(time_zone)s\n"
"<b>Zurueckfolgen:</b> %(following)s"
#: TweepyDeck/views.py:139
msgid "yes"
msgstr "ja"
#: TweepyDeck/views.py:139
msgid "no"
msgstr "nein"

Binary file not shown.

34
messages.pot Normal file
View File

@ -0,0 +1,34 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-01-30 13:27-0800\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=CHARSET\n"
"Content-Transfer-Encoding: 8bit\n"
#: TweepyDeck/views.py:131
#, python-format
msgid ""
"<b>Name:</b> %(name)s\n"
"<b>About:</b> %(description)s\n"
"<b>Where:</b> %(time_zone)s\n"
"<b>Following back:</b> %(following)s"
msgstr ""
#: TweepyDeck/views.py:139
msgid "yes"
msgstr ""
#: TweepyDeck/views.py:139
msgid "no"
msgstr ""