Localize the Redactor Editor in PulseCMS

Hi, as you might know, when using a different language than english in Pulse, the whole UI is still translated except the editor Redactor.
In this little Tutorial I wanna show you how you can translate Redactor and the included plugins to your language.

The first thing is to head over to https://imperavi.com/redactor/docs/languages/
Here you can download your desired language file, in my case "de" for german.

Copy this language file (for example de.js) into your Pulse installation directory: admin/js/redactor/de.js

The next step is to edit some files. Open redactor_options.js in the same directory and change the lang attribute to your downloaded js file.

Now open the admin/index.php and add the .js file to the <head> section.

<script src="<?php echo $path.'/'.$admin; ?>/js/redactor/de.js"></script>

Okay, normally that's it, but here we have a few problems. :worried:

  • The given language file (in my case de.js) had many errors and many strings were missing.
  • There are 3 plugins inside redactor imagemanager, table and fullscreen which will also be translated.

Let's start with the language file. I will attach my language file, so you can compare it with yours, or you are from germany than you can just use it. :wink:
The table plugin is well coded and uses lang attributes so we can use them in our lang file. Here are the missing strings shown below, maybe it's a bit different in your language file:

Now open imagemanager.js (admin/js/redactor) and head over to line 17/18.
Here are the two strings "Upload" and "Choose" hardcoded:

The last file is fullscreen.js, open it and go to line 10, another hardcoded string to change:

Okay, we did it. Now everything should be translated. :tada:

A final note, think about that this solution is not update proof, so you have to backup change/overwrite your files.
In my case that is okay and my clients are happy. :sunglasses:

My de.js file: https://dl.dropboxusercontent.com/u/6744882/de.js


Great work @Oliver!! :zap::medal_military:

This combined with the translation inside Pulse UI and @instacks Localizer addon (https://addons.pulsecms.com/p/iss3) we can make a truly multi-lingual site in Pulse :slight_smile:

1 Like

Redactor translations included in Pulse5 - just change in the admin settings page :slight_smile: