TinyMCE translation

TinyMCE translation

In some versions, TinyMCE refuses to use the Users preferred language. This can be a timing issue. But there might also be some (SilverStripe) language files missing for the selected profile language!

Profile language in 2.4

Changing the language for a user profile fails in the TinyMCE editor.


The default editor properties are set in the cms/_config.php file. To get the language for the editor, the i18n::get_tinymce_lang() is called, that in it's turn calls i18n::get_locale() to obtain the $current_locale. This value is set from the LeftAndMain class' init() method, which at that moment unfortunately hasn't happened yet.


Adding  the call to i18n::get_tinymce_lang() to the end of mysite/_config.php will create a long enough delay for it to work:

// Set the editor language: calling this from the cms/_config.php 
// may fail, because $current_language is not set yet
	'language' => i18n::get_tinymce_lang(),

SilverStripe ssbuttons

A couple of button tooltips, like for instance 'Insert Image' will not be properly translated. You'll see something like {#tinymce_ssbuttons.insertimage}.


The proper languagefile in cms/javascript/tinymce_ssbuttons/langs/ is missing.


Copy the en.js to the language of choice, and adapt. For the Dutch language this would be:


tinyMCE.addI18n('nl.tinymce_ssbuttons', {
	insertlink: 'Link invoegen',
	insertimage: 'Afbeelding invoegen',
	insertflash: 'Flash Object invoegen'

HTML Source editor

The same thing occurs in the HTML popup, where you'll see something likeIn this case you need to create/adapt the following files. Again, for the Dutch language:


	desc : 'HTML broncode bewerken'


	title : 'HTML Broncode Editor',
	number_toggle : 'Regelnummers tonen'


Het versturen van reacties is uitgeschakeld.

RSS feed voor reacties op deze pagina