Miscellaneous

Get the current locale code

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

Get the current language code

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

Get the current country code

<?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.

<?php

$locale->load('/path/to/locales');
$locale->load('/path/to/morelocales');