Contribute Media
A thank you to everyone who makes this possible: Read More

A Gringo's Guide to Internationalization

Summary

Coming from a speaker who escaped a notion to "why would we need to translate?" this talk aims to show what actually goes into translating a website or app using Django's Internationalization tools. Covered will be an overview of batteries included, best practices and anti-patterns in using them, and some third party tools to help make your life escaping the myth of a Lingua Franca easier.

Description

There's often a bubble in the English-speaking programming world that the entire internet runs on English. Our Top-level domains are shortened english words. Our programming languages--Python in particular--try to emulate English words and grammar.

Firmly in place in this world for many years, my first attempt to translate a pre-existing site came with a high sticker shock of nuanced difficulty. This talk covers all the lessons I learned in taking a fully-fleshed web app with no translation (and a programmer with no translation experience) to being completely translated.

Talk Overview

  1. Introduction to Translation
    1. Overview of gettext
    2. Brief history of a translation
    3. Add gettext calls
    4. django-admin.py makemessages
    5. Ship po file to translation service
    6. Receive file back
    7. Compile
    8. Fin
    9. gettext vs gettext_lazy
  2. Batteries Included
    1. gettext Python calls
    2. Middleware
    3. template tags
    4. trans vs. blocktrans
    5. Anti-patterns of the battery included use.
    6. Heavy whitespace in blocktrans
    7. Monster-sized translations
  3. The best laid plans of mice and men...
    1. Problems that get in the way of A history of a translation.
    2. Realize half the site is still untranslated
    3. Edit out the translations you already had translated to avoid re-curring costs
    4. Have the product adjust so two words change
    5. Realize common text that's in the database
    6. Fin?
    7. Patterns and tools to help
    8. poxx.py and the idea of a 'canonical' po file.
    9. dbgettext
    10. Wholly-translated template files (translate_include, trans_render)
  4. Advanced Translation Technique
    1. While undocumented, translation backend is pretty darn flexible and the source code is a treasure trove to make 'impossible' use cases not too bad.
    2. Overview of how the translation service works behind the scenes
    3. _translation thread local
    4. Merged translations (root->app->default)
    5. Sessions vs. Accept-Language
    6. Middleware and Context processors
    7. Example of advanced translation code: Multi-tenancy translation.
    8. Translating some sites, not translating others
    9. Translating Site A one way, Site B another
    10. Using an English translation for duct-tape and profit.
  5. Why Django's i18n sucks.
    1. In the vein of the "Django Sucks" Key note. It doesn't really, but it could use some changes--from minor to major.
    2. Why .po Files are archaic and limited.
    3. What we can do to improve for 1.5 and beyond.

Details

Improve this page