Miscellaneous

Get the current locale code

1
2
3
<?php
echo $locale->getCode();
// 'en_CA'

Get the current language code

1
2
3
<?php
echo $locale->getLanguageCode();
// 'en'

Get the current country code

1
2
3
<?php
echo $locale->getCountryCode();
// 'CA'

Load additional locales

You can load new locale files at any time and from any folders, but existing locale keys will be overwritten. For example, if your initial locale file had a key for TEXT_HOME, additional locales loaded via the load() method with the same key will overwrite the first one.