Get my FREE ebook:
"SEO FOR BLOGS: The Ultimate Guide"
Limited Time Offer!

How To Make Your WordPress Theme Translation-Ready

If you are working on developing themes for WordPress (which is actually a pretty good way to get free backlinks to your own personal blog), you should consider making your WordPress translation-ready. It will take you less than 1 minute and will certainly increase your theme reach because not everyone speaks and blogs in English.

The very first step is to create a folder called languages in your theme folder.

In a second time, edit the functions.php file of your WordPress theme and paste the following code in it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Make theme available for translation

// Translations can be filed in the /languages/ directory

load_theme_textdomain( 'your-theme', TEMPLATEPATH . '/languages' );

$locale = get_locale();
$locale_file = TEMPLATEPATH . "/languages/$locale.php";
if ( is_readable($locale_file) )
	require_once($locale_file);

Your theme is now ready to be translated!

Commenting Contest
If you enjoyed this article, Get email updates
(It's Free)
Sté Kerwer
Post written by: Sté Kerwer
Bonjour from France. My name is Stéphane Kerwer and Dukeo.com is my blog. I do most of the heavy lifting in here but from time to time, you may see some guest posts. If you wish to receive updates about Dukeo, subscribe to RSS Feed, follow Dukeo on twitter or become a fan on Facebook.
15 Comments
  1. John
    John

    I don’t know if this is something I should do, as I’m not completely sure how many people would actually need my blog to be in another language. How do you know if this would be right for your blog?

    • Anon
      Anon

      Let’s put it this way: Do you have a reason not to do it? Always better to be safe than sorry.

      • John
        John

        You have a point there. :)

  2. Gorman
    Gorman

    What languages does this include?

    • Anon
      Anon

      It doesn’t “include” languages, it just lets anyone who comes to your page be able to translate it into their native language.

  3. Michelle
    Michelle

    I think this is a great idea. There are so many great writers and great blogs around the world, why would you want to be limited? There are examples of bloggers out there that have become renown, like Mashable, which is an internet news blog started by Scot Peter Cashmore in 2005, and is now one of the top websites in the world. It’s called the World Wide Web for a reason, people!

    • Sarah
      Sarah

      I love Mashable!

    • Gorman
      Gorman

      It’s things like this that make technology beautiful. Transcending borders, oceans, languages, it’s the ultimate connection. No boundaries.

  4. Samie
    Samie

    Wow, I had never even considered doing this, that’s great!

  5. Did you know that most of the time people will take your blog more seriously if it’s on your own website, rather than WordPress or any of those blog-ready sites? If you have a blog that’s http://www.thisismyblog.com for example, that is seen a much more credible. Fun fact!

    • Oh wow, that actually created a link to a real person’s blog, my bad. I meant it as an example blog title, but you get the idea. Personalized blog pages are more credible than ready-made.

      • Liz
        Liz

        Oops! :)

  6. Dana
    Dana

    Wow, I always thought that sites like WordPress would just have translation capabilities built in!

    • AffMaster
      AffMaster

      You would think. But no, a lot of times you have to do things by hand on these sites.

  7. Boa noite from Brazil!

    Please, I need to ask – which I think – can be a very dummy question; then, since now: sorry about that! :) I’m in the very start of WP studies, so…

    XHTML + CSS sites may use just a link (to Google translator, for instance, regardless quality issues) and anyone who comes to this page will be able to translate it into their native language.
    So, what is this about, here, with WP? I mean: why does WP need these codes?
    Will these special lines translate something that usual translators would not be able to? What, exactly?

    Thanks for your attention and sorry about my english mistakes!

arrow