gnome-games r8060 - in trunk/glchess/src/lib: . gtkui



Author: rancell
Date: Fri Oct 17 11:59:40 2008
New Revision: 8060
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8060&view=rev

Log:
Add translator comments

Modified:
   trunk/glchess/src/lib/gtkui/chessview.py
   trunk/glchess/src/lib/gtkui/dialogs.py
   trunk/glchess/src/lib/gtkui/gtkui.py
   trunk/glchess/src/lib/gtkui/network.py
   trunk/glchess/src/lib/main.py

Modified: trunk/glchess/src/lib/gtkui/chessview.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/chessview.py	(original)
+++ trunk/glchess/src/lib/gtkui/chessview.py	Fri Oct 17 11:59:40 2008
@@ -14,13 +14,13 @@
 try:
     import OpenGL.GL
 except:
-    # Translators: This message is displayed when 3D mode is not available due to no Python OpenGL libraries
+    # Translators: Error message displayed when 3D mode is not available due to no Python OpenGL libraries
     openGLErrors.append(_('No Python OpenGL support'))
 try:
     import gtk.gtkgl
     import gtk.gdkgl
 except:
-    # Translators: This message is displayed when 3D mode is not available due to no Python GTKGLExt libraries
+    # Translators: Error message displayed when 3D mode is not available due to no Python GTKGLExt libraries
     openGLErrors.append(_('No Python GTKGLExt support'))
 else:
     display_mode = (gtk.gdkgl.MODE_RGB | gtk.gdkgl.MODE_DEPTH | gtk.gdkgl.MODE_DOUBLE)
@@ -31,17 +31,23 @@
         try:
             glConfig = gtk.gdkgl.Config(mode = display_mode)
         except gtk.gdkgl.NoMatches:
-            # Translators: This message is displayed when 3D mode is not available due to their 3D drivers not being able to provide a suitable display mode
+            # Translators: Error message displayed when 3D mode is not available due to their 3D drivers not being able to provide a suitable display mode
             openGLErrors.append(_('OpenGL libraries do not support required display mode'))
 haveGLSupport = len(openGLErrors) == 0
 
 __all__ = ['GtkView']
 
+              # Translators: pawn name used in human readable move format
 pieceNames = {glchess.chess.board.PAWN:   _('pawn'),
+              # Translators: rook name used in human readable move format
               glchess.chess.board.ROOK:   _('rook'),
+              # Translators: knight name used in human readable move format
               glchess.chess.board.KNIGHT: _('knight'),
+              # Translators: bishop name used in human readable move format
               glchess.chess.board.BISHOP: _('bishop'),
+              # Translators: queen name used in human readable move format
               glchess.chess.board.QUEEN:  _('queen'),
+              # Translators: king name used in human readable move format
               glchess.chess.board.KING:   _('king')}
 
 class GtkViewArea(gtk.DrawingArea):
@@ -251,6 +257,7 @@
         # Make a model for navigation (move object, number, description) 
         model = gtk.ListStore(gobject.TYPE_PYOBJECT, int, str)
         iter = model.append()
+        # Translators: Move History Combo: Go to the start of the game
         model.set(iter, 0, None, 1, 0, 2, _('Game Start'))
         self.moveModel = model
 
@@ -284,10 +291,11 @@
         if self.showComments:
             # Show the comments
             if move is None:
-                titleLabel.set_markup('<big><b>%s</b></big>' % _('Game start'))
+                titleLabel.set_markup('<big><b>%s</b></big>' % _('Game Start'))
             else:
                 titleLabel.set_markup('<big><b>%s</b></big>' % self.generateMoveString(move))
             
+            # Translators: Comment text when move has no comment
             comment = _('No comment')
             if move is not None and len(move.comment) > 0:
                 comment = move.comment
@@ -464,7 +472,7 @@
             self.ui._updateViewButtons()
 
     def endGame(self, game):
-        # Translators: This message is displayed when a player wins. The %s is substituted with the winning player's name
+        # Translators: Message displayed when a player wins. The %s is substituted with the winning player's name
         format = _('%s wins')
         
         # If game completed show this in the GUI
