NetTalk Central

Author Topic: Custom Options for TinyMCE - example Language translation  (Read 10149 times)

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Custom Options for TinyMCE - example Language translation
« on: June 19, 2011, 11:48:00 PM »
TinyMce supports a variety of options when the control is initialized. This post serves to show you how to apply those options. Specifically, this post will show how to use the language option to set the language to spanish.

Before applying the option, download the appropriate language pack from http://tinymce.moxiecode.com/i18n/index.php?ctrl=lang&act=download&pr_id=1. In this case I'm going to assume the language downloaded was Spanish (es) - replace es with your language in the code below.
the language files belong in the \web\tiny_mce_jq\ folder.

In the WebHandler procedure, _TinyMCEInit method create a local variable, called say loc:options.

loc:options  string(Net:MaxBinData)

then override the parent call with some code, something like the following;

  loc:options = clip(p_manual) & 'language : "es",'  ! es = spanish
  ReturnValue = PARENT._TinyMceInit(p_FieldId,p_Flags,loc:options)
  RETURN ReturnValue

The 'language : "es",' part is the TinMCE setting - note the trailing comma which is important.

cheers
Bruce