Need a PHP Gettext example to work with

Discussion in 'General Programming Chat' started by Jesperj, Dec 13, 2013.

  1. Jesperj

    Jesperj Power Member

    Sep 10, 2010
    Likes Received:
    Web Designer
    Far, Far away
    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:

    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
  2. mypmmail

    mypmmail Junior Member

    Jan 31, 2008
    Likes Received:
    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

    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