TinyMCE:Creating Language
From Moxiecode Documentation Wiki
Contents |
Language pack service (3.x)
We have a service for maintaining Language packages, it is a lot easier to keep the language packs updated, and you can help us.
Visit translation service website to help us out, follow the step by step instructions on that page.
Creating a language pack (2.x)
Language packs are simply JavaScript name/value arrays placed in the ".js" files in the "lang" directory. Remember to always use the "lang_" prefix for these value names so that they don't override other variables in the templates. The example below shows how the cut, copy and paste texts are packaged. Notice that there are three kinds of language packs. The first one is the general one shared by all themes. These are located in the "jscripts/tiny_mce/langs" directory. The second ones are theme specific language packs. These are contained in "jscripts/tiny_mce/themes/<some theme>/langs". The last one is plugin specific language packs located in each plugin.
tinyMCE.addToLang('',{
cut_desc : 'Cut (Ctrl+X)',
copy_desc : 'Copy (Ctrl+C)',
paste_desc : 'Paste (Ctrl+P)'
});
Remember that the last translation line should not have a comma (",") character at the end. The first parameter to the addToLang method is the prefix to add before each variable. This was added to reduce the overall size of the language packs in order to reduce the overall download time.
Files to edit
When translating TinyMCE, these are the files that currently need to be translated:
/tinymce/jscripts/tiny_mce/langs/en.js /tinymce/jscripts/tiny_mce/plugins/<plugin>/langs/en.js /tinymce/jscripts/tiny_mce/themes/advanced/langs/en.js
Notice some language variables may include a name, a URL of a GIF image, or similar. For example, the button for bold has a "F" character in the Swedish language pack. There are also relative window sizes located in the language packs. For example, if the link dialog needs to be bigger in order to fit a specific translation, you can alter the width of the window by modifying these variables.
Contributing your language pack
Go to the SourceForge patch page and upload a ZIP file containing all the language files in the correct directory structure.
Please translate all the plugins, even if you aren't using them.
