Website hosting service by Active-Venture.com
  

 Back to Index

6.27.3.3 Changing languages on the fly

If your program needs to support many languages at the same time, you may want to create multiple translation instances and then switch between them explicitly, like so:

 

import gettext

lang1 = gettext.translation(languages=['en'])
lang2 = gettext.translation(languages=['fr'])
lang3 = gettext.translation(languages=['de'])

# start by using language1
lang1.install()

# ... time goes by, user selects language 2
lang2.install()

# ... more time goes by, user selects language 3
lang3.install()
 

  

 

© 2002-2004 Active-Venture.com Webhosting Service

 

Disclaimer: This documentation is provided only for the benefits of our hosting customers.
For authoritative source of the documentation, please refer to http://python.org/doc/

 

Domain registration : Buy domain name or register domain name from $5.95/year only

 

Cheap domain registration : Register domain name or buy domain name, including free domain hosting services

 
  Active-Domain.com offers cheap domain registration, domain name transfer and domain search services