Chapter 9. Internationalizing Applications

In this chapter, we will cover:

  • Internationalizing controller and view texts
  • Internationalizing model validation messages
  • Translating strings with dynamic content
  • Extracting and translating text
  • Translating database records with the Translate behavior
  • Setting and remembering the language

Introduction

This chapter includes a set of recipes that allow the reader to internationalize all aspects of their CakePHP applications, including static content, such as those available in views, and dynamic content, such as database records.

The first two recipes show how to allow text that is part of any CakePHP view or model validation messages to be ready for translation. The third recipe shows how to translate more complex expressions. The fourth recipe shows how to run CakePHP's built-in tools to extract all static content that needs translation, and then translate that content to different languages. The fifth recipe shows how to translate database records. Finally, the last recipe shows how to allow users to change the current application language.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.35.255