Retrieve Content language in CKEditor plugin

Hi there,

I’m writing a CKEditor plugin in Javascript for a multilingual site. I need to be able to retrieve the content language (not the interface language) for the document that is currently being edited.

Is there anyway to do this?


you posted in the content SaaS forum, but what you want can only be achieved in the PaaS/OnPrem version of the product. For that you can find the locale as a property (hippotranslation:locale) of the node.

Thanks for the reply. How would I access the hippotranslation:locale property from Javascript? Do I need to do anything to make it available to Javascript? Maybe it is possible to interpolate it into the CKEditor config?

I’m working on a custom plugin for CKEditor so I would need to access it from there.

I’m not really well versed in CKeditor plugins. Most likely you will have to do something on the Java side to expose this, but the only advice I can give you is to look at the cms code. Again, this will only be possible in PaaS/OnPrem.

The CKEditor part I can figure out. My question really is what I would need to do on the Java side to expose this?

(we have the PaaS version, sorry for posting in the wrong forum)

So, how would I expose hippotranslation:locale so it can be accessed by Javascript when editing a document? Either by inserting a script tag or if I can set a HTML attribute somewhere I can pick it up too. Any idea’s?


I’m sorry no one seems to have an answer for you. You should check the cms code, there are ckeditor plugins in there. Perhaps it will reveal to you how to do this.