@@ -473,39 +481,39 @@
         elif game.result is glchess.game.RESULT_BLACK_WINS:
             title = format % game.getBlack().getName()
         else:
-            # Translators: This message is displayed when a game is drawn
+            # Translators: Message displayed when a game is drawn
             title = _('Game is drawn')
 
         description = ''
         if game.rule is glchess.game.RULE_CHECKMATE:
-            # Translators: This message is displayed when the game ends due to a player being checkmated
+            # Translators: Message displayed when the game ends due to a player being checkmated
             description = _('Opponent is in check and cannot move (checkmate)')
         elif game.rule is glchess.game.RULE_STALEMATE:
-            # Translators: This message is displayed when the game terminates due to a stalemate
+            # Translators: Message displayed when the game terminates due to a stalemate
             description = _('Opponent cannot move (stalemate)')
         elif game.rule is glchess.game.RULE_FIFTY_MOVES:
-            # Translators: This message is displayed when the game is drawn due to the fifty move rule
+            # Translators: Message displayed when the game is drawn due to the fifty move rule
             description = _('No piece has been taken or pawn moved in the last fifty moves')
         elif game.rule is glchess.game.RULE_TIMEOUT:
-            # Translators: This message is displayed when the game ends due to one player's clock stopping
+            # Translators: Message displayed when the game ends due to one player's clock stopping
             description = _('Opponent has run out of time')
         elif game.rule is glchess.game.RULE_THREE_FOLD_REPETITION:
-            # Translators: This message is displayed when the game is drawn due to the three-fold-repitition rule
+            # Translators: Message displayed when the game is drawn due to the three-fold-repitition rule
             description = _('The same board state has occured three times (three fold repetition)')
         elif game.rule is glchess.game.RULE_INSUFFICIENT_MATERIAL:
-            # Translators: This message is displayed when the game is drawn due to the insufficient material rule
+            # Translators: Message displayed when the game is drawn due to the insufficient material rule
             description = _('Neither player can cause checkmate (insufficient material)')
         elif game.rule is glchess.game.RULE_RESIGN:
             if game.result is glchess.game.RESULT_WHITE_WINS:
-                # Translators: This message is displayed when the game ends due to the black player resigning
+                # Translators: Message displayed when the game ends due to the black player resigning
                 description = _('The black player has resigned')
             elif game.result is glchess.game.RESULT_BLACK_WINS:
-                # Translators: This message is displayed when the game ends due to the white player resigning
+                # Translators: Message displayed when the game ends due to the white player resigning
                 description = _('The white player has resigned')
             else:
                 assert(False)
         elif game.rule is glchess.game.RULE_DEATH:
-            # Translators: This message is displayed when the game ends due to a player dying
+            # Translators: Message displayed when the game ends due to a player dying
             description = _('One of the players has died')
 
         self.gameResult = (title, description)

Modified: trunk/glchess/src/lib/gtkui/dialogs.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/dialogs.py	(original)
+++ trunk/glchess/src/lib/gtkui/dialogs.py	Fri Oct 17 11:59:40 2008
@@ -120,12 +120,17 @@
             
         # Create model for game time
         defaultTime = glchess.config.get('new_game_dialog/move_time')
-        # Translators: This is one of the options game duration combo box in the new game dialog
+                  # Translators: Time Combo: There is no time limit
         times = [(_('Unlimited'),       0),
+                  # Translators: Time Combo: Game will last one minute
                  (_('One minute'),     60),
+                  # Translators: Time Combo: Game will last five minutes
                  (_('Five minutes'),  300),
+                  # Translators: Time Combo: Game will last 30 minutes
                  (_('30 minutes'),   1800),
+                  # Translators: Time Combo: Game will last one hour
                  (_('One hour'),     3600),
+                  # Translators: Time Combo: User will configure game duration
                  (_('Custom'),         -1)]
         timeModel = gtk.ListStore(str, int)
         activeIter = None
@@ -146,8 +151,11 @@
         widget.add_attribute(cell, 'text', 0)
 
         model = gtk.ListStore(str, int)
