PhotoDune

Easiest way to create localization POT file for WordPress theme?

1025 posts
  • Author had a File in an Envato Bundle
  • Bought between 50 and 99 items
  • Elite Author
  • Exclusive Author
  • Has been a member for 4-5 years
  • Referred between 500 and 999 users
  • Sold between 250 000 and 1 000 000 dollars
+1 more
ThemeBlvd says

On my themes I’m starting to get a lot of requests for localization capabilities… and because I’m just a silly American that only speaks English, it’s never occurred to me to learn how to do it. I’ve been reading about it on a bunch of different websites (WordPress Codex, neettuts, and a bunch of other stuff I found on Google) and I’m getting a little confused.

I have gone through my entire theme and made all outputted strings that the users see like this: __("Text here...").

But now I’m having trouble figuring out how to create a POT file, which is the final step now if I understand correctly?

I’ve found many different ways of creating POT files and I’m not having much luck. Do you guys have any tips on this? What is the easiest way to create a POT file for your theme? How do you guys do it?

2358 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says

Probably you know about it, but this sounds pretty easy and straightforward, what doesn’t work out for you?

66 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Moldova', Republic of
  • Sold between 50 000 and 100 000 dollars
WebinCode says

Hi themeblvd! Check this Hope this will help.

374 posts
  • Microlancer Beta Tester
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Most Wanted Bounty Winner
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
  • Bought between 10 and 49 items
  • Netherlands
+1 more
redfactory says

Ah yes I really want to know this too! I’ve done the same thing as you, making all my outputted strings __(“stuff”) compatible. I just want to know an easy way to convert the rest of the (static) text in my themes. Anyone have any tips or tuts?

Thanks! :)

2358 posts
  • Has been a member for 4-5 years
  • Exclusive Author
  • Europe
  • Bought between 10 and 49 items
  • Referred between 100 and 199 users
  • Sold between 100 and 1 000 dollars
  • Microlancer Beta Tester
digitalimpact says
Hi themeblvd! Check this Hope this will help.

Thanks man! Really useful! :)

374 posts
  • Microlancer Beta Tester
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Most Wanted Bounty Winner
  • Has been a member for 3-4 years
  • Referred between 200 and 499 users
  • Bought between 10 and 49 items
  • Netherlands
+1 more
redfactory says
Hi themeblvd! Check this Hope this will help.

Ahw great! Thanks for the link :)

1763 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Germany
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
BroOf says
66 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Moldova', Republic of
  • Sold between 50 000 and 100 000 dollars
WebinCode says
This also helped me:

http://www.deluxeblogtips.com/2010/04/how-to-localize-themes-in-wordpress.html

:) this is the same man. Only one notice guys use TEMPLATEPATH instead of TEMPLATE _PATH. For me TEMPLATE _PATH doesn’t work

688 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 5-6 years
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
  • Uruguay
_rg_ says
This also helped me:

http://www.deluxeblogtips.com/2010/04/how-to-localize-themes-in-wordpress.html

:) this is the same man. Only one notice guys use TEMPLATEPATH instead of TEMPLATE _PATH. For me TEMPLATE _PATH doesn’t work

I use my own themepath just because that problem, the get_template_directory() is relative to the PARENT theme.

So on functions:

define('THEME_PATH', get_template_directory());

load_theme_textdomain( 'my_theme', THEME_PATH . '/languages' );

$locale = get_locale();

$locale_file = THEME_PATH . "/languages/$locale.php";

if ( is_readable( $locale_file ) ) require_once( $locale_file );

Then i use poedit for the .po and .mo files.

1763 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Germany
  • Has been a member for 4-5 years
  • Microlancer Beta Tester
  • Referred between 1 and 9 users
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Sold between 5 000 and 10 000 dollars
BroOf says
This also helped me:

http://www.deluxeblogtips.com/2010/04/how-to-localize-themes-in-wordpress.html

:) this is the same man. Only one notice guys use TEMPLATEPATH instead of TEMPLATE _PATH. For me TEMPLATE _PATH doesn’t work

Oh, didn’t noticed :D! Sorry…

by
by
by
by
by