Package Gnumed :: Package pycommon :: Module gmI18N
[frames] | no frames]

Source Code for Module Gnumed.pycommon.gmI18N

  1  """GNUmed client internationalization/localization. 
  2   
  3  All i18n/l10n issues should be handled through this modules. 
  4   
  5  Theory of operation: 
  6   
  7  To activate proper locale settings and translation services you need to 
  8   
  9  - import this module 
 10  - call activate_locale() 
 11  - call install_domain() 
 12   
 13  The translating method gettext.gettext() will then be 
 14  installed into the global (!) namespace as _(). Your own 
 15  modules thus need not do _anything_ (not even import gmI18N) 
 16  to have _() available to them for translating strings. You 
 17  need to make sure, however, that gmI18N is imported in your 
 18  main module before any of the modules using it. In order to 
 19  resolve circular references involving modules that 
 20  absolutely _have_ to be imported before this module you can 
 21  explicitly import gmI18N into them at the very beginning. 
 22   
 23  The text domain (i.e. the name of the message catalog file) 
 24  is derived from the name of the main executing script unless 
 25  explicitly passed to install_domain(). The language you 
 26  want to translate to is derived from environment variables 
 27  by the locale system unless explicitly passed to 
 28  install_domain(). 
 29   
 30  This module searches for message catalog files in 3 main locations: 
 31   
 32   - standard POSIX places (/usr/share/locale/ ...) 
 33   - below "${YOURAPPNAME_DIR}/locale/" 
 34   - below "<directory of binary of your app>/../locale/" 
 35   
 36  For DOS/Windows I don't know of standard places so probably 
 37  only the last option will work. I don't know a thing about 
 38  classic Mac behaviour. New Macs are POSIX, of course. 
 39   
 40  It will then try to install candidates and *verify* whether 
 41  the translation works by checking for the translation of a 
 42  tag within itself (this is similar to the self-compiling 
 43  compiler inserting a backdoor into its self-compiled 
 44  copies). 
 45   
 46  If none of this works it will fall back to making _() a noop. 
 47   
 48  @copyright: authors 
 49  """ 
 50  #=========================================================================== 
 51  # $Id: gmI18N.py,v 1.48 2009/12/21 15:02:17 ncq Exp $ 
 52  # $Source: /cvsroot/gnumed/gnumed/gnumed/client/pycommon/gmI18N.py,v $ 
 53  __version__ = "$Revision: 1.48 $" 
 54  __author__ = "H. Herb <hherb@gnumed.net>, I. Haywood <i.haywood@ugrad.unimelb.edu.au>, K. Hilbert <Karsten.Hilbert@gmx.net>" 
 55  __license__ = "GPL (details at http://www.gnu.org)" 
 56   
 57   
 58  # stdlib 
 59  import sys, os.path, os, re as regex, locale, gettext, logging, codecs 
 60   
 61   
 62  _log = logging.getLogger('gm.i18n') 
 63  _log.info(__version__) 
 64   
 65  system_locale = '' 
 66  system_locale_level = {} 
 67   
 68   
 69  _translate_original = lambda x:x 
 70   
 71  # ********************************************************** 
 72  # == do not remove this line =============================== 
 73  # it is needed to check for successful installation of 
 74  # the desired message catalog 
 75  # ********************************************************** 
 76  __orig_tag__ = u'Translate this or i18n will not work properly !' 
 77  # ********************************************************** 
 78  # ********************************************************** 
 79   
 80  # Q: I can't use non-ascii characters in labels and menus. 
 81  # A: This can happen if your Python's sytem encoding is ascii and 
 82  #    wxPython is non-unicode. Edit/create the file sitecustomize.py 
 83  #    (should be somewhere in your PYTHONPATH), and put these magic lines: 
 84  # 
 85  #       import sys 
 86  #       sys.setdefaultencoding('iso8859-1') # replace with encoding you want to be the default one 
 87   
 88  #=========================================================================== 
