Changeset 112:d8661c37cda9


Ignore:
Timestamp:
04/26/12 17:20:50 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

Internationalized the status bar

Location:
src/mlx
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/gui/statusbar.py

    r80 r112  
    66
    77import mlx.const as const
     8from mlx.i18n import xstr
    89
    910import math
     
    3637        self._connStateArea = gtk.DrawingArea()
    3738        self._connStateArea.set_size_request(16, 16)
    38         self._connStateArea.set_tooltip_markup('The state of the connection.\n'
    39                                                '<span foreground="grey">Grey</span> means idle.\n'
    40                                                '<span foreground="red">Red</span> means trying to connect.\n'
    41                                                '<span foreground="green">Green</span> means connected.')
     39        self._connStateArea.set_tooltip_markup(xstr("statusbar_conn_tooltip"))
    4240
    4341        if pygobject:
     
    5452
    5553        self._stageLabel = gtk.Label()
    56         self._stageLabel.set_width_chars(20)
    57         self._stageLabel.set_tooltip_text("The flight stage")
     54        longestStage = xstr("flight_stage_" +
     55                            const.stage2string(const.STAGE_PUSHANDTAXI))
     56        print len(longestStage)
     57        self._stageLabel.set_width_chars(len(longestStage) + 3)
     58        self._stageLabel.set_tooltip_text(xstr("statusbar_stage_tooltip"))
    5859        self._stageLabel.set_alignment(0.0, 0.5)
    5960       
     
    6465        self._timeLabel = gtk.Label("--:--:--")
    6566        self._timeLabel.set_width_chars(8)
    66         self._timeLabel.set_tooltip_text("The simulator time in UTC")
     67        self._timeLabel.set_tooltip_text(xstr("statusbar_time_tooltip"))
    6768        self._timeLabel.set_alignment(1.0, 0.5)
    6869       
     
    7374        self._ratingLabel = gtk.Label()
    7475        self._ratingLabel.set_width_chars(12)
    75         self._ratingLabel.set_tooltip_text("The flight rating")
     76        self._ratingLabel.set_tooltip_text(xstr("statusbar_rating_tooltip"))
    7677        self._ratingLabel.set_alignment(0.0, 0.5)
    7778       
     
    8081        self._busyLabel = gtk.Label()
    8182        self._busyLabel.set_width_chars(30)
    82         self._busyLabel.set_tooltip_text("The status of the background tasks.")
     83        self._busyLabel.set_tooltip_text(xstr("statusbar_busy_tooltip"))
    8384        self._busyLabel.set_alignment(1.0, 0.5)
    8485        statusBox.pack_start(self._busyLabel, True, True, 8)
     
    126127    def _updateFlightStatus(self):
    127128        """Update the flight status information."""
    128         self._stageLabel.set_text("-" if self._stage is None
    129                                   else const.stage2string(self._stage).upper())
     129        if self._stage is None:
     130            text = "-"
     131        else:
     132            text = xstr("flight_stage_" + const.stage2string(self._stage)).upper()
     133        self._stageLabel.set_text(text)
    130134   
    131135        if self._noGoReason is None:
  • src/mlx/i18n.py

    r111 r112  
    424424        self.add("info_delay_weather", "_Weather problems")
    425425        self.add("info_delay_personal", "_Personal reasons")
     426
     427        self.add("statusbar_conn_tooltip",
     428                 'The state of the connection.\n'
     429                 '<span foreground="grey">Grey</span> means idle.\n'
     430                 '<span foreground="red">Red</span> means trying to connect.\n'
     431                 '<span foreground="green">Green</span> means connected.')
     432        self.add("statusbar_stage_tooltip", "The flight stage")
     433        self.add("statusbar_time_tooltip", "The simulator time in UTC")
     434        self.add("statusbar_rating_tooltip", "The flight rating")
     435        self.add("statusbar_busy_tooltip", "The status of the background tasks.")
     436
     437        self.add("flight_stage_boarding", "boarding")
     438        self.add("flight_stage_pushback and taxi", "pushback and taxi")
     439        self.add("flight_stage_takeoff", "takeoff")
     440        self.add("flight_stage_RTO", "RTO")
     441        self.add("flight_stage_climb", "climb")
     442        self.add("flight_stage_cruise", "cruise")
     443        self.add("flight_stage_descent", "descent")
     444        self.add("flight_stage_landing", "landing")
     445        self.add("flight_stage_taxi", "taxi")
     446        self.add("flight_stage_parking", "parking")
     447        self.add("flight_stage_go-around", "go-around")
     448        self.add("flight_stage_end", "end")
    426449                 
    427450#------------------------------------------------------------------------------
     
    741764        self.add("info_delay_personal", "S_zemélyes okok")
    742765                 
     766        self.add("statusbar_conn_tooltip",
     767                 'A kapcsolat állapota.\n'
     768                 '<span foreground="grey">Szürke</span>: nincs kapcsolat.\n'
     769                 '<span foreground="red">Piros</span>: kapcsolódás folyamatban.\n'
     770                 '<span foreground="green">Zöld</span>: a kapcsolat él.')
     771        self.add("statusbar_stage_tooltip", "A repülés fázisa")
     772        self.add("statusbar_time_tooltip", "A szimulátor ideje UTC-ben")
     773        self.add("statusbar_rating_tooltip", "A repülés pontszáma")
     774        self.add("statusbar_busy_tooltip", "A háttérfolyamatok állapota.")
     775
     776        self.add("flight_stage_boarding", u"beszállás")
     777        self.add("flight_stage_pushback and taxi", u"hátratolás és kigurulás")
     778        self.add("flight_stage_takeoff", u"felszállás")
     779        self.add("flight_stage_RTO", u"megszakított felszállás")
     780        self.add("flight_stage_climb", u"emelkedés")
     781        self.add("flight_stage_cruise", u"utazó")
     782        self.add("flight_stage_descent", u"süllyedés")
     783        self.add("flight_stage_landing", u"leszállás")
     784        self.add("flight_stage_taxi", u"begurulás")
     785        self.add("flight_stage_parking", u"parkolás")
     786        self.add("flight_stage_go-around", u"átstartolás")
     787        self.add("flight_stage_end", u"kész")
     788                 
    743789#------------------------------------------------------------------------------
    744790
Note: See TracChangeset for help on using the changeset viewer.