ipython/ipython — pull request #5922 by ozancaglayan (2014-05-29 09:25:22+00:00)
Title: Initial support for internationalization of the notebook UI

This PR aims to enable the localization of notebook UI strings into languages other than English.

We first enable the i18n extension of jinja. This allows to install translations using the ```install_translations``` method of jinja ```Environment``` objects.

The usual way of setting the language is to have it from the user's locale settings but I think that for the context of IPython notebook, it would be better to set it from the UI, e.g. View->Language->[English, French, etc.]. This PR doesn't implement this but gets the language from the command line in the following way:
```$ ipython notebook --NotebookApp.webapp_settings="{'language':'tr_TR'}"```
The omission of this parameter doesn't change the behaviour of the notebook, e.g. it defaults to English.

Jinja template engine already supports internationalization of templates by wrapping translatable strings within ```{% trans %} ... {% endtrans %}```. An initial patch included in this PR wraps every translatable string found in ```IPython/html/templates/*.html``` except for a few in ```logout.html```.

Once the strings are wrapped, we can use the ```babel``` python module to extract the messages into gettext catalogues. This part isn't included in this PR as it can be implemented as a standalone release script or integrated into ```setup.py```. Once the translated po files are compiled into binary mo files, they are placed under ```IPython/html/locale``` folder which ```notebookapp.py``` searches for translation files.

#### Issues:
- This only covers html templates. There are also translatable strings in the .js files.