Viewing file: keyboard_models.py (20.18 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
#!/usr/bin/python -tt # # keyboard_models.py - keyboard model list # # Brent Fox <bfox@redhat.com> # Mike Fulbright <msf@redhat.com> # Jeremy Katz <katzj@redhat.com> # # Copyright 2002-2005 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #
from rhpl.translate import _, N_ import rhpl.translate as translate
translate.textdomain('rhpl')
def gkn(str): idx = str.find("|") if idx == -1: return str return str[idx + 1:]
class KeyboardModels:
def get_models(self): return self.modelDict
def __init__(self): # NOTE: to add a keyboard model to this dict, copy the comment # above all of them, and then the key should be the console layout # name. val is [N_('keyboard|Keyboard Name'), xlayout, kbmodel, # variant, options] self._modelDict = { # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ar-azerty' : [N_('keyboard|Arabic (azerty)'), 'us,ar(azerty)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ar-azerty-digits' : [N_('keyboard|Arabic (azerty/digits)'), 'us,ar(azerty_digits)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ar-digits' : [N_('keyboard|Arabic (digits)'), 'us,ar(digits)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ar-qwerty' : [N_('keyboard|Arabic (qwerty)'), 'us,ar(qwerty)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ar-qwerty-digits' : [N_('keyboard|Arabic (qwerty/digits)'), 'us,ar(qwerty_digits)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'be-latin1' : [N_('keyboard|Belgian (be-latin1)'), 'be', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ben' : [N_('keyboard|Bengali (Inscript)'), 'us,ben', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ben-probhat' : [N_('keyboard|Bengali (Probhat)'), 'us,ben(probhat)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'bg' : [N_('keyboard|Bulgarian'), 'us,bg', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'br-abnt2' : [N_('keyboard|Brazilian (ABNT2)'), 'br', 'abnt2', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'cf' : [N_('keyboard|French Canadian'), 'ca_enhanced', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'croat' : [N_('keyboard|Croatian'), 'hr', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'cz-us-qwertz' : [N_('keyboard|Czechoslovakian (qwertz)'), 'us,cz', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'cz-lat2' : [N_('keyboard|Czechoslovakian'), 'cz_qwerty', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'de' : [N_('keyboard|German'), 'de', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'de-latin1' : [N_('keyboard|German (latin1)'), 'de', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'de-latin1-nodeadkeys' : [N_('keyboard|German (latin1 w/ no deadkeys)'), 'de', 'pc105', 'nodeadkeys', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'dev' : [N_('keyboard|Devanagari (Inscript)'), 'us,dev', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'dvorak' : [N_('keyboard|Dvorak'), 'dvorak', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'dk' : [N_('keyboard|Danish'), 'dk', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'dk-latin1' : [N_('keyboard|Danish (latin1)'), 'dk', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'es' : [N_('keyboard|Spanish'), 'es', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'et' : [N_('keyboard|Estonian'), 'ee', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fi' : [N_('keyboard|Finnish'), 'fi', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fi-latin1' : [N_('keyboard|Finnish (latin1)'), 'fi', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fr' : [N_('keyboard|French'), 'fr', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fr-latin9' : [N_('keyboard|French (latin9)'), 'fr-latin9', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fr-latin1' : [N_('keyboard|French (latin1)'), 'fr', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fr-pc' : [N_('keyboard|French (pc)'), 'fr', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fr_CH' : [N_('keyboard|Swiss French'), 'fr_CH', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'fr_CH-latin1' : [N_('keyboard|Swiss French (latin1)'), 'fr_CH', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'gr' : [N_('keyboard|Greek'), 'us,el', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'guj' : [N_('keyboard|Gujarati (Inscript)'), 'us,guj', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'gur' : [N_('keyboard|Punjabi (Inscript)'), 'us,gur', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'hu' : [N_('keyboard|Hungarian'), 'hu', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'hu101' : [N_('keyboard|Hungarian (101 key)'), 'hu_qwerty', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'is-latin1' : [N_('keyboard|Icelandic'), 'is', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'it' : [N_('keyboard|Italian'), 'it', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'it-ibm' : [N_('keyboard|Italian (IBM)'), 'it', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'it2' : [N_('keyboard|Italian (it2)'), 'it', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'jp106' : [N_('keyboard|Japanese'), 'jp', 'jp106', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'us' : [N_('keyboard|Korean'), 'us', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'la-latin1' : [N_('keyboard|Latin American'), 'la', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'mk-utf' : [N_('keyboard|Macedonian'), 'us,mk', 'pc105', '','grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'nl' : [N_('keyboard|Dutch'), 'nl', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'no' : [N_('keyboard|Norwegian'), 'no', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'pl' : [N_('keyboard|Polish'), 'pl', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'pt-latin1' : [N_('keyboard|Portuguese'), 'pt', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ro_win' : [N_('keyboard|Romanian'), 'ro', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru' : [N_('keyboard|Russian'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru-cp1251' : [N_('keyboard|Russian (cp1251)'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru.map.utf8ru' : [N_('keyboard|Russian (utf8ru)'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru-ms' : [N_('keyboard|Russian (Microsoft)'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru1' : [N_('keyboard|Russian (ru1)'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru2' : [N_('keyboard|Russian (ru2)'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ru_win' : [N_('keyboard|Russian (win)'), 'us,ru', 'pc105', '', 'grp:shift_toggle,grp_led:scroll' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'sv-latin1' : [N_('keyboard|Swedish'), 'se', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'sg' : [N_('keyboard|Swiss German'), 'de_CH', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'sg-latin1' : [N_('keyboard|Swiss German (latin1)'), 'de_CH', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'sk-qwerty' : [N_('keyboard|Slovakian'), 'sk_qwerty', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'slovene' : [N_('keyboard|Slovenian'), 'si', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'tml-inscript' : [N_('keyboard|Tamil (Inscript)'), 'us,tml(INSCRIPT)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'tml-uni' : [N_('keyboard|Tamil (Typewriter)'), 'us,tml(UNI)', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'trq' : [N_('keyboard|Turkish'), 'tr', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'uk' : [N_('keyboard|United Kingdom'), 'gb', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'ua-utf' : [N_('keyboard|Ukrainian'), 'us,ua', 'pc105', '', 'grp:shift_toggle,grp_led:scroll'], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'us-acentos' : [N_('keyboard|U.S. International'), 'us_intl', 'pc105', '', '' ], # Translators: the word before the bar is just context and # doesn't need to be translated. Only after will be translated. 'us' : [N_('keyboard|U.S. English'), 'us', 'pc105', '', '' ], }
def _get_models(self): ret = {} for (key, item) in self._modelDict.items(): ret[key] = [gkn(_(item[0])), item[1], item[2], item[3], item[4]] return ret modelDict = property(_get_models) def get_supported_models(): models = KeyboardModels() maps = models.modelDict.keys() maps.sort() for map in maps: print map
if __name__ == "__main__": get_supported_models()
|