diff gamelib/scenes/crew_quarters.py @ 770:a35f5364437d pyntnclick

Merge i18n
author Stefano Rivera <stefano@rivera.za.net>
date Sat, 26 Jan 2013 17:00:43 +0200
parents a8510f4e2ea1 43b49f1de828
children eed75a1d50c4
line wrap: on
line diff
--- a/gamelib/scenes/crew_quarters.py	Sat Jan 26 15:24:56 2013 +0200
+++ b/gamelib/scenes/crew_quarters.py	Sat Jan 26 17:00:43 2013 +0200
@@ -1,5 +1,6 @@
 """Crew quarters."""
 
+from pyntnclick.i18n import _
 from pyntnclick.cursor import CursorSprite
 from pyntnclick.state import Scene, Item, Thing, Result
 from pyntnclick.scenewidgets import (
@@ -27,10 +28,10 @@
         self.add_thing(PosterThing())
         self.add_thing(MonitorCamera())
         self.add_thing(GenericDescThing('crew.plant', 1,
-            "The plant is doing surprisingly well for centuries of neglect",
+            _("The plant is doing surprisingly well for centuries of neglect"),
             ((624, 215, 61, 108),)))
         self.add_thing(GenericDescThing('crew.cat', 2,
-            "A picture of a cat labelled 'Clementine'",
+            _("A picture of a cat labelled 'Clementine'"),
             ((722, 382, 66, 72),)))
 
 
@@ -76,33 +77,34 @@
                 self.set_data('has_tape', False)
                 self.game.add_inventory_item('duct_tape')
                 self.set_interact()
-                return Result("Duct tape. It'll stick to everything except "
-                              "ducts, apparently.")
-            return Result("The perfectly balanced door swings frictionlessly "
-                          "to and fro. What craftsmanship!")
-        return Result("The safe is locked. This might be an interesting "
-                      "challenge, if suitable equipment can be found.")
+                return Result(_("Duct tape. It'll stick to everything except "
+                                "ducts, apparently."))
+            return Result(_("The perfectly balanced door swings "
+                            "frictionlessly to and fro. What craftsmanship!"))
+        return Result(_("The safe is locked. This might be an interesting "
+                        "challenge, if suitable equipment can be found."))
 
     def interact_with_stethoscope(self, item):
         if self.get_data('is_cracked'):
-            return Result("It's already unlocked. There's no more challenge.")
+            return Result(_("It's already unlocked. "
+                            "There's no more challenge."))
         # TODO: Add years to the sentence for safecracking.
         # TODO: Wax lyrical some more about safecracking.
         self.set_data('is_cracked', True)
         self.set_interact()
-        return (Result("Even after centuries of neglect, the tumblers slide"
-                      " almost silently into place. Turns out the combination"
-                      " was '1 2 3 4 5'. An idiot must keep his luggage in"
-                      " here."),
-                      make_jim_dialog("Prisoner %s, you have been observed"
-                          " committing a felony violation. This will go onto"
-                          " your permanent record, and your sentence may be"
-                          " extended by up to twenty years."
-                          % PLAYER_ID, self.game))
+        return (Result(_("Even after centuries of neglect, the tumblers slide"
+                         " almost silently into place. Turns out the"
+                         " combination was '1 2 3 4 5'. An idiot must keep his"
+                         " luggage in here.")),
+                make_jim_dialog(_("Prisoner %s, you have been observed"
+                                  " committing a felony violation. This will"
+                                  " go onto your permanent record, and your"
+                                  " sentence may be extended by up to twenty"
+                                  " years.") % PLAYER_ID, self.game))
 
     def get_description(self):
-        return "Ah, a vintage Knoxx & Co. model QR3. Quaint, but" \
-                " reasonably secure."
+        return _("Ah, a vintage Knoxx & Co. model QR3. Quaint, but"
+                 " reasonably secure.")
 
 
 class FishbowlThing(Thing):
@@ -128,20 +130,20 @@
 
     def interact_without(self):
         if not self.get_data('has_bowl'):
-            return Result("What's the point of lugging around a very dead"
-                    " fish and a kilogram or so of sand?")
+            return Result(_("What's the point of lugging around a very dead"
+                            " fish and a kilogram or so of sand?"))
         self.set_data('has_bowl', False)
         self.set_interact()
         self.game.add_inventory_item('fishbowl')
-        return Result("The fishbowl is useful, but its contents aren't.")
+        return Result(_("The fishbowl is useful, but its contents aren't."))
 
     def get_description(self):
         if self.get_data('has_bowl'):
-            return "This fishbowl looks exactly like an old science fiction" \
-                    " space helmet."
+            return _("This fishbowl looks exactly like an old science fiction"
+                     " space helmet.")
         else:
-            return "An evicted dead fish and some sand lie forlornly on the" \
-                    " table"
+            return _("An evicted dead fish and some sand lie forlornly on the"
+                     " table")
 
 
 class Fishbowl(Item):
@@ -155,8 +157,9 @@
         helmet = FishbowlHelmet('helmet')
         self.game.add_item(helmet)
         self.game.replace_inventory_item(self.name, helmet.name)
-        return Result("You duct tape the edges of the helmet. The seal is"
-                " crude, but it will serve as a workable helmet if needed.")
+        return Result(_("You duct tape the edges of the helmet. The seal is"
+                        " crude, but it will serve as a workable helmet if"
+                        " needed."))
 
 
 class FishbowlHelmet(Item):
@@ -202,10 +205,10 @@
 
     def interact_without(self):
         self.take()
-        return Result("This poster will go nicely on your bedroom wall.")
+        return Result(_("This poster will go nicely on your bedroom wall."))
 
     def get_description(self):
-        return "A paradoxical poster hangs below the security camera."
+        return _("A paradoxical poster hangs below the security camera.")
 
 
 class EscherPoster(Item):