<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 20 Jun 2013 04:12:39 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[Dev.Umpirsky.com: Use Poedit to Extract Translations from Twig Templates]]></title>
      <guid>http://www.phpdeveloper.org/news/18441</guid>
      <link>http://www.phpdeveloper.org/news/18441</link>
      <description><![CDATA[<p>
In <a href="http://dev.umpirsky.com/use-poedit-to-extract-translations-from-twig-templates/">this new post</a> to the Umpirsky.com development blog, they show you how to use <a href="http://www.poedit.net/">poedit</a> to extract translations from Twig templates.
</p>
<blockquote>
By default, Poedit does not have the ability to parse Twig templates. In Twig documenation there is a simple example which shows how to extract translations. This can work with few modifications, but I wanted to make reusable tool which will allow you to parse Twig templates just like you do with plain PHP templates.
</blockquote>
<p>
The result is the <a href="https://github.com/umpirsky/Twig-Gettext-Extractor">Twig-Gettext-Extractor</a> that's set up inside Poedit as a parser command for "*.twig" files. This automatically extracts the information so that the editor can read the data from the template.
</p>]]></description>
      <pubDate>Tue, 04 Sep 2012 11:34:51 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Localizing PHP Applications "The Right Way", Part 5]]></title>
      <guid>http://www.phpdeveloper.org/news/17172</guid>
      <link>http://www.phpdeveloper.org/news/17172</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the <a href="phpmaster.com/localizing-php-applications-5">fifth part</a> of their "Localizing PHP Applications 'The Right Way'" series, this time with a focus on extracting data from the .pot template files to define in your PHP. (This is the final part of the series.)
</p>
<blockquote>
In <a href="http://phpmaster.com/localizing-php-applications-4">Part 4</a> you learned how to use gettext for one of the most complex aspects of localization a developer can face, plural forms. In this, the final part of the five-part series, I'll teach you how you to automate part of the localization process by extracting msgids and generating a PO template file (.pot) from your application's PHP code.
</blockquote>
<p>
They show how to use the xgettext command-line tool to pull out strings from your source and automatically make them into a domain template. They help you set up three sample PHP files and run the xgettext command on them to pull out messages defined in the text of the files to set up keys in the template. Screenshots are included showing how to use Poedit to use these templates for your new translations.
</p>]]></description>
      <pubDate>Fri, 25 Nov 2011 14:58:09 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Localizing PHP Applications "The Right Way", Part 3]]></title>
      <guid>http://www.phpdeveloper.org/news/17122</guid>
      <link>http://www.phpdeveloper.org/news/17122</link>
      <description><![CDATA[<p>
PHPMaster.com has posted its third part of its "Localizing PHP Applications 'The Right Way'" series. In <a href="http://phpmaster.com/localizing-php-applications-3/">this third part</a> you'll learn more about locales and message domain switching.
</p>
<blockquote>
In <a href="http://phpmaster.com/localizing-php-applications-2">Part 2</a> you gained more insight into using the gettext library by learning the most important functions of the extension. In this part you'll learn how to best use a fallback locale, switch between locales, and override the currently selected message domain.
</blockquote>
<p>
They show you how to set up the directory structure to handle a fallback locale, a choice to use when the system can't determine which to use. By using a default, you also avoid having the system translate from the default language to...the default language (like "English" to "English"). Included are also the code bits you'll need to switch between locales (just using a different domain) and using the <a href="http://php.net/dgettext">dgettext</a> function to specify a different domain than the selected one.
</p>]]></description>
      <pubDate>Mon, 14 Nov 2011 08:38:48 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Localizing PHP Applications "The Right Way", Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/17076</guid>
      <link>http://www.phpdeveloper.org/news/17076</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the <a href="http://phpmaster.com/localizing-php-applications-2">second part</a> of their series about localizing PHP applications "the right way" (hint: it uses <a href="http://php.net/gettext">gettext</a>).
