(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/node152.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/node150.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/node154.html| ]]
|
Python Library Reference
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/contents.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/modindex.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/genindex.html| ]]
|
Previous: 6.23.3.2 Localizing your application Up: 6.23.3 Internationalizing your programs Next: 6.23.3.4 Deferred translations
6.23.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()
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/node152.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/node150.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/node154.html| ]]
|
Python Library Reference
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/contents.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/modindex.html| ]]
|
[[yurttas/PL/SL/python/docs/core-python-programming/doc/20/lib/genindex.html| ]]
|
Previous: 6.23.3.2 Localizing your application Up: 6.23.3 Internationalizing your programs Next: 6.23.3.4 Deferred translations
See About this document... for information on suggesting changes.