Jump to content

gettext


Locked

Recommended Posts

For a few days now iv been trying to use gettext to translate strings but im doing somthing wrong. I used Poedit to make the files.

 

MO File:

Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Poedit-Language: French
X-Poedit-Country: FRANCE
X-Poedit-SourceCharset: utf-8
X-Poedit-Basepath: C:\Users\Arek\Desktop\xampp\htdocs\
X-Poedit-SearchPath-0: .
Another!

 

Php code:

$language = 'fr';
putenv("LANG=$language"); 
setlocale(LC_ALL, $language);
$domain = 'messages';
bindtextdomain($domain, '/htdocs/languages/locale'); 
textdomain($domain);
echo gettext("OMG");

 

Folders:

C:\Users\Arek\Desktop\xampp\htdocs\languages\locale\fr\LC_MESSAGES\messages.po

 

Also the php page is called from  \htdocs\class\ would that matter?

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/185480-gettext/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.