Mercurial > pyntnclick
diff gamelib/scenes/machine.py @ 478:a9925aaf5f61 1.0.1
i18n and Russian translation
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Tue, 08 Mar 2011 12:29:14 +0200 |
parents | af2a23b9787d |
children | 2f1952748cdb |
line wrap: on
line diff
--- a/gamelib/scenes/machine.py Sun Aug 29 12:33:21 2010 +0200 +++ b/gamelib/scenes/machine.py Tue Mar 08 12:29:14 2011 +0200 @@ -6,6 +6,7 @@ InteractRectUnion, InteractImage, InteractAnimated, GenericDescThing) +from gamelib.i18n import _ class Machine(Scene): @@ -26,7 +27,7 @@ self.add_item(CryoPipesThree('cryo_pipes_three')) self.add_item(Manual('manual')) self.add_thing(GenericDescThing('machine.wires', 2, - "Wires run to all the machines in the room", + _("Wires run to all the machines in the room"), ( (250, 172, 252, 12), (388, 183, 114, 13), @@ -46,16 +47,16 @@ (674, 54, 23, 36), ))) self.add_thing(GenericDescThing('machine.diagram', 3, - "A wiring diagram of some sort", + _("A wiring diagram of some sort"), ((694, 140, 94, 185),))) self.add_thing(GenericDescThing('machine.powerpoint', 4, - "The cables to this power point have been cut", + _("The cables to this power point have been cut"), ((155, 22, 92, 74),))) self.add_thing(GenericDescThing("machine.powerpoint", 5, - "All the machines run off this powerpoint", + _("All the machines run off this powerpoint"), ((593, 19, 74, 57),))) self.add_thing(GenericDescThing("machine.drill_press", 6, - "An impressive looking laser drill press", + _("An impressive looking laser drill press"), ( (519, 338, 36, 63), (545, 348, 93, 46), @@ -68,7 +69,7 @@ (605, 304, 26, 8), ))) self.add_thing(GenericDescThing("machine.drill_press_block", 7, - "The block for the laser drill press", # TODO: fix description + _("The block for the laser drill press"), # TODO: fix description ((461, 446, 38, 27),))) @@ -114,40 +115,40 @@ self.set_interact("can_and_tube") def interact_without(self): - return Result("You really don't want to put your hand in there.") + return Result(_("You really don't want to put your hand in there.")) def interact_with_empty_can(self, item): contents = self.get_data('contents') if "can" in contents: - return Result("There is already a can in the welder.") + return Result(_("There is already a can in the welder.")) self.state.remove_inventory_item(item.name) contents.add("can") self.update_contents() - return Result("You carefully place the can in the laser welder.") + return Result(_("You carefully place the can in the laser welder.")) def interact_with_tube_fragment(self, item): contents = self.get_data('contents') if "tube" in contents: - return Result("There is already a tube fragment in the welder.") + return Result(_("There is already a tube fragment in the welder.")) self.state.remove_inventory_item(item.name) contents.add("tube") self.update_contents() - return Result("You carefully place the tube fragments in the laser welder.") + return Result(_("You carefully place the tube fragments in the laser welder.")) def get_description(self): contents = self.get_data('contents') if not contents: - return "This is a Smith and Wesson 'zOMG' class high-precision laser welder." + return _("This is a Smith and Wesson 'zOMG' class high-precision laser welder.") if len(contents) == 1: - msg = "The laser welder looks hungry, somehow." + msg = _("The laser welder looks hungry, somehow.") if "can" in contents: - msg += " It currently contains an empty can." + msg += _(" It currently contains an empty can.") elif "tube" in contents: - msg += " It currently contains a tube fragment." + msg += _(" It currently contains a tube fragment.") elif len(contents) == 2: - msg = "The laser welder looks expectant. " + msg = _("The laser welder looks expectant. ") if "can" in contents and "tube" in contents: - msg += " It currently contains an empty can and a tube fragment." + msg += _(" It currently contains an empty can and a tube fragment.") return msg @@ -164,32 +165,32 @@ def interact_without(self): contents = self.scene.things["machine.welder.slot"].get_data("contents") if not contents: - return Result("The laser welder doesn't currently contain anything weldable.") + return Result(_("The laser welder doesn't currently contain anything weldable.")) elif len(contents) == 1: if "can" in contents: - return Result("The laser welder needs something to weld the can to.") + return Result(_("The laser welder needs something to weld the can to.")) elif "tube" in contents: - return Result("The laser welder needs something to weld the tube fragments to.") + return Result(_("The laser welder needs something to weld the tube fragments to.")) else: self.scene.things["machine.welder.slot"].set_data("contents", set()) self.scene.things["machine.welder.slot"].update_contents() if self.state.items["cryo_pipes_one"] in self.state.inventory: self.state.replace_inventory_item("cryo_pipes_one", "cryo_pipes_two") - return Result("With high-precision spitzensparken, you weld" - " together a second pipe. You bundle the two pipes together.", + return Result(_("With high-precision spitzensparken, you weld" + " together a second pipe. You bundle the two pipes together."), soundfile='laser.ogg') elif self.state.items["cryo_pipes_two"] in self.state.inventory: self.state.replace_inventory_item("cryo_pipes_two", "cryo_pipes_three") - return Result("With high-precision spitzensparken, you create yet" - " another pipe. You store it with the other two.", + return Result(_("With high-precision spitzensparken, you create yet" + " another pipe. You store it with the other two."), soundfile='laser.ogg') elif self.state.items["cryo_pipes_three"] in self.state.inventory: # just for safety return None else: self.state.add_inventory_item("cryo_pipes_one") - return Result("With high-precision spitzensparken, the can and tube are welded" - " into a whole greater than the sum of the parts.", + return Result(_("With high-precision spitzensparken, the can and tube are welded" + " into a whole greater than the sum of the parts."), soundfile='laser.ogg') @@ -204,7 +205,7 @@ INITIAL = 'lights' def get_description(self): - return "The power lights pulse expectantly." + return _("The power lights pulse expectantly.") class CryoPipesOne(Item): @@ -242,17 +243,17 @@ INITIAL = "grind" def interact_without(self): - return Result("It looks like it eats fingers. Perhaps a different approach is in order?") + return Result(_("It looks like it eats fingers. Perhaps a different approach is in order?")) def interact_with_titanium_leg(self, item): self.state.replace_inventory_item(item.name, 'machete') - return Result("After much delicate grinding and a few close calls with" + return Result(_("After much delicate grinding and a few close calls with" " various body parts, the titanium femur now resembles" - " a machete more than a bone. Nice and sharp, too.", + " a machete more than a bone. Nice and sharp, too."), soundfile="grinder.ogg") def get_description(self): - return "A pretty ordinary, albeit rather industrial, grinding machine." + return _("A pretty ordinary, albeit rather industrial, grinding machine.") class TitaniumMachete(Item): @@ -275,9 +276,9 @@ def interact_without(self): self.scene.remove_thing(self) self.state.add_inventory_item("manual") - return Result("Ah! The ship's instruction manual. You'd feel better" + return Result(_("Ah! The ship's instruction manual. You'd feel better" " if the previous owner wasn't lying next to it with a" - " gaping hole in his rib cage.") + " gaping hole in his rib cage.")) class Manual(Item):