We’ve added internationalization (i18n) hooks to mdxs.net using parsing of Accept-Language, cookies, and optional arguments for browsing. Together this will make it possible to help serve different audiences in their own language (initially Dutch and English).
Implementation
For the implementation, using Python in Google App Engine (GAE), we added Babel and PyTZ to the project. To help translation, we started coding text strings such that they can be automatically extracted from templates and code (using pybabel). Then we used some recipes and hints from Stackoverflow (and other sources) to allow switching locale and selecting the appropriate translation in GAE. With this part done, switching between locales can be achieved using arguments like "?locale=nl_NL" on the URL.To guess the best fit for visitors, we added parsing of the HTTP Accept-Language header (provided by browsers in their request); followed by a crisp cookie to allow users to set their preference.