Ignore:
Timestamp:
06/05/12 18:20:01 (12 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added a Help menu with the manual and the about dialog

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/i18n.py

    r222 r227  
    1818    _Strings.set(language)
    1919   
     20#------------------------------------------------------------------------------
     21
     22def getLanguage():
     23    """Get the two-letter language code."""
     24    language = _Strings.current().getLanguage()
     25    underscoreIndex = language.find("_")
     26    return language[:underscoreIndex] if underscoreIndex>0 else language
     27
    2028#------------------------------------------------------------------------------
    2129
     
    5260        on, until no underscore remains.
    5361
    54         If nothing is found this way, the
    55         """
     62        If nothing is found this way, the fallback will be returned."""
    5663        while language:
    5764            if language in _Strings._instances:
     
    8996        """Construct an empty strings object."""
    9097        self._strings = {}
     98        self._language = languages[0]
    9199        for language in languages:
    92100            _Strings._instances[language] = self
     
    106114        This releases the string dictionary to free space."""
    107115        self._strings = {}
     116
     117    def getLanguage(self):
     118        """Get the language."""
     119        return self._language
    108120
    109121    def add(self, id, s):
     
    178190        self.add("menu_view_debug_key", "d")
    179191       
     192        self.add("menu_help", "Help")
     193        self.add("menu_help_manual", "_User's manual")
     194        self.add("menu_help_manual_key", "u")
     195        self.add("menu_help_about", "_About")
     196        self.add("menu_help_about_key", "a")
     197
    180198        self.add("tab_flight", "_Flight")
    181199        self.add("tab_flight_tooltip", "Flight wizard")
     
    936954        self.add("pirepView_tab_log_tooltip", "The flight log.")
    937955
     956        self.add("about_license",
     957                 "This program is in the public domain.")
     958
     959        self.add("about_role_prog_test", "programming, testing")
     960        self.add("about_role_negotiation", "negotiation")
     961        self.add("about_role_test", "testing")
     962
    938963#------------------------------------------------------------------------------
    939964
     
    9921017        self.add("menu_view_debug_key", "d")
    9931018       
     1019        self.add("menu_help", "Segítség")
     1020        self.add("menu_help_manual", "_Felhasználói kézikönyv")
     1021        self.add("menu_help_manual_key", "f")
     1022        self.add("menu_help_about", "_Névjegy")
     1023        self.add("menu_help_about_key", "n")
     1024
    9941025        self.add("tab_flight", "_Járat")
    9951026        self.add("tab_flight_tooltip", "Járat varázsló")
     
    17661797        self.add("pirepView_tab_log_tooltip", "A repülési napló.")
    17671798
     1799        self.add("about_license",
     1800                 "A program köztulajdonban van.")
     1801
     1802        self.add("about_role_prog_test", "programozás, tesztelés")
     1803        self.add("about_role_negotiation", "tárgyalások")
     1804        self.add("about_role_test", "tesztelés")
     1805
    17681806#------------------------------------------------------------------------------
    17691807
Note: See TracChangeset for help on using the changeset viewer.