News Feed
Sections




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

CodeForest.net:
Multilanguage support in Zend Framework
September 06, 2011 @ 12:27:40

In a new post over on CodeForest.net there's a guide from Zvonko Biskup about using the multi-language support in the Zend Framework, specifically implementing gettext support.

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.

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 PoEdit 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.

0 comments voice your opinion now!
multilanguage zendframework gettext poedit tutorial


blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: An Example Zend Framework Blog App - Part 3: A Simple Hello World Tutorial

PHP-Coding-Practices.com: How To Generate Monochromatic CSS Stylesheets Within Seconds Using PHP

DeveloperTutorials.com: PHP Site Search Made Easy

PHPFreaks.com: Template based document generation using LiveDocx and Zend Framework

PHPBuilder.com: Loops & Decisions in PHP - The ABC's of PHP Part 8


Community Events

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


language release application podcast framework performance php7 community opinion example interview part2 conference laravel series symfony2 voicesoftheelephpant introduction api configure

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