O'Reilly logo

CakePHP 2 Application Cookbook by Jorge González, James Watts

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the I18n shell

CakePHP provides a powerful console shell to help you in the first steps of internationalizing your application. Addressing i18N is not an easy task, as there are many details to consider, such as dates and times, number and currency formats, dynamic content translation, and distinct dialects.

In this recipe, we're going to use the CakePHP I18n shell to prepare our application for translations with a simple flash message example.

Getting ready

First, we'll define a base language for our application. For this, we'll assume the base language will be English. All of your static content will then be displayed using any of the __() functions.

We'll assume you have the gifts and recipients tables created from our previous recipes, but ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required