WordPress Translate Plugin

There are plenty of auto translate plugins, but they leave the content rigid with grammatical errors.  For those needing a solution to translate a WordPress site manually into unlimited languages or versions, WP-Translate is for you.

Using shortcodes, template tags, and a widget, you can easily create a site that will reflect appropriate content, images, links, and text for each language.  You can use simple shortcodes in your content, or customize your templates to change your entire site.  The beautiful thing is that you don’t need to create multiple posts or pages for each language.  All content is filtered off one post/page.

Usage

Add a Language

  • Go to the Translate menu in the admin panel and add your languages.
  • Select which language will default when a guest first visits your site.

Custom Fields – posts/pages

  • To translate the page titles, add a custom field where key = %language_name% and value = your translated title.
    • Example – english = This is an English Title  OR  french = This is a French Title.

Shortcodes – Place anywhere in posts/pages/text-widgets

  • [translate lang=%language_name%] Place any content here. [/translate]
    • Example: [translate lang=english]<p>This is a paragraph that will only show when the ‘english’ language is selected.[/translate]
    • Custom Styling: .translate_%language_name%
  • [translations] - Gives an unordered list of available languages and activation links.
    • Custom Styling:  li.list_item_%language_name%   (Example: li.list_item_english)
  • [list_pages] - Outputs a list of pages with custom fields set for that language.  To exclude pages, simply delete the custom title field for that language on the specified page.

Template Tags

HOME – outputs the URL of your homepage
TEMPLATEPATH – outputs the URL of your template directory

  • <?php list_translations(); ?> //Refer to the [translations] shortcode.
  • <?php translate_list_translations(); ?> //Refer to the [list_pages] shortcode.
  • <?php translate_link($parameters); ?>
    • Parameters must be separated by the pipe symbol | .
      • lang = language name
      • link = http://www.wherever.com
      • text = Link display text
      • class = link style class (defaults to %language%_link)
      • target = link target
    • Example: <?php translate_link(‘lang=english| link=http://misternifty.com| text=Go to Mister Nifty| target=_blank’) ?>
  • <?php translate_text($parameters); ?>
    • Parameters must be separated by the pipe symbol | .
      • lang = language name
      • text = Paragraph text
      • class = link style class (defaults to %language%_text)
      • target = link target
    • Example: <?php translate_text(‘lang=english| text=This paragraph will only display when English is selected.’) ?>
  • <?php translate_image($parameters); ?>
    • Parameters must be separated by the pipe symbol | .
      • lang = language name
      • src = image source
      • link = URL if you want to link image.
      • target = link target
      • alt
      • title
      • class = link style class (defaults to %language%_image)
    • Example: <?php translate_image(‘lang=english| src=TEMPLATEPATH/images/logo.png| link=HOME| title=My Logo| alt=My Logo ‘) ?>
  • <?php translate_title(); ?>
    • Replace the_title(); with translate_title(); in your loop and <title> tags.

Upcoming Features

  • Category Lists
  • More Widgets

Download Translate Plugin