89 -def __split_locale_into_levels():
90 """Split locale into language, country and variant parts. 91 92 - we have observed the following formats in the wild: 93 - de_DE@euro 94 - ec_CA.UTF-8 95 - en_US:en 96 - German_Germany.1252 97 """ 98 _log.debug('splitting canonical locale [%s] into levels', system_locale) 99 100 global system_locale_level 101 system_locale_level['full'] = system_locale 102 # trim '@<variant>' part 103 system_locale_level['country'] = regex.split('@|:|\.', system_locale, 1)[0] 104 # trim '_<COUNTRY>@<variant>' part 105 system_locale_level['language'] = system_locale.split('_', 1)[0] 106 107 _log.debug('system locale levels: %s', system_locale_level)
108 #---------------------------------------------------------------------------
109 -def __log_locale_settings(message=None):
110 _setlocale_categories = {} 111 for category in 'LC_ALL LC_CTYPE LC_COLLATE LC_TIME LC_MONETARY LC_MESSAGES LC_NUMERIC'.split(): 112 try: 113 _setlocale_categories[category] = getattr(locale, category) 114 except: 115 _log.warning('this OS does not have locale.%s', category) 116 117 _getlocale_categories = {} 118 for category in 'LC_CTYPE LC_COLLATE LC_TIME LC_MONETARY LC_MESSAGES LC_NUMERIC'.split(): 119 try: 120 _getlocale_categories[category] = getattr(locale, category) 121 except: 122 pass 123 124 if message is not None: 125 _log.debug(message) 126 127 _log.debug('current locale settings:') 128 _log.debug('locale.get_locale(): %s' % str(locale.getlocale())) 129 for category in _getlocale_categories.keys(): 130 _log.debug('locale.get_locale(%s): %s' % (category, locale.getlocale(_getlocale_categories[category]))) 131 132 for category in _setlocale_categories.keys(): 133 _log.debug('(locale.set_locale(%s): %s)' % (category, locale.setlocale(_setlocale_categories[category]))) 134 135 try: 136 _log.debug('locale.getdefaultlocale() - default (user) locale: %s' % str(locale.getdefaultlocale())) 137 except ValueError: 138 _log.exception('the OS locale setup seems faulty') 139 140 _log.debug('encoding sanity check (also check "locale.nl_langinfo(CODESET)" below):') 141 pref_loc_enc = locale.getpreferredencoding(do_setlocale=False) 142 loc_enc = locale.getlocale()[1] 143 py_str_enc = sys.getdefaultencoding() 144 sys_fs_enc = sys.getfilesystemencoding() 145 _log.debug('sys.getdefaultencoding(): [%s]' % py_str_enc) 146 _log.debug('locale.getpreferredencoding(): [%s]' % pref_loc_enc) 147 _log.debug('locale.getlocale()[1]: [%s]' % loc_enc) 148 _log.debug('sys.getfilesystemencoding(): [%s]' % sys_fs_enc) 149 if loc_enc is not None: 150 loc_enc = loc_enc.upper() 151 loc_enc_compare = loc_enc.replace(u'-', u'') 152 else: 153 loc_enc_compare = loc_enc 154 if pref_loc_enc.upper().replace(u'-', u'') != loc_enc_compare: 155 _log.warning('encoding suggested by locale (%s) does not match encoding currently set in locale (%s)' % (pref_loc_enc, loc_enc)) 156 _log.warning('this might lead to encoding errors') 157 for enc in [pref_loc_enc, loc_enc, py_str_enc, sys_fs_enc]: 158 if enc is not None: 159 try: 160 codecs.lookup(enc) 161 _log.debug('<codecs> module CAN handle encoding [%s]' % enc) 162 except LookupError: 163 _log.warning('<codecs> module can NOT handle encoding [%s]' % enc) 164 _log.debug('on Linux you can determine a likely candidate for the encoding by running "locale charmap"') 165 166 _log.debug('locale related environment variables (${LANG} is typically used):') 167 for var in 'LANGUAGE LC_ALL LC_CTYPE LANG'.split(): 168 try: 169 _log.debug('${%s}=%s' % (var, os.environ[var])) 170 except KeyError: 171 _log.debug('${%s} not set' % (var)) 172 173 _log.debug('database of locale conventions:') 174 data = locale.localeconv() 175 for key in data.keys(): 176 if loc_enc is None: 177 _log.debug(u'locale.localeconv(%s): %s', key, data[key]) 178 else: 179 try: 180 _log.debug(u'locale.localeconv(%s): %s', key, unicode(data[key])) 181 except UnicodeDecodeError: 182 _log.debug(u'locale.localeconv(%s): %s', key, unicode(data[key], loc_enc)) 183 _nl_langinfo_categories = {} 184 for category in 'CODESET D_T_FMT D_FMT T_FMT T_FMT_AMPM RADIXCHAR THOUSEP YESEXPR NOEXPR CRNCYSTR ERA ERA_D_T_FMT ERA_D_FMT ALT_DIGITS'.split(): 185 try: 186 _nl_langinfo_categories[category] = getattr(locale, category) 187 except: 188 _log.warning('this OS does not support nl_langinfo category locale.%s' % category) 189 try: 190 for category in _nl_langinfo_categories.keys(): 191 if loc_enc is None: 192 _log.debug('locale.nl_langinfo(%s): %s' % (category, locale.nl_langinfo(_nl_langinfo_categories[category]))) 193 else: 194 try: 195 _log.debug(u'locale.nl_langinfo(%s): %s', category, unicode(locale.nl_langinfo(_nl_langinfo_categories[category]))) 196 except UnicodeDecodeError: 197 _log.debug(u'locale.nl_langinfo(%s): %s', category, unicode(locale.nl_langinfo(_nl_langinfo_categories[category]), loc_enc)) 198 except: 199 _log.exception('this OS does not support nl_langinfo')
200 #---------------------------------------------------------------------------
201 -def _translate_protected(term):
202 """This wraps _(). 203 204 It protects against translation errors such as different number of %s. 205 """ 206 translation = _translate_original(term) 207 208 if translation.count(u'%s') == term.count(u'%s'): 209 return translation 210 211 _log.error('mismatch in translation of [%s]' % term) 212 return term
213 #--------------------------------------------------------------------------- 214 # external API 215 #---------------------------------------------------------------------------
216 -def activate_locale():
217 """Get system locale from environment.""" 218 global system_locale 219 220 # logging state of affairs 221 __log_locale_settings('unmodified startup locale settings (should be [C])') 222 223 # activate user-preferred locale 224 loc, enc = None, None 225 try: 226 # check whether already set 227 loc, loc_enc = locale.getlocale() 228 if loc is None: 229 loc = locale.setlocale(locale.LC_ALL, '') 230 _log.debug("activating user-default locale with <locale.setlocale(locale.LC_ALL, '')> returns: [%s]" % loc) 231 else: 232 _log.info('user-default locale already activated') 233 loc, loc_enc = locale.getlocale() 234 except AttributeError: 235 _log.exception('Windows does not support locale.LC_ALL') 236 except: 237 _log.exception('error activating user-default locale') 238 239 # logging state of affairs 240 __log_locale_settings('locale settings after activating user-default locale') 241 242 # did we find any locale setting ? assume en_EN if not 243 if loc in [None, 'C']: 244 _log.error('the current system locale is still [None] or [C], assuming [en_EN]') 245 system_locale = "en_EN" 246 else: 247 system_locale = loc 248 249 # generate system locale levels 250 __split_locale_into_levels() 251 252 return True
253 #---------------------------------------------------------------------------
254 -def install_domain(domain=None, language=None, prefer_local_catalog=False):
255 """Install a text domain suitable for the main script.""" 256 257 # text domain directly specified ? 258 if domain is None: 259 # get text domain from name of script 260 domain = os.path.splitext(os.path.basename(sys.argv[0]))[0] 261 _log.info('text domain is [%s]' % domain) 262 263 # http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html 264 _log.debug('searching message catalog file for system locale [%s]' % system_locale) 265 for env_var in ['LANGUAGE', 'LC_ALL', 'LC_MESSAGES', 'LANG']: 266 tmp = os.getenv(env_var) 267 if env_var is None: 268 _log.debug('${%s} not set' % env_var) 269 else: 270 _log.debug('${%s} = [%s]' % (env_var, tmp)) 271 272 if language is not None: 273 _log.info('explicit setting of ${LANG} requested: [%s]' % language) 274 _log.info('this will override the system locale language setting') 275 os.environ['LANG'] = language 276 277 # search for message catalog 278 candidates = [] 279 # - locally 280 if prefer_local_catalog: 281 _log.debug('preferring local message catalog') 282 # - one level above path to binary 283 # last resort for inferior operating systems such as DOS/Windows 284 # strip one directory level 285 # this is a rather neat trick :-) 286 loc_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', 'locale')) 287 _log.debug('looking above binary install directory [%s]' % loc_dir) 288 candidates.append(loc_dir) 289 # - in path to binary 290 loc_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'locale' )) 291 _log.debug('looking in binary install directory [%s]' % loc_dir) 292 candidates.append(loc_dir) 293 # - standard places 294 if os.name == 'posix': 295 _log.debug('system is POSIX, looking in standard locations (see Python Manual)') 296 # if this is reported to segfault/fail/except on some 297 # systems we may have to assume "sys.prefix/share/locale/" 298 candidates.append(gettext.bindtextdomain(domain)) 299 else: 300 _log.debug('No use looking in standard POSIX locations - not a POSIX system.') 301 # - $(<script-name>_DIR)/ 302 env_key = "%s_DIR" % os.path.splitext(os.path.basename(sys.argv[0]))[0].upper() 303 _log.debug('looking at ${%s}' % env_key) 304 if os.environ.has_key(env_key): 305 loc_dir = os.path.abspath(os.path.join(os.environ[env_key], 'locale')) 306 _log.debug('${%s} = "%s" -> [%s]' % (env_key, os.environ[env_key], loc_dir)) 307 candidates.append(loc_dir) 308 else: 309 _log.info("${%s} not set" % env_key) 310 # - locally 311 if not prefer_local_catalog: 312 # - one level above path to binary 313 # last resort for inferior operating systems such as DOS/Windows 314 # strip one directory level 315 # this is a rather neat trick :-) 316 loc_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), '..', 'locale')) 317 _log.debug('looking above binary install directory [%s]' % loc_dir) 318 candidates.append(loc_dir) 319 # - in path to binary 320 loc_dir = os.path.abspath(os.path.join(os.path.dirname(sys.argv[0]), 'locale' )) 321 _log.debug('looking in binary install directory [%s]' % loc_dir) 322 candidates.append(loc_dir) 323 324 # now try to actually install it 325 for candidate in candidates: 326 _log.debug('trying [%s](/%s/LC_MESSAGES/%s.mo)' % (candidate, system_locale, domain)) 327 if not os.path.exists(candidate): 328 continue 329 try: 330 gettext.install(domain, candidate, unicode=1) 331 except: 332 _log.exception('installing text domain [%s] failed from [%s]' % (domain, candidate)) 333 continue 334 global _ 335 # does it translate ? 336 if _(__orig_tag__) == __orig_tag__: 337 _log.debug('does not translate: [%s] => [%s]', __orig_tag__, _(__orig_tag__)) 338 continue 339 else: 340 _log.debug('found msg catalog: [%s] => [%s]', __orig_tag__, _(__orig_tag__)) 341 import __builtin__ 342 global _translate_original 343 _translate_original = __builtin__._ 344 __builtin__._ = _translate_protected 345 return True 346 347 # 5) install a dummy translation class 348 _log.warning("falling back to NullTranslations() class") 349 # this shouldn't fail 350 dummy = gettext.NullTranslations() 351 dummy.install() 352 return True
353 #=========================================================================== 354 _encoding_mismatch_already_logged = False 355
356 -def get_encoding():
357 """Try to get a sane encoding. 358 359 On MaxOSX locale.setlocale(locale.LC_ALL, '') does not 360 have the desired effect, so that locale.getlocale()[1] 361 still returns None. So in that case try to fallback to 362 locale.getpreferredencoding(). 363 364 <sys.getdefaultencoding()> 365 - what Python itself uses to convert string <-> unicode 366 when no other encoding was specified 367 - ascii by default 368 - can be set in site.py and sitecustomize.py 369 <locale.getpreferredencoding()> 370 - what the current locale would *recommend* using 371 as the encoding for text conversion 372 <locale.getlocale()[1]> 373 - what the current locale is *actually* using 374 as the encoding for text conversion 375 """ 376 enc = sys.getdefaultencoding() 377 if enc != 'ascii': 378 return enc 379 enc = locale.getlocale()[1] 380 if enc is not None: 381 return enc 382 global _encoding_mismatch_already_logged 383 if not _encoding_mismatch_already_logged: 384 _log.debug('*actual* encoding of locale is None, using encoding *recommended* by locale') 385 _encoding_mismatch_already_logged = True 386 return locale.getpreferredencoding(do_setlocale=False)
387 #=========================================================================== 388 # Main 389 #--------------------------------------------------------------------------- 390 if __name__ == "__main__": 391 392 if len(sys.argv) > 1 and sys.argv[1] == u'test': 393 394 logging.basicConfig(level = logging.DEBUG) 395 396 print "======================================================================" 397 print "GNUmed i18n" 398 print "" 399 print "authors:", __author__ 400 print "license:", __license__, "; version:", __version__ 401 print "======================================================================" 402 activate_locale() 403 print "system locale: ", system_locale, "; levels:", system_locale_level 404 print "likely encoding:", get_encoding() 405 install_domain() 406 # ******************************************************** 407 # == do not remove this line ============================= 408 # it is needed to check for successful installation of 409 # the desired message catalog 410 # ******************************************************** 411 tmp = _('Translate this or i18n will not work properly !') 412 # ******************************************************** 413 # ******************************************************** 414 415 #===================================================================== 416 # $Log: gmI18N.py,v $ 417 # Revision 1.48 2009/12/21 15:02:17 ncq 418 # - fix typo 419 # 420 # Revision 1.47 2009/07/09 16:42:49 ncq 421 # - honor prefer_local_catalog 422 # 423 # Revision 1.46 2009/04/13 10:34:17 ncq 424 # - start preferring local catalogs when needed 425 # 426 # Revision 1.45 2009/03/10 14:19:08 ncq 427 # - protect against translation errors 428 # 429 # Revision 1.44 2008/08/01 10:46:14 ncq 430 # - add URL 431 # 432 # Revision 1.43 2008/06/11 19:11:26 ncq 433 # - slight cleanup 434 # - ignore - in encoding for comparison 435 # 436 # Revision 1.42 2008/06/09 15:28:00 ncq 437 # - better logging 438 # 439 # Revision 1.41 2008/05/13 14:08:44 ncq 440 # - get_encoding: log encoding mismatch only once 441 # 442 # Revision 1.40 2008/01/14 20:26:35 ncq 443 # - cleanup 444 # 445 # Revision 1.39 2008/01/13 01:14:48 ncq 446 # - remove *really* excessive logging 447 # 448 # Revision 1.38 2007/12/23 11:57:59 ncq 449 # - better docs 450 # - better get_encoding() 451 # 452 # Revision 1.37 2007/12/20 13:09:13 ncq 453 # - improved docs and variable naming 454 # 455 # Revision 1.36 2007/12/12 16:18:31 ncq 456 # - cleanup 457 # - need to be careful about logging locale settings since 458 # they come in the active locale ... 459 # 460 # Revision 1.35 2007/12/11 15:36:18 ncq 461 # - no more gmLog2.py importing 462 # 463 # Revision 1.34 2007/12/11 14:27:02 ncq 464 # - use std logging 465 # 466 # Revision 1.33 2007/07/10 20:34:37 ncq 467 # - in install_domain(): rename text_domain arg to domain 468 # 469 # Revision 1.32 2007/04/01 15:20:52 ncq 470 # - add get_encoding() 471 # - fix test suite 472 # 473 # Revision 1.31 2006/09/01 14:41:22 ncq 474 # - always use UNICODE gettext 475 # 476 # Revision 1.30 2006/07/10 21:44:23 ncq 477 # - slightly better logging 478 # 479 # Revision 1.29 2006/07/04 14:11:29 ncq 480 # - downgrade some errors to warnings and show them once, only 481 # 482 # Revision 1.28 2006/07/01 13:12:14 ncq 483 # - better logging 484 # 485 # Revision 1.27 2006/07/01 11:23:50 ncq 486 # - one more hint added 487 # 488 # Revision 1.26 2006/07/01 09:42:30 ncq 489 # - ever better logging and handling of encoding 490 # 491 # Revision 1.25 2006/06/30 14:15:39 ncq 492 # - remove dependancy on gmCLI 493 # - set unicode_flag, text_domain and language explicitely in install_domain() 494 # 495 # Revision 1.24 2006/06/26 21:35:57 ncq 496 # - improved logging 497 # 498 # Revision 1.23 2006/06/20 09:37:33 ncq 499 # - variable naming error 500 # 501 # Revision 1.22 2006/06/19 07:12:05 ncq 502 # - getlocale() does not support LC_ALL 503 # 504 # Revision 1.21 2006/06/19 07:06:13 ncq 505 # - arch linux cannot locale.get_locale(locale.LC_ALL) :-( 506 # 507 # Revision 1.20 2006/06/17 12:36:40 ncq 508 # - remove testing cruft 509 # 510 # Revision 1.19 2006/06/17 12:25:22 ncq 511 # - for some extremly strange reason "AttributeError" is not accepted as 512 # an exception name in "except AttributeError:" 513 # 514 # Revision 1.18 2006/06/17 11:49:26 ncq 515 # - make locale.LC_* robust against platform diffs 516 # 517 # Revision 1.17 2006/06/15 07:55:35 ncq 518 # - ever better logging of affairs 519 # 520 # Revision 1.16 2006/06/14 15:53:17 ncq 521 # - attempt setting Python string encoding if appears to not be set 522 # 523 # Revision 1.15 2006/06/13 20:34:40 ncq 524 # - now has *explicit* activate_locale() and install_domain() 525 # - much improved logging 526 # 527 # Revision 1.14 2006/06/12 21:41:46 ncq 528 # - improved locale setting logging 529 # 530 # Revision 1.13 2005/10/30 15:50:01 ncq 531 # - only try to activate user preferred locale if it does not appear 532 # to be activated yet, also catch one more exception to make failing 533 # locale stuff non-fatal 534 # 535 # Revision 1.12 2005/08/18 18:41:48 ncq 536 # - Windows does not know proper i18n 537 # 538 # Revision 1.11 2005/08/18 18:30:57 ncq 539 # - allow explicit setting of $LANG by --lang-gettext 540 # 541 # Revision 1.10 2005/08/18 18:10:52 ncq 542 # - explicitely dump l10n related env vars as Windows 543 # is dumb and needs to be debugged 544 # 545 # Revision 1.9 2005/08/06 16:26:50 ncq 546 # - read locale for messages from LC_MESSAGES, not LC_ALL 547 # 548 # Revision 1.8 2005/07/18 09:12:12 ncq 549 # - make __install_domain more robust 550 # 551 # Revision 1.7 2005/04/24 15:48:47 ncq 552 # - change unicode_flag default to 0 553 # - add comment on proper fix involving sitecustomize.py 554 # 555 # Revision 1.6 2005/03/30 22:08:57 ncq 556 # - properly handle 0/1 in --unicode-gettext 557 # 558 # Revision 1.5 2005/03/29 07:25:39 ncq 559 # - improve docs 560 # - add unicode CLI switch to toggle unicode gettext use 561 # - use std lib locale modules to get system locale 562 # 563 # Revision 1.4 2004/06/26 23:06:00 ncq 564 # - cleanup 565 # - I checked it, no matter where we import (function-/class-/method- 566 # local or globally) it will always only be done once so we can 567 # get rid of the semaphore 568 # 569 # Revision 1.3 2004/06/25 12:29:13 ncq 570 # - cleanup 571 # 572 # Revision 1.2 2004/06/25 07:11:15 ncq 573 # - make gmI18N self-aware (eg. remember installing _()) 574 # so we should be able to safely import gmI18N anywhere 575 # 576 # Revision 1.1 2004/02/25 09:30:13 ncq 577 # - moved here from python-common 578 # 579 # Revision 1.29 2003/11/17 10:56:36 sjtan 580 # 581 # synced and commiting. 582 # 583 # Revision 1.1 2003/10/23 06:02:39 sjtan 584 # 585 # manual edit areas modelled after r.terry's specs. 586 # 587 # Revision 1.28 2003/06/26 21:34:03 ncq 588 # - fatal->verbose 589 # 590 # Revision 1.27 2003/04/25 08:48:47 ncq 591 # - refactored, now also take into account different delimiters (see __split_locale*) 592 # 593 # Revision 1.26 2003/04/18 09:00:02 ncq 594 # - assume en_EN for locale if none found 595 # 596 # Revision 1.25 2003/03/24 16:52:27 ncq 597 # - calculate system locale levels at startup 598 # 599 # Revision 1.24 2003/02/05 21:27:05 ncq 600 # - more aptly names a variable 601 # 602 # Revision 1.23 2003/02/01 02:42:46 ncq 603 # - log -> _log to prevent namespace pollution on import 604 # 605 # Revision 1.22 2003/02/01 02:39:53 ncq 606 # - get and remember user's locale 607 # 608 # Revision 1.21 2002/12/09 23:39:50 ncq 609 # - only try standard message catalog locations on true POSIX systems 610 # as windows will choke on it 611 # 612 # Revision 1.20 2002/11/18 09:41:25 ncq 613 # - removed magic #! interpreter incantation line to make Debian happy 614 # 615 # Revision 1.19 2002/11/17 20:09:10 ncq 616 # - always display __doc__ when called standalone 617 # 618 # Revision 1.18 2002/09/26 13:16:52 ncq 619 # - log version 620 # 621 # Revision 1.17 2002/09/23 02:23:16 ncq 622 # - comment on why it fails on some version of Windows 623 # 624 # Revision 1.16 2002/09/22 18:38:58 ncq 625 # - added big comment on gmTimeFormat 626 # 627 # Revision 1.15 2002/09/10 07:52:29 ncq 628 # - increased log level of gmTimeFormat 629 # 630 # Revision 1.14 2002/09/08 15:57:42 ncq 631 # - added log cvs keyword 632 # 633