Chapter 10. Localize the App
This chapter explains how to write a multilingual app. Localization, also known as Internationalization (I18N), takes care that a software application can be adapted and rendered in different languages without changes in the source code. This is particularly important in a web application where users speak different languages.
Yii provides powerful tools to handle this task, choosing from the file or database approach (according to the application's complexity). We will cover the following topics:
Setting the default language
File-based translations
Example – using file-based translation for the entire website
Placeholders formatting
DB-based translations
Example – translating the room's description using DB