Inconsistent? In the chapter about translate behaviour in the CakePHP 3 book there are three-letter codes used, derived from English names rather than native names of language like ISO 639-2:
eng (english)
spa (spanish)
with this example to change the language:
I18n::locale('spa');
But in the chapter about Internationalization and Localization it says
Translation folders can either be the two letter ISO code of the language or the full locale name such as fr_FR, es_AR, da_DK which contains both the language and the country where it is spoken.
And the example to change the language looks like this:
use Cake\I18n\I18n;
I18n::locale('de_DE');
So is the chapter about the translate behaviour
outdated or are all methods correct? I think it's probably better to be consistent and use the same language codes in both, Translate behaviour
and Internationalization and Localization
?
Also the i18n schema table example defines the field locale
as varchar(6)
... if 3-letter-code is required varchar(3)
should be enough... But even if I use full local codes like fr_FR
varchar(5) would be enough. Why is the example schema using varchar(6)
?
es-419
– AD7six