Step 1:
Create a separate Locale directory
src\Locale
.
Step 2:
Create subdirectory for each language under the directory src\Locale. The name
of the subdirectory can be two letter ISO code of the language or full locale name like
en_US, fr_FR etc.
Step 3:
Create separate
default.po
file under each language subdirectory. This file
contains entry in the form of
msgid
and
msgstr
as shown in the following program.
msgid "msg"
msgstr "CakePHP Internationalization example."
Here, the
msgid
is the key which will be used in the View template file and
msgstr
is the
value which stores the translation.
Step 4:
In the View template file, we can use the above
msgid
as shown below which will
be translated based on the set value of locale.
The default locale can be set in the
Do'stlaringiz bilan baham: |