Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We should use relatve url, otherwise module like locale can not load the JS files to parse text.
Comment | File | Size | Author |
---|---|---|---|
#13 | ckeditor-js-translation-1966798-13.patch | 906 bytes | lex0r |
#11 | ckeditor-js-translation-1966798-11.patch | 895 bytes | lex0r |
Comments
Comment #1
jcisio CreditAttribution: jcisio commentedIMO we should get rid of the "local paths" (i.e. URLs) and use url() to detect them. Because now local paths are determined at the config time (and are saved in the profiles), if you export profiles into a module, it won't work when you move CKEditor module folder (e.g. from sites/all/modules/ckeditor to sites/all/modules/contrib/ckeditor).
There are a few issues filed because of those "local paths", for example #1961974: Ckeditor is not loading via Edit module when custom plugins are enabled.
Comment #2
wwalc CreditAttribution: wwalc commentedThat might be a good idea, but I'm wondering if it will not break anything, especially if CKEditor or plugins are located outside Drupal in some way... definitely something to investigate.
Comment #3
jcisio CreditAttribution: jcisio commentedYou mean outside the Drupal docroot? We can simply say: "it is not supported". Just move them to sites/all/libraries, or symlink them. That will also help custom plugins (those not shipped with CKEditor and tightly integrated into Drupal) to be translated/managed via localize.drupal.org by a lot of users, and use only one lang.en.js. We moved from PO files to localize.drupal.org because of exactly the same reason.
Comment #4
wwalc CreditAttribution: wwalc commentedOkay, fair enough. Would you be okay with providing a patch for it?
Comment #5
jcisio CreditAttribution: jcisio commentedSure, I'm looking in it when I have some free time, hopefully soon.
Comment #6
wwalc CreditAttribution: wwalc commentedSuperb, thank you! I'll ofc gonna give it a try once available. Would be awesome to get rid of one more problem with non-standard solutions in this module.
Comment #7
jcisio CreditAttribution: jcisio commentedJust want to update: I didn't do it directly, but I tried to have a custom plugin automatically translated (replace 'text' with Drupal.t('text')), however it didn't work as I expected (need to drupal_add_js the lang.en.js file manually for locale.module etc.). I'll try another time.
Comment #8
jcisio CreditAttribution: jcisio commentedSimilar issue in core #2035721: Figure out how to translate Drupal-specific CKEditor plugins.
Comment #9
jcisio CreditAttribution: jcisio commentedRelated #721790: Translation of js strings.
Comment #10
lex0r CreditAttribution: lex0r at Peytz & Co commentedUsing Drupal.t makes no sense in current 7.x version. I checked the module's (ckeditor's) JS plugins and they use Drupal.t which is misleading and just doesn't work. The D8 fix mentioned earlier is a core fix which is not supposed to be ported to D7.
At the moment there's no even a tiny patch to address the translation issue. It looks like we are going back to thinking everyone must know English. From my POV, this is a critical issue (users may not be able to use the editor).
I'm not sure the title of this post reflects the real meaning of the issue: Translation of js strings was a better choice, but it is now closed as duplicate. The current title (call to action) assumes someone had to make a quick fix (it sounds like that!) but it never happened.
Comment #11
lex0r CreditAttribution: lex0r at Peytz & Co commentedA simple way to have the issue fixed. It's not ideal however it does the job and seems to work well at least in admin zone of a site, where having JS loaded at once doesn't affect the end user.
Comment #12
jcisio CreditAttribution: jcisio at Axess Open Web Services for ARTE G.E.I.E. commentedI was hoping this issue was a simple fix for JS translation, but then it was also blocked by a similar problem in D8 core. Now it has been fixed in core, we can see how to port it here. locale_js_translate() doesn't exist in D7 and I haven't checked for a similar function in D7.
I think your patch is what it was in the first iteration in core. Using that, plugin files are executed twice. We should avoid that. I'm also not sure if dependencies (plugin order) work.
PS: not all things that don't work as expected are critical bugs.
Comment #13
lex0r CreditAttribution: lex0r at Peytz & Co commented@jcisio,
just wanted someone to pay attention to this issue. It's been for such long time without even a not-so-good fix.
Btw, I found an issue with my previous patch so everyone should use the one attached below.
Comment #14
gifad CreditAttribution: gifad commented@jcisio : The scald project solves nicely this issue by using, in a hook_library() :
Can't CKEditor do the same for its own plugins ?