GNU Info

Info Node: (python2.1-lib.info)Localizing your application

(python2.1-lib.info)Localizing your application


Next: Changing languages on the fly Prev: Localizing your module Up: Internationalizing your programs and modules
Enter node , (file) or (file)node

Localizing your application
...........................

If you are localizing your application, you can install the `_()'
function globally into the built-in namespace, usually in the main
driver file of your application.  This will let all your
application-specific files just use `_('...')' without having to
explicitly install it in each file.

In the simple case then, you need only add the following bit of code to
the main driver file of your application:

     import gettext
     gettext.install('myapplication')

If you need to set the locale directory or the UNICODE flag, you can
pass these into the `install()' function:

     import gettext
     gettext.install('myapplication', '/usr/share/locale', unicode=1)


automatically generated by info2www version 1.2.2.9