+                  # Translators: Custom Time Combo: User specifying number of seconds for game duration
         units = [(_('seconds'),  1),
+                  # Translators: Custom Time Combo: User specifying number of minutes for game duration
                  (_('minutes'), 60),
+                  # Translators: Custom Time Combo: User specifying number of hours for game duration
                  (_('hours'), 3600)]
         for (name, multiplier) in units:
             iter = model.append()
@@ -165,8 +173,11 @@
 
         # Create the model for difficulty options
         levelModel = gtk.ListStore(str, str, str)
+                  # Translators: AI Difficulty Combo: AI set to easy difficulty
         levels = [('easy',   _('Easy'),   'weather-few-clouds'),
+                  # Translators: AI Difficulty Combo: AI set to normal diffuculty
                   ('normal', _('Normal'), 'weather-overcast'),
+                  # Translators: AI Difficulty Combo: AI set to hard diffuculty
                   ('hard',   _('Hard'),   'weather-storm')]
         for (key, label, icon) in levels:
             iter = levelModel.append()
@@ -229,21 +240,26 @@
         if g is not None:
             self.__gui.get_widget('game_name_entry').set_text(g.name)
             self.__customName = True
+            # Translators: Error displayed when unable to load a game due to
+            # the require game engine not being available. %s is replaced with
+            # the name of the missing engine.
+            noEngineFormat = _('Unable to find %s engine')
             if not self.__setCombo('white_type_combo', g.white.type):
-                errors.append(_('Unable to find %s engine') % repr(g.white.type))
+                errors.append(noEngineFormat % repr(g.white.type))
             self.__setCombo('white_difficulty_combo', g.white.level)
             if not self.__setCombo('black_type_combo', g.black.type):
-                errors.append(_('Unable to find %s engine') % repr(g.black.type))
+                errors.append(noEngineFormat % repr(g.black.type))
             self.__setCombo('black_difficulty_combo', g.black.level)
             # TODO: Others
             
             # Change title for loaded games
             if g.path is not None:
-                # Translators: This is the title of the dialog when continuing a loaded game
+                # Translators: New Game Dialog: Title of the dialog when continuing a loaded game
                 self.window.set_title(_('Configure loaded game (%i moves)') % len(g.moves))
 
         # Display warning if missing the AIs
         if len(errors) > 0:
+            # Translators: New Game Dialog: Title of error box when loaded game had AI engines missing
             self.__gui.get_widget('info_title_label').set_markup('<big><b>%s</b></big>' % _('Game settings changed'))
             self.__gui.get_widget('info_description_label').set_markup('<i>%s</i>' % '\n'.join(errors))
             self.__gui.get_widget('info_box').show()
@@ -306,7 +322,7 @@
         else:
             whiteName = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
             blackName = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
-            # Translators: This is the default name for a new game. %(white) and %(black) are substituted for the names of the white and black players.
+            # Translators: Default name for a new game. %(white) and %(black) are substituted for the names of the white and black players.
             format = _('%(white)s versus %(black)s')
             self.__gui.get_widget('game_name_entry').set_text(format % {'white': whiteName, 'black': blackName})
 
@@ -330,14 +346,14 @@
         # Get the players
         game.white.type  = self.__getComboData(self.__gui.get_widget('white_type_combo'), 0)
         if game.white.type == '':
-            # Translators: This is the default name for the white player
+            # Translators: Default name for the white player
             game.white.name = _('White')
         else:
             game.white.name = self.__getComboData(self.__gui.get_widget('white_type_combo'), 2)
         game.white.level = self.__getComboData(self.__gui.get_widget('white_difficulty_combo'), 0)
         game.black.type  = self.__getComboData(self.__gui.get_widget('black_type_combo'), 0)
         if game.black.type == '':
-            # Translators: This is the default name for the black player
+            # Translators: Default name for the black player
             game.black.name = _('Black')
         else:
             game.black.name = self.__getComboData(self.__gui.get_widget('black_type_combo'), 2)
@@ -447,7 +463,7 @@
 
             fileName = self.__gui.get_widget('filechooserwidget').get_filename()
             if fileName is None:
