# HG changeset patch # User Stefano Rivera # Date 1359220387 -7200 # Node ID 6a3440c8be8da0aa6e8864e406373705f873a993 # Parent 5fb9624341590de9e3acab858dd3ec5bdfd149cc The title needs to be lazily translated. It's evaluated before we set up gettext diff -r 5fb962434159 -r 6a3440c8be8d gamelib/constants.py --- a/gamelib/constants.py Sat Jan 26 18:54:34 2013 +0200 +++ b/gamelib/constants.py Sat Jan 26 19:13:07 2013 +0200 @@ -1,5 +1,8 @@ from pyntnclick.constants import GameConstants -from pyntnclick.i18n import _ + +# Anything here has to be explicitly translated +# This module is imported before we've set up i18n +_ = lambda x: x class SSConstants(GameConstants): diff -r 5fb962434159 -r 6a3440c8be8d po/ru.po --- a/po/ru.po Sat Jan 26 18:54:34 2013 +0200 +++ b/po/ru.po Sat Jan 26 19:13:07 2013 +0200 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: suspended-sentence 1.0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-26 18:41+0200\n" +"POT-Creation-Date: 2013-01-26 19:09+0200\n" "PO-Revision-Date: 2011-03-08 23:13+0600\n" "Last-Translator: Sergey Basalaev \n" "Language-Team: Russian\n" @@ -19,7 +19,7 @@ "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" -#: gamelib/constants.py:6 +#: gamelib/constants.py:9 msgid "Suspended Sentence" msgstr "Анабиоз" diff -r 5fb962434159 -r 6a3440c8be8d po/suspended-sentence.pot --- a/po/suspended-sentence.pot Sat Jan 26 18:54:34 2013 +0200 +++ b/po/suspended-sentence.pot Sat Jan 26 19:13:07 2013 +0200 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-26 18:41+0200\n" +"POT-Creation-Date: 2013-01-26 19:10+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: gamelib/constants.py:6 +#: gamelib/constants.py:9 msgid "Suspended Sentence" msgstr "" diff -r 5fb962434159 -r 6a3440c8be8d pyntnclick/main.py --- a/pyntnclick/main.py Sat Jan 26 18:54:34 2013 +0200 +++ b/pyntnclick/main.py Sat Jan 26 19:13:07 2013 +0200 @@ -11,6 +11,7 @@ import pygame from pygame.locals import SWSURFACE +from pyntnclick.i18n import _ from pyntnclick.engine import Engine from pyntnclick.gamescreen import DefMenuScreen, DefEndScreen, GameScreen from pyntnclick.constants import GameConstants, DEBUG_ENVVAR @@ -128,7 +129,7 @@ for option in self.debug_options: if option in sys.argv: self.warn_debug(option) - opts, _ = parser.parse_args(sys.argv) + opts, args = parser.parse_args(sys.argv) pygame.display.init() pygame.font.init() if opts.sound: @@ -159,7 +160,8 @@ pygame.display.set_icon(self.resource.get_image( self.constants.icon, basedir='icons')) if self.constants.title: - pygame.display.set_caption(self.constants.title) + title = _(self.constants.title).encode('utf-8') + pygame.display.set_caption(title) self.engine = Engine(self) # Initialize the special screens in the engine