Merge lp:~dpm/lernid/enable-translations into lp:lernid

Proposed by David Planella
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dpm/lernid/enable-translations
Merge into: lp:lernid
Diff against target: 149 lines (+41/-19)
2 files modified
bin/lernid (+8/-6)
po/lernid.pot (+33/-13)
To merge this branch: bzr merge lp:~dpm/lernid/enable-translations
Reviewer Review Type Date Requested Status
David Planella (community) Needs Resubmitting
Jono Bacon Needs Fixing
Review via email: mp+15693@code.launchpad.net
To post a comment you must log in.
Revision history for this message
David Planella (dpm) wrote :

This branch enables loading the translations in gtkBuilder. Additionally, some strings have been marked as translatable in the code and the POT template has been updated.

To test translations with an installed lernid package from the PPA in say, German (i.e. .mo files are already installed in /usr/share/locale):

  LANGUAGE=de_DE.UTF-8 lernid

(if the files are installed in /usr/share/locale, this can also be tested within the source tree, simply using 'LANGUAGE=de_DE.UTF-8 bin/lernid')

In the future, when new translatable strings are added in the code, they will simply have to be surrounded by _() and the POT template updated (e.g. with './setup.py build_i18n') and committed for translators to see them in Launchpad.

Revision history for this message
Jono Bacon (jonobacon) wrote :

Thanks for the patch, David. Could you update your trunk and update the branch: this merge proposal applies to quite an old branch revision. Thanks!

review: Needs Fixing
lp:~dpm/lernid/enable-translations updated
20. By David Planella

Merged from trunk, enabled translations, updated POT file

Revision history for this message
David Planella (dpm) wrote :

Oops, sorry Jono, I had not correctly updated from trunk.

Here's a new merge proposal after having merged the latest trunk changes, the last for the weekend.

review: Needs Resubmitting

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/lernid'
2--- bin/lernid 2009-12-04 20:01:08 +0000
3+++ bin/lernid 2009-12-05 18:48:14 +0000
4@@ -29,6 +29,7 @@
5 import time
6 import datetime
7 import glib
8+import locale
9
10 # Check if we are working in the source tree or from the installed
11 # package and mangle the python path accordingly
12@@ -263,8 +264,8 @@
13 def connect_to_resources(self):
14 """Connect to the currently selected event."""
15
16- self.builder.get_object("statusbar").set_text("Connected to " + self.event)
17- self.send_notification("Connected to " + self.event)
18+ self.builder.get_object("statusbar").set_text(_("Connected to ") + self.event)
19+ self.send_notification(_("Connected to ") + self.event)
20
21 config = ConfigParser.ConfigParser()
22 config.read(os.path.join(self.lernidfolder_events, "config.lernid"))
23@@ -293,7 +294,7 @@
24 logging.debug("Disconnecting from %s" % self.event)
25 self.irc.disconnect()
26
27- self.send_notification("Disconnecting from " + self.event)
28+ self.send_notification(_("Disconnecting from ") + self.event)
29
30 self.schedule.hide()
31 self.chat.hide()
32@@ -336,6 +337,8 @@
33 if not os.path.exists(ui_filename):
34 ui_filename = None
35
36+ # Workaround for https://bugzilla.gnome.org/show_bug.cgi?id=574520
37+ locale.textdomain("lernid")
38 builder = gtk.Builder()
39 builder.add_from_file(ui_filename)
40 window = builder.get_object("lernid_window")
41@@ -345,8 +348,9 @@
42 if __name__ == "__main__":
43 #support for command line options
44 import logging, optparse
45+ gettext.install('lernid', unicode=True)
46 parser = optparse.OptionParser(version="%prog %ver")
47- parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="Show debug messages")
48+ parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help=_("Show debug messages"))
49 (options, args) = parser.parse_args()
50
51 #set the logging level to show debug messages
52@@ -354,8 +358,6 @@
53 logging.basicConfig(level=logging.DEBUG)
54 logging.debug('logging enabled')
55
56- gettext.install('lernid', unicode=True)
57-
58 #run the application
59 window = NewLernidWindow()
60 window.show()
61
62=== modified file 'po/lernid.pot'
63--- po/lernid.pot 2009-11-30 10:04:44 +0000
64+++ po/lernid.pot 2009-12-05 18:48:14 +0000
65@@ -8,7 +8,7 @@
66 msgstr ""
67 "Project-Id-Version: PACKAGE VERSION\n"
68 "Report-Msgid-Bugs-To: \n"
69-"POT-Creation-Date: 2009-11-29 21:33-0800\n"
70+"POT-Creation-Date: 2009-12-05 19:38+0100\n"
71 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
72 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
73 "Language-Team: LANGUAGE <LL@li.org>\n"
74@@ -17,30 +17,34 @@
75 "Content-Transfer-Encoding: 8bit\n"
76
77 #: ../data/ui/LernidWindow.ui.h:1
78-msgid "Chat Room"
79+msgid "<b>Chatroom</b>"
80 msgstr ""
81
82 #: ../data/ui/LernidWindow.ui.h:2
83-msgid "Classroom"
84-msgstr ""
85-
86-#: ../data/ui/LernidWindow.ui.h:3 ../lernid.desktop.in.h:1
87+msgid "<b>Classroom</b>"
88+msgstr ""
89+
90+#: ../data/ui/LernidWindow.ui.h:3
91+msgid "<b>Resources</b>"
92+msgstr ""
93+
94+#: ../data/ui/LernidWindow.ui.h:4
95+msgid "<b>Schedule</b>"
96+msgstr ""
97+
98+#: ../data/ui/LernidWindow.ui.h:5 ../lernid.desktop.in.h:1
99 msgid "Lernid"
100 msgstr ""
101
102-#: ../data/ui/LernidWindow.ui.h:4
103+#: ../data/ui/LernidWindow.ui.h:6
104 msgid "Not Connected."
105 msgstr ""
106
107-#: ../data/ui/LernidWindow.ui.h:5
108-msgid "Schedule"
109-msgstr ""
110-
111-#: ../data/ui/LernidWindow.ui.h:6
112+#: ../data/ui/LernidWindow.ui.h:7
113 msgid "_Event"
114 msgstr ""
115
116-#: ../data/ui/LernidWindow.ui.h:7
117+#: ../data/ui/LernidWindow.ui.h:8
118 msgid "_Help"
119 msgstr ""
120
121@@ -64,6 +68,10 @@
122 "with this program. If not, see <http://www.gnu.org/licenses/>."
123 msgstr ""
124
125+#: ../data/ui/AboutLernidDialog.ui.h:8
126+msgid "David Planella <david.planella@ubuntu.com>"
127+msgstr ""
128+
129 #: ../lernid.desktop.in.h:2
130 msgid "Lernid application"
131 msgstr ""
132@@ -87,3 +95,15 @@
133 #: ../data/ui/PreferencesLernidDialog.ui.h:2
134 msgid "gtk-ok"
135 msgstr ""
136+
137+#: ../bin/lernid.py:267 ../bin/lernid.py:268
138+msgid "Connected to "
139+msgstr ""
140+
141+#: ../bin/lernid.py:297
142+msgid "Disconnecting from "
143+msgstr ""
144+
145+#: ../bin/lernid.py:353
146+msgid "Show debug messages"
147+msgstr ""
148
149=== modified file 'setup.py' (properties changed: -x to +x)

Subscribers

People subscribed via source and target branches