Section 20.4. Summary

20.4. Summary

  • Unicode allows you to use a single encoding for every language, and Python's support for Unicode makes internationalization a lot easier.

  • Not every Python library is Unicode aware, so if you use third party libraries, you should test them with Unicode strings.

  • You can generally avoid Unicode decode errors by not mixing and matching Unicode and ASCII strings. In other words, just use Unicode all the time and you should be all set.

  • SQLObject handles Unicode only as well as the underlying database/driver so you'll want to be careful which database and drivers you pick for your internationalized application.

  • You can use the gettext and lazy_gettext functions anywhere in your TurboGears project to get a localized string.

  • The i18n.run_template_filter = on setting means that you can automatically populate your translation string files with the contents of your Kid file, and then automatically substitute translated strings into the output. No programming required!

  • You can also use format_number, format_curency, format_date, and other similar functions to localize dates and numbers so that they will be displayed properly in various regional formats.

Rapid Web Applications with TurboGears(c) Using Python to Create Ajax-Powered Sites
Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites
ISBN: 0132433885
EAN: 2147483647
Year: 2006
Pages: 202

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: