views:

355

answers:

3

On Windows using WAMPserver (Apache, MySql, Php) I have the following:

//test.php
if (!defined('LC_MESSAGES'))
define('LC_MESSAGES', 6);

$lang = "sv";
putenv("LANG=$lang");
setlocale(LC_ALL, $lang);

$domain = "messages";
bindtextdomain($domain, "./locale");
textdomain($domain);

echo _("This is a string");

It works fine, i.e. it outputs "This is a string" which means I have gettext correctly setup up.

But HOW in the world do I create a .po-file?

I downloaded POEdit but I can't see how to make this happen with that software.

ANy help is greatly appreciated!

A: 

There're many tools, such as Poedit. In PHP, it's handled by the Gettext extension.

See also:

If you are any problems with Poedit, feel free to give some details.

Álvaro G. Vicario
A: 

PoEdit is the tool to create the .po file. You have to do a little configuration with it and it's not the easiest. The way it should work is that it finds all the text in your source code that's wrapped in the marker string that you configure. This becomes the source text that you give to your translator. They then translate it into the target language(s) and save the translation files and return them to you. You then dump those files into a special directory in your php application and whenever the gettext extension sees one of the translation strings it fetches the appropriate translation.

I can probably help more if you show some details about where you got hung up with poedit.

Thx, I managed to sort it out. The problem was that it was not clear on how to set the basepath(s). And the interface is too old to be intuitive enough to understand how to create a new path. :)
tobefound
A: 

Hi

you can get the information about how to create a .po file on the wdmac website:

http://www.wdmac.com/how-to-create-a-po-language-translation#more-631

it's very easy, but not intuitive.