Closed michaelhagedon closed 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:
config.yml
, it appears that there are directives used for setting the language: app_language
and editor_language
, the latter of which I presume is for TinyMCE. It appears that app_language
is expecting a three character ISO 639-2 code and editor_language
is expecting a two character ISO 639-1 code, so to set the language to Norwegian (Bokmål) I had to set app_language
to nob
and editor_language to no
. Is it possible to make these the same? Or is there some kind of underlying conflict between the way CakePHP does internationalization and the way TinyMCE does internationalization? 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).
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.
"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).
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)
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.
And Norwegian language support. This was sponsored by Libriotech.