How to do multiple languages

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

By northernpenguin - August 10, 2009 - edited: August 10, 2009

Dave: I know this is an old post, but I have a question about this subject.

My clients wants to be able to add an article in both English and French (with accents). Is there any way to do that in CMSB v1.32?

Update: Detached post and renamed title (Dave)
--
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 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

By northernpenguin - August 10, 2009

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

By northernpenguin - August 11, 2009

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