Evo jednog test primera koji sam koristio (inače preuzeto sa http://www.onlamp.com/pub/a/php/2002/06/13/php.html?page=1)
http://idbulider.com/gettext.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Cafe ID - Stats</title>
</head>
<body>
<?php
// I18N support information here
$language = 'sr_YU.utf8';
putenv("LANG=$language");
setlocale(LC_ALL, $language);
// Set the text domain as 'messages'
$domain = 'messages';
bindtextdomain($domain, "./locale");
textdomain($domain);
echo gettext("A string to be translated would go here");
?>
</body>
</html>
Prevod message.po file sam napravio koristeći se poedit programčićem i on je simljen kao utf8. Evo njegovog headera:
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2004-05-19 07:01-0400\n"
"PO-Revision-Date: 2004-05-19 13:49+0100\n"
"Last-Translator: Dragan Dinic <[email protected]>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
...
File sa prevodom sam kreirao koristeći msgfmt messages.po.
Hvala unapred na pomoći.
Dinke