dbs / ris2web

Given a RIS file, generate a web site that displays the citations.
GNU General Public License v3.0
7 stars 2 forks source link

Internationalization #32

Closed vtrlx closed 9 years ago

vtrlx commented 9 years ago

I've internationalized the application for French. Due to Squeeze being, well, Squeeze, I've not been able to test it out on Dev because Python3-Flask is unavailable. It should work though, seeing as I didn't mess with any functionality.

I've also got your easy instructions for secret key generation! They're in config.ini.

Fixes #4

dbs commented 9 years ago

Thanks for this, but I think we need to take a deeper look at the translation support. Specifically, phrases shouldn't be broken up into pieces, but should support variables. For example,. we shouldn't have separate strings for "A project of the", "J.N. Desmarais Library", "at", "Laurentian University", but should instead be something like:

{{ gettext('A project of the <a href="%(liburl)s">%(libname)s</a> at <a href="%(uniurl)s">%(uniname)s</a>',
     liburl='http://laurentian.ca/library', libname='J.N. Desmarais Library',            
     uniurl='http://laurentian.ca', uniname='Laurentian University')
}}

That way, a translator can shift the variables around to keep the sentence meaningful in a different language.

Also, why do we need a secret key just for the language selector?

vtrlx commented 9 years ago

The secret key is because language selection uses a session variable instead of the URL because, well, we had URL problems in the past with refdesk.

You have a point for variables. Will sort that out.

dbs commented 9 years ago

http://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xiv-i18n-and-l10n may be helpful

vtrlx commented 9 years ago

Alright. So the fixes to translation are applied, and now translating to languages with other sentence syntaxes should just work.

vtrlx commented 9 years ago

I've closed it for now because I found something dissatisfying.