Skip to content

Commit

Permalink
first cut at merging discussion and comments
Browse files Browse the repository at this point in the history
particularly:
#10 (comment)

work in progress.
  • Loading branch information
srl295 committed Jun 10, 2016
1 parent 33d8288 commit df138f1
Showing 1 changed file with 16 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,28 @@

## Problem

There is currently no standard approach for translating the GUI of Jupyter notebook. This has driven some people to do a [single language translation for Jupyter 4.1](https://twitter.com/Mbussonn/status/685870031247400960).
There is currently no standard approach for translating the GUI of Jupyter notebook.
This has driven some people to do a
[single language translation for Jupyter 4.1](https://twitter.com/Mbussonn/status/685870031247400960).

For information: previous attempts and related issues:

- ipython/ipython#6718
- ipython/ipython#5922
- jupyter/notebook#870
- https://github.com/ipython/ipython/issues/6718
- https://github.com/ipython/ipython/pull/5922
- https://github.com/jupyter/notebook/issues/870

## Proposed Enhancement

Use Tornado [translation capabilities](http://www.tornadoweb.org/en/stable/locale.html) to translate the GUI's templates. This will cover translating the words and sentences in the GUI and localized styles (like Right to left languages).
For Python or Jinja2: use [Jinja2 with Babel](http://jinja.pocoo.org/docs/dev/extensions/#i18n-extension)
to create `.pot` -> Translators translate -> create `.po` -> compile and create `.mo` from `.po` ( probably at install time ).
Python or Jinja2 consumes the .mo directly.

For JavaScript (client side), use Babel ( [pybabel extract](http://babel.pocoo.org/en/latest/cmdline.html?highlight=extract) ) to create
.pot -> Translators translate -> create .po -> Create JSON as text from .po by
[iterating over the catalog](http://babel.pocoo.org/en/latest/api/messages/catalog.html#catalogs)
and then [export to JSON](https://docs.python.org/2/library/json.html).
From there, [jQuery Globalize](https://github.com/jquery/globalize/blob/master/doc/api/message/load-messages.md)
can read and process the message catalog.

## Detail Explanation

Expand Down

0 comments on commit df138f1

Please sign in to comment.