-                # Translators: This message is displayed in the load dialog when no file is selected
+                # Translators: Message displayed in load game dialog when no file is selected
                 error = _('Please select a file to load')
             else:
                 error = self.__mainUI.feedback.loadGame(fileName, responseId == gtk.RESPONSE_YES)
@@ -455,6 +471,7 @@
             if error is not None:
                 self.firstExpose = True
                 self.__gui.get_widget('error_box').show()
+                # Translators: Title of error box when unable to load game
                 self.__gui.get_widget('error_title_label').set_markup('<big><b>%s</b></big>' % _('Unabled to load game'))
                 self.__gui.get_widget('error_description_label').set_markup('<i>%s</i>' % error)
                 return
@@ -524,6 +541,7 @@
             # Append .pgn to the end if not provided
             fname = chooser.get_filename()
             if fname is None:
+                # Translators: Save Game Dialog: Error displayed when no file name entered
                 self.__setError(_('Please enter a file name'), '')
                 return
             if fname[-4:].lower() != '.pgn':
@@ -536,6 +554,7 @@
 
             error = self.__mainUI._saveView(self.__view, fname)
             if error is not None:
+                # Translators: Save Game Dialog: Error title when unable to save game
                 self.__setError(_('Unabled to save game'), error)
                 return
         else:
@@ -561,20 +580,27 @@
         moveModel = gtk.ListStore(str, str)
         widget = self.__gui.get_widget('move_format_combo')
         widget.set_model(moveModel)
+                        # Translators: Move Format Combo: Moves shown in human descriptive notation
         move_formats = [('human', _('Human')),
+                        # Translators: Move Format Combo: Moves shown in long algebraic notation (LAN)
                         ('lan', _('Long Algebraic')),
+                        # Translators: Move Format Combo: Moves shown in standard algebraic notation (SAN)
                         ('san', _('Standard Algebraic'))]
         for (key, label) in move_formats:
             iter = moveModel.append()
             moveModel.set(iter, 0, label, 1, key)
 
-        # Make modelfor board orientation
+        # Make model for board orientation
         boardModel = gtk.ListStore(str, str)
         widget = self.__gui.get_widget('board_combo')
         widget.set_model(boardModel)
+                     # Translators: Board Side Combo: Camera will face white player's side
         view_list = [('white', _('White Side')),
+                     # Translators: Board Side Combo: Camera will face black player's side
                      ('black', _('Black Side')),
+                     # Translators: Board Side Combo: Camera will face human player's side
                      ('human', _('Human Side')),
+                     # Translators: Board Side Combo: Camera will face current player's side
                      ('current', _('Current Player'))]
         for (key, label) in view_list:
             iter = boardModel.append()
@@ -584,9 +610,13 @@
         promotionModel = gtk.ListStore(str, str)
         widget = self.__gui.get_widget('promotion_type_combo')
         widget.set_model(promotionModel)
