Here you can find step-by-step guide on how to localize TinyMCE editor. Good news is that very likely you don't need to do any translations as these are already done for many languages.
Installing language pack
- Just go to TinyMCE site and download language pack you require. If you cannot find appropriate language pack you have opportunity to create one but this is another story.
- Unzip and copy language pack files to <CS root>\tiny_mce\
- Do some language set up as appropriate for your situation as describied below
You have a few options how to set up TinyMCE UI language.
Setting site-wide default language for TinyMCE
You can do this in 2 slightly different ways
By modifying CommunityServer.config directly (not recommended)
Open CommunityServer.config and add language option to editor configs as appropriate
<CommunityServer>
<Core>
<editors>
<!-- for TinyMCE-based editors only -->
<editor name="...">
...
<editorOption name="language" value="ru" />
...
</editor>
</editors>
</Core>
</CommunityServer>
Via CommunityServer_override.config (recommended)
For each editor you want to change add the following to the CommunityServer_Override.config file. Substitute @name='...' with editor's name and value="ru" with language you need.
<Overrides>
<!-- for TinyMCE-based editors only -->
<Override mode="add" xpath="/CommunityServer/Core/editors/editor[@name='...']">
<editorOption name="language" value="ru" />
</Override>;
...
</Overrides>
Setting language dynamically (e.g. to match user's preferrence, per page, etc)
Again you can do this in sligtly different ways. For both methods you will have to modify aspx code.
Setting editor language option directly in a aspx code
For each editor on a page add the following code. Substitute Value="ru" with language you need.
<CSControl:Editor ...>
<EditorOptions>
...
<CSControl:EditorOption runat="server" Name="language" Value="ru" />
...
</EditorOptions>
</CSControl:Editor>
Creating and referring editor configuration
Set up as many different editors as you need using CommunityServer.config/CommunityServer_ovveride.config. On a page specify whether you want to use a specific editor defined in the config file. In the Page Load method for the ASPX page, use the following code:
CSContext.Current.User.EditorType = "My Custom Editor";
Where "My Custom Editor" is the value of the 'name' property for the editor that you want to use.
HINT: Exactly the same way as we set language option for TinyMCE we can configure many other TinyMCE options.
Posted
Jan 22 2009, 01:17 AM
by
Sergey