ualibraries / Guide-on-the-Side

The University of Arizona Libraries will no longer provide support for Guide on the Side. The code will remain openly available; however, UAL can no longer provide code fixes or upgrades.
https://ualibraries.github.io/Guide-on-the-Side/about.html
Other
66 stars 48 forks source link

Add internationalization to fix #26 #139

Closed michaelhagedon closed 8 years ago

michaelhagedon commented 8 years ago

And Norwegian language support. This was sponsored by Libriotech.

simpsonw commented 8 years ago

Wow, this is quite an undertaking! I'm definitely glad to have the internationalization support added and a translation as well.

I pull the changes locally and set the language to Norwegian and things mostly looked good, but there were a few issues:

image_title_tooltip

This is because that message is hardcoded in the JavaScript. We should fix that, although I'm not sure how exactly we'd go about doing that (I'd like to research how other have handled this kind of thing in JavaScript).

editor_tooltips

broken_character_count

phpimage_dialog

I'd really love to get this code into master, but those last two bugs give me pause since they really do break the existing functionality. I would be interested in hearing what others thing the best way to go is.

caosborne89 commented 8 years ago

"Click to enlarge image" was not wrapped in _(). Since it's javascript, I read that might be part of the problem. Not sure if that helps. I'm trying to test it, but I'm having trouble generating the .pot file with the new strings (or rather updating it).

simpsonw commented 8 years ago

I had some insight on the issue regarding the tooltips on the bottom row of icons in TinyMCE. Those are being provided by our own TinyMCE plugin called quickhelp. It appears that the quickhelp plugin is providing a translation for the nb language code but not the no language code while TinyMCE provides translations for both the nb(Norwegian Bokmål) language code and the no (Norwegian*) language code as well as the nn language code (Norwegian Nynorsk).

This means that if you have editor_language in config.yml set to no, the regular TinyMCE tooltips appear in Norwegian but the ones provided by the quickhelp plugin end up showing you the parameter names rather than translated text (e.g. "quickhelp.insert_definition_box").

You can sidestep the issue by setting your editor_language to nb in config.yml, but it feels weird to me that no mostly works but breaks just for our quickhelp plugin. I compared the no, nb , and nn localizations for TinyMCE. There are a few slight differences between no and nb, but in my (completely unexpert) opinion, no and nb are substantially more similar than nb and nn, so I copied our translation for nb into a new translation for no. I apologize if I've offended anyone's cultural or linguistic sensibilities by doing so but this appeared to be the best option given my lack of familiarity with the Norwegian language.

These changes are in the michaelhagedon-26_internationalization branch of ualibraries/Guide-on-the-Side.

*Pedantic note: According to Wikipedia, the no ISO 639-1 code represents Norwegian as a "macrolanguage" and therefore covers both Bokmål and Nynorsk (https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)

simpsonw commented 8 years ago

I've decided to merge what I had in the michaelhagedon-26_internationalization branch to master. The issues with the character count and the TinyMCE tooltips have been resolved. Both the app_language and editor_language should be set to nb for Norwegian (Bokmål) or en for English. The issues with the "Click to enlarge this image" and the "What did you think of this tutorial?" remain, but I don't believe they are serious enough to block merging this and I will make separate tasks for them.