Format code using php-cs-fixer

This commit is contained in:
jo 2021-10-11 16:10:47 +02:00
parent 43d7dc92cd
commit d52c6184b9
352 changed files with 17473 additions and 17041 deletions

View file

@ -2,34 +2,34 @@
final class Application_Model_Locale
{
private static $domains = array(
'airtime',
private static $domains = [
'airtime',
'pro',
);
public static $locales = array(
"en_CA" => "English (Canada)",
"en_GB" => "English (Britain)",
"en_US" => "English (USA)",
"cs_CZ" => "Český",
"de_DE" => "Deutsch",
"de_AT" => "Deutsch (Österreich)",
"el_GR" => "Ελληνικά",
"es_ES" => "Español",
"fr_FR" => "Français",
"hr_HR" => "Hrvatski",
"hu_HU" => "Magyar",
"it_IT" => "Italiano",
"ja_JP" => "日本語",
"ko_KR" => "한국어",
"pl_PL" => "Polski",
"pt_BR" => "Português (Brasil)",
"ru_RU" => "Русский",
"sr_RS" => "Српски (Ћирилица)",
"sr_RS@latin" => "Srpski (Latinica)",
"zh_CN" => "简体中文"
);
];
public static $locales = [
'en_CA' => 'English (Canada)',
'en_GB' => 'English (Britain)',
'en_US' => 'English (USA)',
'cs_CZ' => 'Český',
'de_DE' => 'Deutsch',
'de_AT' => 'Deutsch (Österreich)',
'el_GR' => 'Ελληνικά',
'es_ES' => 'Español',
'fr_FR' => 'Français',
'hr_HR' => 'Hrvatski',
'hu_HU' => 'Magyar',
'it_IT' => 'Italiano',
'ja_JP' => '日本語',
'ko_KR' => '한국어',
'pl_PL' => 'Polski',
'pt_BR' => 'Português (Brasil)',
'ru_RU' => 'Русский',
'sr_RS' => 'Српски (Ћирилица)',
'sr_RS@latin' => 'Srpski (Latinica)',
'zh_CN' => '简体中文',
];
public static function getLocales()
{
return self::$locales;
@ -39,45 +39,43 @@ final class Application_Model_Locale
{
$codeset = 'UTF-8';
if (is_null($locale)) {
$lang = Application_Model_Preference::GetLocale().'.'.$codeset;
$lang = Application_Model_Preference::GetLocale() . '.' . $codeset;
} else {
$lang = $locale.'.'.$codeset;
$lang = $locale . '.' . $codeset;
}
//putenv("LC_ALL=$lang");
//putenv("LANG=$lang");
//Setting the LANGUAGE env var supposedly lets gettext search inside our locale dir even if the system
//Setting the LANGUAGE env var supposedly lets gettext search inside our locale dir even if the system
//doesn't have the particular locale that we want installed. This doesn't actually seem to work though. -- Albert
putenv("LANGUAGE=$locale");
if (setlocale(LC_MESSAGES, $lang) === false)
{
Logging::warn("Your system does not have the " . $lang . " locale installed. Run: sudo locale-gen " . $lang);
putenv("LANGUAGE={$locale}");
if (setlocale(LC_MESSAGES, $lang) === false) {
Logging::warn('Your system does not have the ' . $lang . ' locale installed. Run: sudo locale-gen ' . $lang);
}
// 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');
}
/**
* We need this function for the case where a user has logged out, but
* We need this function for the case where a user has logged out, but
* has an airtime_locale cookie containing their locale setting.
*
* If the user does not have an airtime_locale cookie set, we default
*
* If the user does not have an airtime_locale cookie set, we default
* to the station locale.
*
* When the user logs in, the value set in the login form will be passed
* into the airtime_locale cookie. This cookie is also updated when
*
* When the user logs in, the value set in the login form will be passed
* into the airtime_locale cookie. This cookie is also updated when
* a user updates their user settings.
*/
public static function getUserLocale() {
public static function getUserLocale()
{
$request = Zend_Controller_Front::getInstance()->getRequest();
$locale = $request->getCookie('airtime_locale', Application_Model_Preference::GetLocale());
return $locale;
return $request->getCookie('airtime_locale', Application_Model_Preference::GetLocale());
}
}