How to do multiple languages

6 posts by 2 authors in: Forums > CMS Builder
Last Post: August 11, 2009   (RSS)

Re: [northernpenguin] How to do multiple languages

By Dave - August 10, 2009

Yes, there is. Have a look at this post:
http://www.interactivetools.com/forum/gforum.cgi?post=65129#65129

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How to do multiple languages

Thanx Dave

That gets me part of the way, however is it possible to choose the tinyMCE language on the fly? For example, I have currently setup CMSB article table with two fields, Content (En) and Content (Fr). I would like to be able to use tinyMCE in French for the Fr field and in English for the En field.

Is this possible? My understanding was that tinyMCE could only handle one language at a time.... unless I can come up with a way of choosing between two version of tinyMCE!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [northernpenguin] How to do multiple languages

By Dave - August 11, 2009

Hi northernpenguin,

We could probably do some custom code for that. But you'd need to come up with a naming convention such as french fields end in _fr. If you had that you could edit /lib/wysiwyg.php and replace this line:

languages : '{$SETTINGS['wysiwyg']['wysiwygLang']}',

With this:
languages : 'en,fr',

And add this code in red further down:

$language = preg_match("/_fr$/", $fieldname) ? 'fr' : 'en';
// display field
print <<<__HTML__

<script language="javascript" type="text/javascript"><!--
tinyMCE.init({
mode : "exact",
theme : "advanced",
language: "{$language}",


Let me know if that works for you. It may require some more experimentation as the wysiwyg (tinymce) has a lot of features and can be complex at times.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] How to do multiple languages

Thanx Dave. I will give it a try later tonight and get back to you.
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke

Re: [Dave] How to do multiple languages

Dave: I followed your instructions, and I'm not really sure what happened! I have attached 2 snapshots of CMSB - adding a new record.

confused!
--
northernpenguin
Northern Penguin Technologies

"Any sufficiently advanced technology
is indistinguishable from magic."
........Arthur C. Clarke
Attachments:

image1.tiff 73K

image2.tiff 89K