<?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, 23 May 2013 21:06:38 -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: In My Language, Please! - Translating WordPress Themes and Plugins]]></title>
      <guid>http://www.phpdeveloper.org/news/17852</guid>
      <link>http://www.phpdeveloper.org/news/17852</link>
      <description><![CDATA[<p>
On PHPMaster.com there's a new tutorial showing how to <a href="http://phpmaster.com/in-my-language-please/">use the localization support</a> that comes with WordPress to make using different language definitions much simpler.
</p>
<blockquote>
WordPress itself is translated to many languages and people can use it in their preferred language. But this is not the case with themes, plugins, and other front-end customizations. [...] The purpose of this article is to show you how to translate properly any theme or plugin by using internationalization and localization methods. In brief, internationalization (i18n) deals with making sure strings of text are wrapped in specific function calls. 
</blockquote>
<p>
He starts by introducing the PHP functions (and configuration) you'll need to get the localization support up and running in your plugin, including a few examples of how to translate a string. Also included into the post is an introduction to using the <a href="http://www.poedit.net/">Poedit</a> software to create the different translation files.
</p>]]></description>
      <pubDate>Mon, 23 Apr 2012 12:27:36 -0500</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>
  </channel>
</rss>
