[wp-polyglots] Please help me get started with gettext

Txopi txopi at sindominio.net
Sun Aug 7 10:40:45 GMT 2005


Simos Xenitellis(e)k dio:

> Richard M. Pavonarius wrote:
> 
>> I've read the codex and the gettext manual and I still
>> don't understand. I would like to use a new theme in
>> Japanese.  
>>
> Which theme is that? No all themes support i18n and gettext.

To be sure of that, you can take a look at the code and check if the 
strings are called using the funcions __() and _e(). If that's the case, 
  the theme supports gettext. If not, you should change to another 
theme, search a gettexted version of the theme someone could already 
done or change the theme yourself.

> 
>> All I want to do is add to ja.po the files that are in
>> the theme. I can figure out the rest, but I can't seem
>> to figure out how to get started.
>>
>> I have the ja.po file from
>> http://svn.automattic.com/wordpress-i18n/ja_JP/trunk/messages/
>>  
>>
> This is the "catalog" file (translation file) for the WordPress program 
> itself. If you want to have a translated theme, you need to do the 
> translation of the theme.
> 
>> My guess is I need to create a new PO file then merge
>> it with the above.
>>  
>>
> Most (in fact, all) themes that I have seen, allow you to keep a 
> separate .mo file just for the theme. You place the ja_JP.mo theme 
> translation in the theme directory and you make sure that WP_LANG is set 
> to ja_JP.

You can merge the new strings needed by the theme into the main po file, 
but it is better to create a separate po file just for the theme. Then 
used the function load_theme_textdomain() as described here and you get 
a internationalizable theme:

http://boren.nu/archives/2004/11/01/localizing-plugins-and-themes/

Anyway, Stefano has already improved some themes generating his own POT 
file and the PO/MO pair in italian. Perhaps you can take advance of his 
work:

http://www.wordpress-it.it/temi-italiani

> 
>> I found a script that I think creates the file I need:
>> http://wiki.wordpress.org/?pagename=POTscript I
>> installed and did chmod +x, but there are no
>> instructions on how to use it. My best guess is I run
>> it on the directory containing wordpress like this:
>>
>> ./wp-gettext.bin wordpress
>>
>> But I received the error "language `php' unknown"
>> FWIW, I'm using Dreamhost.
>>  
>>
> What does "uname -a" give you? This command tells you the operating 
> system version.
> My guess is that Dreamhost uses Solaris, which has a version of xgettext 
> that does not understand PHP source files.

You can also generate the POT file with poEdit (in the server or in your 
own computer):

http://codex.wordpress.org/User:Skippy/Creating_POT_Files

> 
>> I assume the trick to getting started is something not
>> too difficult, but for the life of me I can't figure it out.
>>  
>>
> It took me some time myself to figure out how I18n works with wordpress. 
> You need to search a lot..
> For example, I sent an e-mail here last week announcing a new 
> translation for WordPress so that it is added to 
> http://svn.automattic.com/wordpress-i18n/ and I did not get any response 
> from this list.

My situation is similar. Some friends and me have translated wordpress 
to the basque language (euskara) and I don't know exactly what we have 
to do. We also writed an installation guide [1] and put accesible the 
po/mo files into rosetta [2] and in the basque wordpress comunity 
download section [3].

[1] http://librezale.org/wordpress-eu/?p=5
[2] https://launchpad.ubuntu.com/products/wordpress/+translations
[3] http://librezale.org/wordpress-eu/download/wordpress1.5/

We also have put references to the installation guide and to the basque 
translation inside codex:
http://codex.wordpress.org/WordPress_in_Your_Language#Basque
http://codex.wordpress.org/Installing_WordPress#Installation_Instructions_in_Other_Languages

The right way is to add the po/mo files into subversion? Is there any 
wordpress developer not in vacances who can upload this translatons?

Basque language uses latin1 charset like spanish, french and italian. It 
should be uploaded any more file than the po/mo files?

> Anyone has a clue?

As you can see, no :)

> 
> Simos

Txopi.



More information about the wp-polyglots mailing list