[IPython-dev] Internationalisation and creating domain specific Help items

António Seabra antseabra at gmail.com
Fri Dec 27 09:30:52 EST 2013


Hi Matthias,

Thank you very much for your reply. Agree with you that, instead of
incompletley internationalising the UI, a short manual explaining the key
element of the UI will be a better solution.

Followed your suggestion concerning patching  IPython/html/templates/*.html
and it worked like a charm! Changed some Help items concerning Python
packages to the Julia equivalents and added a few domain specific items.

Couln't find something similar to NotebookApp.webapp_settings =
{'template_path':<your path>} in notebookapp.py, but perhaps this was the
line of code (obviously replacing <your path>) I should add? It would be
nice if IPython could search at startup for alternative templates. In my
opinion being able to easily create domain specific IPython notebook UIs
(even if only changing the menu structure),  would be a great feature.

Many thanks again for your help
Antonio.





On Thu, Dec 26, 2013 at 5:40 PM, Matthias BUSSONNIER <
bussonniermatthias at gmail.com> wrote:

> Hi Antonio,
>
> I suppose you come here after the following question on stack overflow
> [1], which
> redirected you here. as you've pointed out, there is currently no good
> mechanism to
> translate IPython. One of the things that might change the final answer
> for you is wether
> student will run IPython themselves on their machines, or wether it will
> be a installation
> that will be provided on a cluster they can connect to.  If you are in the
> case of the second
> option, then I suppose you could have a custom patched version of IPython
> installed with the
> key-part translated. The part you are interested in will mostly be in
> IPython/html/templates/*.html
> that is to say the menu, part of the dashboard, and changing the items in
> the help menu.
> Editting those file and reinstalling should give you a mostly translated
> UI.
>
> I have to check wether or not the path where IPython search for templates
> is configurable,
> if so new template could allow some internationalization to be done
> without modifying IPython
> source and just specifying where theses new templates are.
>
> (from a quick look probably c.NotebookApp.webapp_settings =
> {'template_path':<your path>} but not sure. cf notebookapp.py)
>
>
> Personally, as a non native english speaker, I think more and more that no
> translation at all,
> is better that a partially translated software, even in a context of
> classes. Having to deal with software
> that sadly are partially translated into french make finding information
> on the internet quite hard as almost
> every piece of help you will find will have the menu-name in english then
> you need to find what the translation
> might be, and for the few things you find in your language, you will see
> that the translation have changed
> between 2 versions of the software. So before absolutely translating for
> your undergrads, try to consider the
> above fact and wether or not having a manual that explain the key element
> of the UI could be more beneficial.
>
> If we are interested in a longer term i18n,
>
> - Jinja support extension for internationalization [2], that will allow to
> translate most of the part of the templates.
> - I don't know of any solution to i18n with javascript.
> - Some other things are hard-code in python itself. (doctoring and so on)
> - You have the extra  constraint that most of the library you will use are
> in english (and in julia in your case)
>
> The question is how much effort we should put into translating IPython,
> and also that most languages
> are more verbose than english so some menu "won't fit" in screen anymore.
>
> We have to take into account that for correct translation, of a full
> application, we need to put extra constraint
> on the developers to think the application for translation. This mean
> wrapping each strings that could be translated
> into _()  most of the time avoid string concatenation... etc. This is a
> process that for IPython itself would take quite
> some time if we don't get external help. I think we would be ok to go into
> such a direction if we have
> insurance that we will actually have people that will use that to provide
> IPython translation. Seeing how difficult it
> can be for popular project and even OS, I'm doubtful we can have a correct
> internationalization of IPython.
> Also, if there is a translation effort, it should also target IPython
> documentation, which already need some love in english.
>
> If I was in your position I would :
>
>  - Search/Ask who is interested would participate in such a translation
> project.
>  - Consider that only  5% of people who said will be interested in
> participating will participate
>  - depending on the result decide what is worth to do.
>
> In any case A document that describe in your language IPython and the
> significance of each term
> will be the easiest to update and take the less time. It will be useful
> even in a translated software to
> search for english documentation on the internet.
>
> If having a way to plug external translation is an minimal patch for
> IPython itself, we'll be
> happy to integrate it. As soon as you add something into IPython itself it
> will considerably
> slow you down as every change will have to go through the core team.
>
> If a deep change is required, go through an IPython Ehencement Proposal
> [3].
>
> Hope that respond to some of your question, I'm sure other dev will have
> things to add on that.
>
> Cheers,
> --
> Matthias
>
> [1] :
> http://stackoverflow.com/questions/20777151/ipython-notebook-internationalization
> [2] : http://jinja.pocoo.org/docs/extensions/
> [3] :
> https://github.com/ipython/ipython/wiki/IPEPs:-IPython-Enhancement-Proposals
>
> Le 26 déc. 2013 à 16:46, António Seabra a écrit :
>
> >
> > Hi everybody,
> > I'm planning to use IPython (under the clothes of IJulia actually) in an
> undergraduate class where some of the students don't know much English.
> > Would like to be able to do two things:
> >       • Translate IPython Notebook Menu items and Dashboard.
> >       • Change items in Help Menu by: (i) deleting some items and (ii)
> creating new domain specific Help items (eg. course related topics would
>     be more relevant than some Python packages that would no be used).
> > I understand that at the moment there's no machinery in place for easily
> achiving this. Which would be the best way to proceed?
> > Many Thanks!
> > Antonio
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://mail.scipy.org/mailman/listinfo/ipython-dev
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20131227/d0359540/attachment.html>


More information about the IPython-dev mailing list