Updated i18n to use multiple domains

This commit is contained in:
Duncan Sommerville 2014-11-04 16:57:40 -05:00
parent 057993eeeb
commit 5275669211
5 changed files with 23 additions and 7 deletions

View file

@ -2,6 +2,11 @@
class Application_Model_Locale
{
private static $domains = [
'airtime',
'pro',
];
public static $locales = array(
"en_CA" => "English (Canada)",
"en_GB" => "English (Britain)",
@ -48,10 +53,14 @@ class Application_Model_Locale
Logging::warn("Your system does not have the " . $lang . " locale installed. Run: sudo locale-gen " . $lang);
}
$domain = 'airtime';
bindtextdomain($domain, '../locale');
textdomain($domain);
bind_textdomain_codeset($domain, $codeset);
// We need to run bindtextdomain and bind_textdomain_codeset for each domain we're using.
foreach (self::$domains as $domain) {
bindtextdomain($domain, '../locale');
bind_textdomain_codeset($domain, $codeset);
}
textdomain('airtime');
}
}