Need a PHP Gettext example to work with

Jesperj

Power Member
Joined
Sep 10, 2010
Messages
502
Reaction score
355
Hi guys

Im trying to set up a basic test site to play with these GETTEXT translation method. I already used POEDIT with wordpress translations, and i like how easy it is to translate. So in order to add this to my own websites i create, i will need to learn how to use it.


Ive tried following this: http://www.yourhowto.net/build-multilanguage-websites-with-gettext/


But its not working, i have it displaying the text strings, ive created the .po and .mo files succesfully and it reads my strings, but i just dont know how to define those top variables, textdomain, domain and bindtextdomain etc.


Hopefully some of you can help? i dont mind paying $10-20 or something for a working example that can show me how i do.

Thanks in advance
 
I think the $domain should remain as 'messages'

Only the $bindtextdomain should be change to where your local files are located.
For most hosting, it should looks something like
/home/yourusername/public_html/locale

If you do not know your hosting directory, just create a new php file with the following 1 line content
<? phpinfo() ?>
You should see your document_root

HTH
 
Back
Top