News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Localizing PHP Applications "The Right Way", Part 4
November 21, 2011 @ 10:58:31

In the latest installment of their "Localizing PHP Applications 'The Right Way'" tutorial series (part four), they show off a feature of gettext that makes it simpler to deal with singular versus plural versions of your translations.

In Part 3 you learned some of the more important aspects of real-world localizing your application, such as using a default fallback locale and separating messages into multiple domain files depending on their usage. In this part I'll show you what is arguably the most powerful feature of gettext - handling plural forms. The plural forms feature of gettext you enable you to localize your application perfectly and professionally.

The simple example they give is the difference between things like "1 file" versus "2 files". English is simpler than some other languages but gettext has special handling you can add to your translation files to help. A rule placed at the top of your file defines where to start the singular vs plural switch.

0 comments voice your opinion now!
localize application plural singular


blog comments powered by Disqus

Similar Posts

Maarten Balliauw's Blog: Scaffolding and packaging a Windows Azure project in PHP

Developer.com: Build Your First PHP for Android Application

PHPImpact Blog: Building Web Applications Using PHP and Java

Niall Kennedy's Blog: Rasmus Lerdorf on scaling web apps with PHP

Slawek's Blog: Efficient file serving in PHP application with nginx


Community Events





Don't see your event here?
Let us know!


code podcast list laravel developer threedevsandamaybe configure series release wordpress bugfix community language install unittest introduction library application interview api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework