1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
$locale = "de_DE";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");

echo _("Hello World!");

?>

\public\locale\de_DE\LC_MESSAGES\messages.po: 

msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: 2012-09-25 21:55-0500\n"
"PO-Revision-Date: 2012-09-25 22:00-0500\n"
"Last-Translator: Amped <[email protected]>\n"
"Language-Team: \n"
"Language: Olde\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.3\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: E:\\websites\\oldetranslate\\public\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Poedit-SearchPath-0: .\n"

#: test.php:3 test2.php:11
msgid "Hello World!"
msgstr "Testing123"