PerfectlyNormal / tinymce-rails-imageupload

Image upload plugin for TinyMCE and Rails with the asset pipeline
MIT License
149 stars 153 forks source link

spanish translation #31

Closed pomartel closed 11 years ago

pomartel commented 11 years ago

Here is the spanish translation for the plugin. By the way, I didn't take the time to read the tinymce I18n documentation but do you know if there is a way to default missing translations to english? This way, it doesn't look so awful if you add features in the future and a translation is missing.

PerfectlyNormal commented 11 years ago

Unfortunatelyt, it doesn't seem to support any kind of fallbacks. The easiest (and really hacky) way I've found is to simply add the key to each translation, setting the value to the english string, and updating as the translators have time.

PerfectlyNormal commented 11 years ago

Oh wait, tinyMCEPopup.getLang lets you specify a default value, which is supposed to be used if the translated version can't be found. The plugin does this, but only for the bits in the JS. In the HTML, we use {#uploadimage_dlg.input}, which I found somewhere, and gets replaced with the right values. Not sure if that bit can take a default value as well.

PerfectlyNormal commented 11 years ago

The {#uploadimage_dlg.input} bits gets replaced in a function called translate, deep in the tiny_mce_src.js file from tinymce-rails (line 14052). Doesn't look promising for a fallback there.

pomartel commented 11 years ago

Would be great if that works. It would also be good if it could default to the english translations files if the files are missing. I was a bit horrified when I found out that if a translation file is missing, tinymce won't load at all and throw a JS error.