Download the plugin by clicking here.
Translate Plugin for Movable Type 4.x
This plugin allows you to place links on your blogs that will translate the content into multiple
foreign languages using the Google Language AJAX APIs.
A. Installation Instructions
- Copy the contents of the folder to your MovableType directory. Make sure
that the directory structure remains intact.
-
Log in to the MovableType dashboard, or refresh the dashboard if you are already logged in.
You should be prompted to "Upgrade".
-
Open the Header template (Design - Templates - Template Modules) and insert the <MTTranslateHeader/> tag between the <head> and </head> tags.
This will allow the Google Language AJAX APIs to work on your site on all pages (the tag includes the needed javascript).
- Open the Stylesheet template and include the following line after the other "@import" statements:
@import url(<MT:StaticWebPath>/plugins/Translate/css/translate.css);
- Modifiy the templates and include the tags in the desired locations (see section B: Using The Tags).
- Publish your blog. You should see the "Translate" link below each entry.
B. Using the Tags
You must use the <MTTranslateHeader> tag somewhere (ideally in the Header template).
The only other tag is the <MTTranslateMenu> tag which inserts the proper code needed to display the translate menu,
which allows the reader to translate the content of the entry. The tag has 2 parameters:
- sourceid (required) - The HTML div id of the content that is to be translated.
- sourcelanguage (optional) - The 2 character language code of the original language of the content.
If not specified, "en" will be used by default (English).
For example, you could place the following code into your Summary template:
<mt:setvarblock name="sourceid">asset-body-<$MTEntryID$></mt:setvarblock>
<MTTranslateMenu sourceid="$sourceid" />
Make sure that your template has the corresponding id on the appropriate div tag. You may need to add the id yourself if
it is not already in your template!
Also note that you will probably need to place the tag in your Entry template as well. Remember, div tag id's must be unique, so use
the MTEntryID tag to get the unique id of the entry.
C. Other Stuff
The CSS file can be changed to create the desired style. By default it uses flag icons from
http://www.famfamfam.com/lab/icons/flags/
which are named according to country codes (not to be confused with language codes).