Translations broken on WooThemes Bueno

The past few days, I have been working on switching my girlfriend’s new site – Mientje’s Baksels – from wordpress.com to a self-hosted blog, using WordPress 3′s new multisite feature (this blog should move there soon too, I just have to sort out the domain transfer). The wordpress.com blog used WooTheme’s Bueno theme, which we thought matched very well with the subject of her blog: cakes. Unfortunately, the theme didn’t seem to pick up the Dutch language selection. Here’s what was wrong with it, and what I did to fix it.

The first problem was the naming of the .mo files in the bueno/lang directory; these were are called bueno-<locale>.mo, e.g. bueno-nl_NL.mo (actually, that file didn’t exist in my version, I had to copy the nl_BE file to get a Dutch translation, but that is a minor issue). The problem: WordPress will look only for files named <locale>.mo. So, step 1: rename all your .mo files (or at least the ones you need) so they do not include the theme’s name. The second problem is the way the theme tried to load the translation files:

1
load_theme_textdomain('woothemes');

This is on line 142 of bueno/functions/admin-setup.php. When calling the function like this, WordPress will only look in the theme’s root directory. The trick, of course, is to tell WordPress to look in the directory in which the theme collects its translations. Step 2, change the offending line to this:

1
load_theme_textdomain('woothemes', get_template_directory() . '/lang');

Make these changes, and your Bueno theme will happily display localized text strings. (The same issue may be true for other WooTheme’s WordPress themes, I haven’t checked).

This entry was posted in Web and tagged , , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

9 Comments

  1. Posted 3 September 2010 at 00:37 | Permalink

    Thank you very much! That helps me a lot!

  2. Emily
    Posted 9 December 2010 at 11:00 | Permalink

    Thank you so much, you really made my day!

  3. Posted 15 December 2010 at 19:44 | Permalink

    Thanks a bunch! I use a self-hosted WP with free Wootheme, which has the same problem with the filenames. You saved my day!

  4. Posted 18 December 2010 at 10:10 | Permalink

    Great it’s helping people out :)

  5. Mariciu
    Posted 23 August 2011 at 09:41 | Permalink

    WOOOW. It worked for my Diner theme. After 1 month of troubles I finally fixed it, phew. Thanks a lot Eelke !

  6. Posted 18 September 2011 at 16:21 | Permalink

    Glad to have helped.

  7. Daniel
    Posted 29 October 2011 at 13:12 | Permalink

    On my side, I’ve put my “fr_FR.mo” in the root directory of my “theme” instead in the “lang” one inside the theme directory. Working well for me !

  8. Posted 8 November 2011 at 22:49 | Permalink

    Sure, that should work too. I like to keep translation files separate from the other files, though.

  9. Posted 27 December 2011 at 13:56 | Permalink

    Wow, thanks. So many websites checked, but they just explain how to edit .po files, nothing about to change admin-setup. Spent half day to find your solution!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>