简体   繁体   中英

How do I get gettext and poedit to work with WAMP?

I am trying to get gettext and poedit to work on windows. Here is my test code:

<?php
require_once("localization.php");
echo _("Hello World!");
?>`

and

<?php
$locale = "de_DE";
if (isSet($_GET["locale"])) $locale = $_GET["locale"];
putenv("LC_ALL=$locale");
setlocale(LC_ALL, $locale);
bindtextdomain("messages", "./locale");
textdomain("messages");
?>

I am using this tutorial: link . I have the gettext extension enabled via WAMP. Unfortunately when I navigate to the page, it shows "Hello World!" instead of the expected "Hallo Walt!"

Any help would be appreciated!

On ubuntu I had to sudo apt-get install gettext and then sudo locale-gen de_DE to get this to work. I still haven't found a fix for windows =(

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM