PHP gettext on Windows

前端 未结 6 1531
你的背包
你的背包 2020-12-13 22:03

There are some tutorials out there for gettext (with Poedit)... unfortunately, it\'s mostly for a UNIX environment. And even more unfortunate is that I am running my WAMP se

6条回答
  •  孤城傲影
    2020-12-13 22:44

    This is the solution that worked for me. This works on the latest wampserver. (source: http://www.extradrm.com/blog/?p=1035 )

    1) Download php-gettext from here: https://launchpad.net/php-gettext/+download and unzip it

    2) Add the following files found in the package root in the same folder as test-language.php : - gettext.inc - gettext.php - streams.php

    3) Open your php.ini and comment out wampserver php_gettext.dll:

    ;extension=php_gettext.dll

    4) This is the new test file test-language.php

    
    

    After all of this you must create locale folder, en_US ( or other language ) folder, LC_MESSAGES folder and then put the messages.po file.

提交回复
热议问题