Selecting the Locale
Learn to add the support of multiple languages.
We'll cover the following...
Configuration for locale
Creating a new configuration file that encapsulates our knowledge of what locales are available and which one is to be used as the default:
This code is doing two things.
The first thing it does is use the I18n module to set the default locale. Certainly, I18n is a funny name, but it sure beats typing out “internationalization” all the time. Internationalization, after all, starts with an i, ends with an n, and has eighteen letters in between.
Then the code defines a list of associations between display names and locale names. Unfortunately, all we have available at the moment is a U.S. keyboard, and Spanish , for example, has a character that can’t be directly entered via our keyboard. Different operating systems have ...