</p>
<blockquote>
Welcome back to this series of articles which teach you how to localize your PHP applications using gettext and its PHP extension. In <a href="http://phpmaster.com/localizing-php-applications-1">Part 1</a> you took your first steps towards towards this by installing gettext and Poedit, creating a translation file, and writing a Hello World script. In this part you'll lean about each of the function used in the script, and dive more into the gettext library and its usage.
</blockquote>
<p>
The explain some of the naming conventions gettext uses for things (like "domains" and "codeset") as well as the shorthand "_()" you can use to retrieve translated values. There's also a look at supporting multiple locales via multiple directories of .po and .mo files.
</p>]]></description>
      <pubDate>Wed, 02 Nov 2011 15:05:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Localizing PHP Applications "The Right Way", Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/17059</guid>
      <link>http://www.phpdeveloper.org/news/17059</link>
      <description><![CDATA[<p>
PHPMaster.com has a new tutorial sharing what they call the <a href="http://phpmaster.com/localizing-php-applications-1">right way for localizing PHP applications</a> with the help of PHP's <a href="http://php.net/gettext">gettext</a> functionality.
</p>
<blockquote>
Localizing software applications in general used to be a cumbersome and error-prone task resulting in a lot of messy code. Some developers even use different versions of code for the same application but for different locales, which makes managing the codebase practically impossible. Enter gettext, the wonderful open-source tool that will make your life easier by allowing you to concentrate on your code. Localization becomes a matter of writing separate translation files for the target language, which can easily be done by a translator using Poedit.
</blockquote>
<p>
They help you get your environment set up - PHP and a href="http://poedit.net/">Poedit</a>, a gettext catalog editor - for both linux- and Windows-based OSes. They walk you through the creation of a simple project and a few basic "hello world" tokens. Using the files is as easy as setting the correct locale and default domain for your application. Then output is just a basic echo away.
</p>]]></description>
      <pubDate>Mon, 31 Oct 2011 08:38:25 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[CodeForest.net: Multilanguage support in Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/16821</guid>
      <link>http://www.phpdeveloper.org/news/16821</link>
      <description><![CDATA[<p>
In a new post over on CodeForest.net there's a guide from <i>Zvonko Biskup</i> about using the <a href="http://www.codeforest.net/multilanguage-support-in-zend-framework">multi-language support in the Zend Framework</a>, specifically implementing gettext support.
</p>
<blockquote>
We can not imagine a modern web application without a multi language support. I will show you how easy it is to setup usage of multiple languages in Zend Framework and how to setup some basic language routes (handy for SEO stuff). The Zend Framework offers many ways for you to store your translated strings. It could be an array, a CSV or XML file or you could use gettext which we will be using today.
</blockquote>
<p>
He introduces the topic by answering the question "why gettext?" with two reasons - the simplicity of editing the gettext files and the fact that Apache caches the resulting ".mo" files. He includes the code to set up a Zend_Translate object in your bootstrap and calling the "translate()" method in your views to handle the hard work. He briefly touches on using <a href="http://www.poedit.net/">PoEdit</a> to work with the gettext files and how to drop those into your ZF application's structure to make them available. Finally, he sets up some automatic routing you can easily use to switch languages based on something like a cookie or session value.
</p>]]></description>
      <pubDate>Tue, 06 Sep 2011 12:27:40 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Bertrand Mansion's Blog: PHP with Itnl and Gettext on OSX Lion]]></title>
      <guid>http://www.phpdeveloper.org/news/16694</guid>
      <link>http://www.phpdeveloper.org/news/16694</link>
      <description><![CDATA[<p>
<i>Bertrand Mansion</i> has a recent post to his blog looking at repairing missing functionality in the latest OS X update (Lion) with <a href="http://mansion.im/2011/php-with-intl-and-gettext-on-osx-lion/">the intl extension and gettext</a> (not installed by default).
</p>
<blockquote>
Mac OSX Lion ships with PHP 5.3.6. [...] These are all very good solutions, but since I prefer to travel light and the version in Lion already comes with a lot of useful extensions, I preferred to go with it.
</blockquote>
<p>
He shows how to update the default Lion PHP install to include some of the things he needed for his development including:
</p>
<ul>
<li>setting up the php.ini file
<li>installing PEAR/PECL
<li>installing the <a href="http://www.php.net/manual/fr/book.intl.php">intl extension</a>
<li>and a hack to get <a href="http://ftp.gnu.org/gnu/gettext/">gettext</a> working (renaming a base function)
</ul>]]></description>
      <pubDate>Tue, 09 Aug 2011 11:40:11 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Zend Developer Zone: Creating Multi-Language Web Applications with Zend_Translate]]></title>
      <guid>http://www.phpdeveloper.org/news/15887</guid>
      <link>http://www.phpdeveloper.org/news/15887</link>
      <description><![CDATA[<p>
On the Zend Developer Zone today there's <a href="http://devzone.zend.com/article/12995-Creating-Multi-Language-Web-Applications-with-Zend_Translate">a new tutorial</a> they've posted looking at adding multi-language support to your applications with the help of the Zend_Translate component of the <a href="http://framework.zend.com">Zend Framework</a>. It makes it simple to swap between sets of language data without much effort on your part.
</p>
<blockquote>
If you're a Web developer building an application for global consumption, it's important for you to build in a framework for multi-language support right from the start. Fortunately, there are a number of ready-made components that can help with this task. This article will introduce you to one such component, Zend_Translate, and demonstrate how you can use it to add multi-language support to your PHP application.
</blockquote>
<p>
There's no "magic bullet" here that'll do the translation for you, but he shows you how to set up the data for the different languages, either in PHP arrays or in translation files, that the Zend_Translate component knows how to use. He also mentions the component's ability to scan a directory tree for language files an detect the language based on a naming convention. He also mentions the "gettext" tool that you can use to generate language files based on a standard GNU format that can be used cross-language with several different tools.
</p>
<p>
There's lots of other handy bits in <a href="http://devzone.zend.com/article/12995-Creating-Multi-Language-Web-Applications-with-Zend_Translate">the tutorial</a> so I suggest reading if you're thinking about any kind of translation for your site.
</p>]]></description>
      <pubDate>Thu, 10 Feb 2011 12:03:29 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[Reddit.com: What are the most popular (or best) methods to translate a PHP-built website?]]></title>
      <guid>http://www.phpdeveloper.org/news/15657</guid>
      <link>http://www.phpdeveloper.org/news/15657</link>
      <description><![CDATA[<p>
In <a href="http://www.reddit.com/r/PHP/comments/etd8d/what_are_the_most_popular_or_best_methods_to/">this new post</a> from Reddit.com a question is asked about website translations and the opinions on best practices for it.
</p>
<blockquote>
I'm just curious what the best practices are for translating your website into another language, to present foreign readers with text in their home lingua -- well, particularly if there are PHP-specific methods to do so. I've stumbled across the pages for GNU gettext and that seems interesting, but I'm curious what people think of it.
</blockquote>
<p>
Suggestions include manual translation via a human, use a text substitution method two swap out content versions based on language, using language files (and some opinions from others on which of these approaches might work best).
</p>]]></description>
      <pubDate>Thu, 30 Dec 2010 10:42:28 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[CodeForest.net: Translate and Localize your web application with PHP and gettext ]]></title>
      <guid>http://www.phpdeveloper.org/news/15237</guid>
      <link>http://www.phpdeveloper.org/news/15237</link>
      <description><![CDATA[<p>
On CodeForest today there's <a href="http://www.codeforest.net/translate-and-localize-your-web-application-with-php-and-gettext">a new tutorial</a> showing you how to localize your application with the help of the <a href="http://php.net/gettext">gettext</a> functionality PHP offers or just simple arrays.
</p>
<blockquote>
Wikipedia says: Localization is the process of translating a product into different languages or adapting a language for a specific country or region. There are several techniques that developer can use to localize an application. The most common ones are using arrays and gettext. I will try to explain both and how to use them.
</blockquote>
<p>
They provide code examples for each method - arrays containing literal strings matching one-for-one with their English counterparts and the gettext method where language files are created and handled outside of the codebase. Gettext does require support to be <a href="http://www.php.net/manual/en/gettext.installation.php">loading into your installation</a> (might not be by default).
</p>]]></description>
      <pubDate>Wed, 06 Oct 2010 10:45:29 -0500</pubDate>
    </item>
  </channel>
</rss>
