TinyMCE: enabling other languages

September 22, 2009 / Filed under: Development, TinyMCE, Language

TinyMCE is a robust web-based text editor.

The default language is English, but users often need support for other languages, especially if you're using TinyMCE in your own application that reaches a wide audience.

Changing the default language to something else involves new files to be included in the install, as well as a code addition/adjustment. After learning how to do it "the hard way," if you're a developer - it might be wise to include a standard user-interface way of changing the TinyMCE language directly in your application.

Download language pack

First, visit the downloads page for the various language packs.

Check the checkbox for the languages you wish to download:

Screenshot of TinyMCE language download page

NOTE: Do not click the "[XML]" link on the page - this is for updating or contributing to the language packs.

Unzip the downloaded file, and you'll have a corresponding set of folders that mirror a handful of the same exact folders in your actual TinyMCE installation. Inside each folder from your download will be a "langs" folder. You'll want to navigate to the same "langs" folders in your TinyMCE installation, and paste the new language files.

Screenshot of nested folder hierarchy

Make sure to go through every folder from the download, and into the "langs" directory, in order to obtain the language file for that plug-in or theme.

Once this step is complete, you have successfully installed the new language files! Now you just need to tell your application which files to use.

Initialize the editor with the language

If you've used TinyMCE in your application, you'll be familiar with initializing the editor to be displayed on the page. Just include the "language" option:

tinyMCE.init({
   ...
   language : "sr",
});

Comments/Mentions

# Vikasrh at 10/6/2009 5:20 am cst

After including the language packs will i be able to type in a perticular language which i select ? Ex. If i add chinese language pack and set my default language as chinese , then will i be able to type in chinese ?

# Matt at 10/6/2009 8:06 am cst

I could be wrong, but I believe the language packs just change the language for the editor toolbar text.