-        promotion_list = [('queen', _('Queen')),
+                          # Translators: Promotion Combo: Promote to a queen
+        promotion_list = [('queen',  _('Queen')),
+                          # Translators: Promotion Combo: Promote to a knight
                           ('knight', _('Knight')),
-                          ('rook', _('Rook')),
+                          # Translators: Promotion Combo: Promote to a rook
+                          ('rook',   _('Rook')),
+                          # Translators: Promotion Combo: Promote to a bishop
                           ('bishop', _('Bishop'))]
         for (key, label) in promotion_list:
             iter = promotionModel.append()

Modified: trunk/glchess/src/lib/gtkui/gtkui.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/gtkui.py	(original)
+++ trunk/glchess/src/lib/gtkui/gtkui.py	Fri Oct 17 11:59:40 2008
@@ -359,13 +359,13 @@
         # Set the window title to the name of the game
         if self.view is not None and len(self.view.title) > 0:
             if self.view.needsSaving:
-                # Translators: This is the window title when playing a game that needs saving
+                # Translators: Window title when playing a game that needs saving
                 title = _('Chess - *%(game_name)s') % {'game_name': self.view.title}
             else:
-                # Translators: This is the window title when playing a game that is saved
+                # Translators: Window title when playing a game that is saved
                 title = _('Chess - %(game_name)s') % {'game_name': self.view.title}
         else:
-            # Translators: This is the window title when not playing a game
+            # Translators: Window title when not playing a game
             title = _('Chess')            
         self.mainWindow.set_title(title)
 
@@ -377,13 +377,16 @@
     def setTimers(self, whiteTime, blackTime):
         """
         """
+        # Translators: Game Timer Label: Indicates that game has no time limit
+        unlimitedTimeText = _('â')
+        
         if whiteTime is None:
-            whiteString = _('â')
+            whiteString = unlimitedTimeText
         else:
             t = whiteTime[1]
             whiteString = '%i:%02i' % (t / 60, t % 60)
         if blackTime is None:
-            blackString = _('â')
+            blackString = unlimitedTimeText
         else:
             t = blackTime[1]
             blackString = '%i:%02i' % (t / 60, t % 60)
@@ -462,9 +465,9 @@
         dialog = gtk.MessageDialog(flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                                    type = gtk.MESSAGE_WARNING,
                                    message_format = title)
-        # Translators: This text is displayed in a dialog asking the user to save the current game
-        dialog.format_secondary_text("If you don't save the changes to this game will be permanently lost")
-        # Translators: This is the button text in the save game dialog to decline to save the game
+        # Translators: Save Game Dialog: Notice that game needs saving
+        dialog.format_secondary_text(_("If you don't save the changes to this game will be permanently lost"))
+        # Translators: Save Game Dialog: Discard game button
         dialog.add_button(_('Close _without saving'), gtk.RESPONSE_OK)
         dialog.add_button(gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT)
         dialog.add_button(gtk.STOCK_SAVE, gtk.RESPONSE_ACCEPT)
@@ -579,10 +582,11 @@
         # Enable/disable OpenGL rendering
         elif name == 'show_3d':            
             if value and not chessview.haveGLSupport:
-                # Translators: This is the title of the dialog that is displayed when a user tries to enable 3D without the required libraries
+                # Translators: No 3D Dialog: Title
                 title = _('Unable to enable 3D mode')
                 errors = '\n'.join(chessview.openGLErrors)
-                # Translators: This is displayed in a dialog when a user tries to enable 3D without the required libraries. %(error)s will be replaced with a list of reasons why 3D is not available.
+                # Translators: No 3D Dialog: Notification to user that they do not have libraries required to enable 3D.
+                # %(error)s will be replaced with a list of reasons why 3D is not available.
                 description = _("""You are unable to play in 3D mode due to the following problems:
 %(errors)s
 
@@ -835,9 +839,9 @@
         if self.view.feedback.claimDraw():
             return
         
-        # Translators: This is the title of the dialog that is displayed when a user requests a draw but one is not available
+        # Translators: Draw Dialog: Title
         title = _("Unable to claim draw")
-        # Translators: This is the message that is displayed in a dialog when a user requests a draw but one is not available
+        # Translators: Draw Dialog: Notify user why they cannot claim draw
         message = _("""You may claim a draw when:
 a) The board has been in the same state three times (Three fold repetition)
 b) Fifty moves have occured where no pawn has moved and no piece has been captured (50 move rule)""")

Modified: trunk/glchess/src/lib/gtkui/network.py
==============================================================================
--- trunk/glchess/src/lib/gtkui/network.py	(original)
+++ trunk/glchess/src/lib/gtkui/network.py	Fri Oct 17 11:59:40 2008
@@ -32,6 +32,7 @@
         
         self.profileModel = gtk.ListStore(gobject.TYPE_PYOBJECT, str)
         iter = self.profileModel.append()
+        # Translators: Server Combo Box: Not connected to a server
         self.profileModel.set(iter, 0, None, 1, _('Disconnected'))
         
         widget = self.__gui.get_widget('server_combo')
@@ -89,23 +90,28 @@
         view.set_model(self.tableModel)
         
         cell = gtk.CellRendererText()
+        # Translators: Available GGZ Tables: Table name column title
         column = gtk.TreeViewColumn(_('Table'), cell)
         column.add_attribute(cell, 'text', 1)
         view.append_column(column)
         cell = gtk.CellRendererText()
+        # Translators: Available GGZ Tables: Seat status column title
         column = gtk.TreeViewColumn(_('Seats'), cell)
         column.add_attribute(cell, 'text', 2)
         view.append_column(column)
         cell = gtk.CellRendererText()
+        # Translators: Available GGZ Tables: Table description column title        
         column = gtk.TreeViewColumn(_('Description'), cell)
         column.add_attribute(cell, 'text', 3)
         view.append_column(column)
 
         view = self.__gui.get_widget('seat_list')
         cell = gtk.CellRendererText()
+        # Translators: Current GGZ Table: Seat name column title
         column = gtk.TreeViewColumn(_('Seat'), cell)
         column.add_attribute(cell, 'text', 2)
         view.append_column(column)
+        # Translators: Current GGZ Table: Player name column title        
         column = gtk.TreeViewColumn(_('Player'), cell)
         column.add_attribute(cell, 'text', 3)
         column.add_attribute(cell, 'style', 4)
@@ -252,10 +258,13 @@
             iter = seatModel.append()
             
         if number == 0:
+            # Translators: GGZ seat is occupied by the white player
             seatName = _('White')
         elif number == 1:
+            # Translators: GGZ seat is occupied by the black player            
             seatName = _('Black')
         else:
+            # Translators: GGZ seat is occupied by a spectator
             seatName = _('Spectator')
 
         style = pango.STYLE_ITALIC
@@ -263,11 +272,16 @@
         if type == 'player':
             style = pango.STYLE_NORMAL
         elif type == 'reserved':
-            occupant = _('Reserved for %s' % name)
+            # Translators: GGZ seat status: This seat is reserved. %s is replaced with
+            # the name of the player the seat is reserved for.
+            occupant = _('Reserved for %s') % name
         elif type == 'open':
+            # Translators: GGZ seat status: This seat is not taken
             occupant = _('Seat empty')
         elif type == 'bot':
-            occupant = _('AI (%s)' % name)
+            # Translators: GGZ seat status: This seat contains an AI player.
+            # %s is replaced with the name of the AI.
+            occupant = _('AI (%s)') % name
 
         seatModel.set(iter, 0, number, 1, type, 2, seatName, 3, occupant, 4, style)
 

Modified: trunk/glchess/src/lib/main.py
==============================================================================
--- trunk/glchess/src/lib/main.py	(original)
+++ trunk/glchess/src/lib/main.py	Fri Oct 17 11:59:40 2008
@@ -110,6 +110,9 @@
         
         Returns an AI player to use (game.ChessPlayer).
         """
