PHP Gettext Internationalization Primer Tutorial

PHP Gettext Internationalization Primer Tutorial

PHP Gettext Internationalization Primer Tutorial

Our (Mac OS X laptop) local MAMP web server is an Apache/PHP/MySql web server. In this environment you can find out a lot with some PHP code as per …

<?php phpinfo(); ?>

… and if, in doing this, you find a reference to the “gettext” Human Language and Character Encoding Support functionality existing, you are a lucky candidate to introduce some language translation internationalization logic to your PHP code.

We followed a lot of the advice of the very useful link (thanks) to create two pieces of PHP called …

… that combined, along with the installation of the Poedit (for our Mac laptop) application that you can use to create (or clone, like we did with an existant WordPress *.po file) the ascii *.po files that get “compiled” into *.mo files facilitating the translation pairs used to map words from the local language to the language you translate to … in our case de_DE (German for Germany), as per (the incomplete) messages.po.

Lo and behold our word “Home” (in get_text.php) got translated to “Startseite” (as the best suggestion by “Poedit”) via the *.po excerpt …


# ...
#: wp-includes/post-template.php:1148
msgid "Home"
msgstr "Startseite"
# ...

… so that, with this thinking under your belt, you can concentrate on translations and *.po editing via “Poedit” to create internationalization functionality for your PHP websites. Sounds great to me, and if you haven’t clicked the picture above here to view the tutorial slides go for it here!

If this was interesting you may be interested in this too.

This entry was posted in eLearning, Operating System, Tutorials and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

15 Responses to PHP Gettext Internationalization Primer Tutorial

  1. Hi to all, it’s truly a fastidious for me to pay a quick visit this web page, it
    consists of important Information.

  2. You ought to take part in a contest for one
    of the greatest websites on the web. I am going to highly recommend this web site!

  3. If you desire to obtain a good deal from this piece of writing then you have to apply these strategies to your won webpage.

  4. Undeniably believe that that you stated. Your favourite reason appeared
    to be on the net the easiest thing to have in mind of.

    I say to you, I certainly get irked even as people consider concerns that they plainly do
    not know about. You managed to hit the nail upon the highest as smartly as
    defined out the whole thing without having side-effects ,
    folks can take a signal. Will probably be back to get
    more. Thanks

  5. guys hoodies says:

    Asking questions are actually good thing if you are not
    understanding anything entirely, however this article offers nice understanding
    yet.

  6. If you are going for most excellent contents like myself,
    simply go to see this site every day for the reason that it presents feature contents,
    thanks

  7. This piece of writing is in fact a pleasant one it helps new net users, who are wishing
    for blogging.

  8. You produced some decent points there. I looked online for your issue and located many people will go together with with the web site.

  9. Excellent weblog here! Also your site loads up rapidly! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

  10. IÒ€ℒm impressed, I should say. Really rarely can i encounter a blog thatÒ€ℒs both educative and entertaining, and let me tell you, you could have hit the nail to the head. Your concept is outstanding; the thing is an issue that inadequate consumers are speaking intelligently about. WeÒ€ℒre quite happy which i came across this inside my search for something concerning this.

  11. Thats deninitely accurate what you’ve got said. I agree with what you’ve stated. You produced the points looks easy, thats what all of us are expecting. Will be subscribing your feeds. do preserve updating with such topics.

  12. Needed to put you a very little observation to be able to give thanks as before just for the magnificent ideas you’ve shared on this site. It’s really extremely open-handed of you to make openly all that many of us could have distributed as an electronic book to earn some money for their own end, especially considering the fact that you could possibly have done it in the event you desired. Those basics in addition served to be the easy way to recognize that other people online have similar eagerness like my very own to learn somewhat more with reference to this problem. Certainly there are millions of more pleasant sessions ahead for those who examine your website.

  13. You can certainly see your enthusiasm within the paintings you write. The sector hopes for even more passionate writers such as you who are not afraid to say how they believe. All the time go after your heart. “Man is the measure of all things.” by Protagoras.

  14. Moises Baatz says:

    Thank you for sharing excellent informations. Your website is so cool. I am impressed by the details that you’ve on this web site. It reveals how nicely you understand this subject. Bookmarked this web page, will come back for more articles. You, my friend, ROCK! I found just the info I already searched all over the place and simply couldn’t come across. What an ideal site.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>