infotechnohelp / cakephp-languages
Plugin for CakePHP 3
1.7.6
2019-03-19 12:56 UTC
Requires
- cakephp/cakephp: ^3.4
- vlucas/phpdotenv: ^2.4
Requires (Dev)
- doctrine/instantiator: 1.0.*
- phpunit/phpunit: ^5.7|^6.0
- squizlabs/php_codesniffer: ^3.2
README
- Create JS locale files in
webroot/js/Locale/en_US.js
Terminal: bin/cake locale js
(All files) || bin/cake locale js en_US
(Concrete language)
- LocaleManager
src/Locale
contains et_EE
, en_US
is a default locale
LocaleManager::getLanguageCodes()
=> ['en_US', 'et_EE']
LocaleManager::getLanguageLabels()
=> ['ENG', 'EST']
LocaleManager::getLanguageLabels(['en_US' => 'US'])
=> ['US', 'EST']
- LanguagesComponent
$controller->loadComponent('Languages.Languages')
sets cookie language
and I18n locale
Set language cookie and I18n locale with GET query parameter lang=en_US
or writing directly to Cookie.language