comparison gamelib/scenes/game_widgets.py @ 765:2f1952748cdb i18n

merge i18n and Russian translation
author Stefano Rivera <stefano@rivera.za.net>
date Tue, 08 Mar 2011 14:37:43 +0200
parents 821b322e903b
children 43b49f1de828
comparison
equal deleted inserted replaced
528:0ce08d5e2acb 765:2f1952748cdb
1 """Generic, game specific widgets""" 1 """Generic, game specific widgets"""
2 2
3 3
4 from gamelib.i18n import _
4 from gamelib.state import Thing, Result 5 from gamelib.state import Thing, Result
5 6
6 7
7 class Door(Thing): 8 class Door(Thing):
8 """A door somewhere""" 9 """A door somewhere"""
20 def interact_without(self): 21 def interact_without(self):
21 """Go to map.""" 22 """Go to map."""
22 self.state.set_current_scene("map") 23 self.state.set_current_scene("map")
23 24
24 def get_description(self): 25 def get_description(self):
25 return 'An open doorway leads to the rest of the ship.' 26 return _('An open doorway leads to the rest of the ship.')
26 27
27 def interact_default(self, item): 28 def interact_default(self, item):
28 return self.interact_without() 29 return self.interact_without()
29 30
30 31
45 } 46 }
46 47
47 def get_description(self): 48 def get_description(self):
48 status = self.state.scenes['bridge'].get_data('ai status') 49 status = self.state.scenes['bridge'].get_data('ai status')
49 if status == 'online': 50 if status == 'online':
50 return "A security camera watches over the room" 51 return _("A security camera watches over the room")
51 elif status == 'looping': 52 elif status == 'looping':
52 return "The security camera is currently offline but should be working soon" 53 return _("The security camera is currently offline but should be working soon")
53 else: 54 else:
54 return "The security camera is powered down" 55 return _("The security camera is powered down")
55 56
56 def is_interactive(self, tool=None): 57 def is_interactive(self, tool=None):
57 return self.state.scenes['bridge'].get_data('ai status') == 'online' 58 return self.state.scenes['bridge'].get_data('ai status') == 'online'
58 59
59 def interact_with_escher_poster(self, item): 60 def interact_with_escher_poster(self, item):
60 # Order matters here, because of helper function 61 # Order matters here, because of helper function
61 if self.state.scenes['bridge'].get_data('ai status') == 'online': 62 if self.state.scenes['bridge'].get_data('ai status') == 'online':
62 ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state) 63 ai_response = make_jim_dialog(_("3D scene reconstruction failed. Critical error. Entering emergency shutdown."), self.state)
63 self.state.scenes['bridge'].set_data('ai status', 'looping') 64 self.state.scenes['bridge'].set_data('ai status', 'looping')
64 return ai_response 65 return ai_response
65 66
66 def animate(self): 67 def animate(self):
67 ai_status = self.state.scenes['bridge'].get_data('ai status') 68 ai_status = self.state.scenes['bridge'].get_data('ai status')