PHP Multi languages
<p>I am working on multi-language project. The content such as articles, product description will be shown from database. This is no problem. The problem is there are some "static" descriptions, e.g. Form labels, error messages etc.</p>

<p>So far I ended with this. I store language in COOKIE and I have function to write the messages in set lanugeage. I have file named _lang.php with this content:</p>

<pre><code>$['empty_field']['sk'] = "Slovak description of error";
$['empty_field']['en'] = "English description of error";
</code></pre>

<p>And so on. Is this good solution or not ? Any other solutions ? Thanks</p>

<p>So I've tried the gettext() and ended with this: (output is welcome)</p>

<pre><code>putenv("LANGUAGE=sk_SK");
setlocale(LC_ALL, 'sk_SK');
$dom = "roids";
bindtextdomain($dom, "www/roids/_locale");
textdomain($dom);
echo gettext('welcome');
</code></pre>

<p>I created folder this folder: _locale/sk_SK/roids.po</p>

<p>Content of roids.po:</p>

<pre><code>msgid ""
msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"

msgid "welcome"
msgstr "vitaj"
</code></pre>

<p>I' using WAMP server and I do not know whether this path: www/roids/_locale is good. Wamp is installed here: D:\wamp and ww files are in D:\wamp\www</p>
