Page 1 of 1

I did something smar

Posted: 13 Feb 2008, 17:55
by webansvarlig
I did something smart one time. It changed the language in the TinyMCE to Norwegian. But now i don't work anymore. I only thought I changed 'language : "en" to 'language : "no", or maybe "nb". Now it doesen't work anymore.

Is there a possibilty to have this to be done much more easily? Maybe ad a parameter in the language file? Do you understand?

function displaySimpleTinyMCEJS()
{
$js = '<script type="text/javascript">' . "\n";
$js .= 'tinyMCE.init({'. "\n"
.'mode : "textareas",'. "\n"
.'theme : "advanced",'. "\n"
.'language : "en",'. "\n"
.'plugins : "emotions",'. "\n"
.'editor_selector : "mceEditor",'. "\n"
.'theme_advanced_buttons1 : "bold, italic, underline, separator, strikethrough, justifyleft, justifycenter, justifyright, justifyfull, bullist, numlist, undo, redo, link, unlink, separator, emotions",'. "\n"
.'theme_advanced_buttons2 : "",'. "\n"
.'theme_advanced_buttons3 : "",'. "\n"
.'theme_advanced_toolbar_location : "top",'. "\n"
.'theme_advanced_toolbar_align : "left",'. "\n"
.'theme_advanced_path_location : "bottom",'. "\n"
.'extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|wid th|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|s ize|color|style],span[class|align|style]"
});' . "\n";
$js .= '</script>';
return $js;

}

yes, just add parame

Posted: 13 Feb 2008, 23:34
by Jan
yes, just add parameter:

language: "no" or "nb". But you must have a norwegian language file which must be saved somewhere (I think - I don't have any experience with this):

administrator/language/en-GB/en-GB.plg_editors_tinymce.ini ???

or here (with norwegian tinymce language file):
plugins/editors/tinymce/jscripts/tiny_mce/langs/en.js (en.js --> no.js or nb.js)

I think, the second is right, because Phoca Guestbook takes the TinyMCE libraries from:
plugins/editors/tinymce/jscripts/tiny_mce/ folder.

Jan

Hehe. Stupid me. Fou

Posted: 14 Feb 2008, 02:19
by webansvarlig
Hehe. Stupid me. Found out the trouble before I've checked your answer. hehe. I had deleted the norwegian language files in tinymce, when uploading to joomla 1.5.1.

You have to just install tinyMCE language files. That is in three different folders. Theme, langs, plugins under the plugins/editors/tinymce/jscripts/tiny_mce/ folder.

Then you need to change the to letters under language in the com_phocaguestbook/helpers/phocaguestbook.php file.

It's the to first letters in the language:
English: en-GB ---> en
Norwegian: nb-NO ---> nb

Hope this will help others with the same problem.

Excuse me for bad english ;)

Posted: 14 Feb 2008, 14:50
by Jan
Great thank you

Re: Change the language in the Tiny MCE editor

Posted: 24 Apr 2012, 14:11
by iherbak
I've changed the code in the helper (joomla 2.5) to rely on the global language object

function displaySimpleTinyMCEJS($displayPath = 0) {


$language = JFactory::getLanguage();
$langPrefix = substr($language->getTag(), 0, strpos($language->getTag(), '-'));


$js = '<script type="text/javascript">' . "\n";
$js .= 'tinyMCE.init({'. "\n"
.'mode : "textareas",'. "\n"
.'theme : "advanced",'. "\n"
.'language : "'.$langPrefix.'",'. "\n"