+        # Translators: Description of an AI player used in log window. %(name)s is replaced with
+        # the name of the AI player. %(game)s is replaced with the name of the game the AI player
+        # is in.
         description = _("'%(name)s' in '%(game)s'") % {'name': name, 'game': self.name}
         p = player.AIPlayer(self.application, name, profile, level, description)
         self.__aiPlayers.append(p)
@@ -442,7 +445,7 @@
         
         self.history = history.GameHistory()
         
-        # Translators: This is the name of the log that displays application events
+        # Translators: Name of the log that displays application events
         title = _('Application Log')
         self.logger = self.ui.controller.addLogWindow(title, '', '')
 
@@ -689,8 +692,8 @@
             self.logger.addLine('loaded in %f seconds' % (time.time() - s))
 
         else:
-            # Translators: This is the text displayed on the command-line if an unknown argument is passed
             # FIXME: Should be in a dialog
+            # Translators: Text displayed on the command-line if an unknown argument is passed
             print _('Usage: %s [game]') % sys.argv[0]
             sys.exit(0)
 
@@ -701,9 +704,11 @@
                     aiName = p.name
                     break
             black = (aiName, 'easy')
-            # Translators: This is the name of a human versus AI game. The %s is replaced with the name of the AI player
+            # Translators: Name of a human versus AI game. The %s is replaced with the name of the AI player
             gameName = _('Human versus %s') % aiName
+            # Translators: Name of white player in a default game
             whiteName =  _('White')
+            # Translators: Name of black player in a default game            
             blackName = _('Black')
             g = self.addLocalGame(gameName, whiteName, None, blackName, black)
             g.inHistory = True



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]