diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-07-10 23:18:16 (GMT) |
---|---|---|
committer | Agustin Zubiaga <aguz@sugarlabs.org> | 2012-07-10 23:18:16 (GMT) |
commit | f297920a5a5f7adb886acae097bcda9703c4ed7a (patch) | |
tree | 44788038ad7b2c6e0bbea49c8d451252b6b56b4b | |
parent | f5df31d06c94d1f5b7df78c44116515a4a42433f (diff) |
use gettext
-rw-r--r-- | game.py | 8 | ||||
-rw-r--r-- | po/Guess.pot | 26 |
2 files changed, 31 insertions, 3 deletions
@@ -23,6 +23,8 @@ from gi.repository import Gdk from gi.repository import GdkPixbuf from gi.repository import GObject +from gettext import gettext as _ + import random SMILY_SIZE = 80 @@ -39,7 +41,7 @@ class Game(Gtk.Fixed): self.put(bg_image, 0, 0) - self._score_label = Gtk.Label('<b>%s:</b> %s' % ('Score', '0')) + self._score_label = Gtk.Label('<b>%s:</b> %s' % (_('Score'), '0')) self._score_label.set_use_markup(True) self.put(self._score_label, 5, 5) @@ -75,7 +77,7 @@ class Game(Gtk.Fixed): def lose(self): if not self.score <= 0: self.score -= 10 - self._score_label.set_markup('<b>%s:</b> %s' % ('Score', + self._score_label.set_markup('<b>%s:</b> %s' % (_('Score'), self.score)) pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size('icons/lose.svg', SMILY_SIZE, SMILY_SIZE) @@ -83,7 +85,7 @@ class Game(Gtk.Fixed): def win(self): self.score += 10 - self._score_label.set_markup('<b>%s:</b> %s' % ('Score', self.score)) + self._score_label.set_markup('<b>%s:</b> %s' % (_('Score'), self.score)) pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_size('icons/win.svg', SMILY_SIZE, SMILY_SIZE) self._smily.set_from_pixbuf(pixbuf) diff --git a/po/Guess.pot b/po/Guess.pot new file mode 100644 index 0000000..22159d6 --- /dev/null +++ b/po/Guess.pot @@ -0,0 +1,26 @@ +# 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: 2012-07-10 20:17-0300\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" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: activity/activity.info:2 +msgid "Guess" +msgstr "" + +#: game.py:44 game.py:80 game.py:88 +msgid "Score" +msgstr "" |