Fixed codestyle

This commit is contained in:
Michael 2025-04-15 02:09:19 +00:00
parent e7bd6e7663
commit cc4ff9584f

View file

@ -51,7 +51,7 @@ class L10n
'zh-cn' => '简体中文', 'zh-cn' => '简体中文',
]; ];
CONST LANG_PARENTS = [ const LANG_PARENTS = [
'en-gb' => 'en', 'da-dk' => 'da', 'fi-fi' => 'fi', 'en-gb' => 'en', 'da-dk' => 'da', 'fi-fi' => 'fi',
'nb-no' => 'nb', 'pt-br' => 'pt', 'zh-cn' => 'zh' 'nb-no' => 'nb', 'pt-br' => 'pt', 'zh-cn' => 'zh'
]; ];
@ -427,8 +427,10 @@ class L10n
]; ];
if (in_array('cld2', get_loaded_extensions())) { if (in_array('cld2', get_loaded_extensions())) {
$additional_langs = array_merge($additional_langs, $additional_langs = array_merge(
['dv', 'kn', 'lo', 'ml', 'or', 'pa', 'sd', 'si', 'te', 'yi']); $additional_langs,
['dv', 'kn', 'lo', 'ml', 'or', 'pa', 'sd', 'si', 'te', 'yi']
);
} }
$langs = array_merge($additional_langs, array_keys($this->getAvailableLanguages())); $langs = array_merge($additional_langs, array_keys($this->getAvailableLanguages()));
@ -444,7 +446,7 @@ class L10n
*/ */
public function getLanguageCodes(bool $international = false): array public function getLanguageCodes(bool $international = false): array
{ {
$iso639 = new \Matriphe\ISO639\ISO639; $iso639 = new \Matriphe\ISO639\ISO639();
// In ISO 639-2 undetermined languages have got the code "und". // In ISO 639-2 undetermined languages have got the code "und".
// There is no official code for ISO 639-1, but "un" is not assigned to any language. // There is no official code for ISO 639-1, but "un" is not assigned to any language.
@ -502,13 +504,17 @@ class L10n
*/ */
public function getDay(string $s): string public function getDay(string $s): string
{ {
$ret = str_replace(['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'], $ret = str_replace(
['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'],
[$this->t('Monday'), $this->t('Tuesday'), $this->t('Wednesday'), $this->t('Thursday'), $this->t('Friday'), $this->t('Saturday'), $this->t('Sunday')], [$this->t('Monday'), $this->t('Tuesday'), $this->t('Wednesday'), $this->t('Thursday'), $this->t('Friday'), $this->t('Saturday'), $this->t('Sunday')],
$s); $s
);
$ret = str_replace(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], $ret = str_replace(
['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
[$this->t('January'), $this->t('February'), $this->t('March'), $this->t('April'), $this->t('May'), $this->t('June'), $this->t('July'), $this->t('August'), $this->t('September'), $this->t('October'), $this->t('November'), $this->t('December')], [$this->t('January'), $this->t('February'), $this->t('March'), $this->t('April'), $this->t('May'), $this->t('June'), $this->t('July'), $this->t('August'), $this->t('September'), $this->t('October'), $this->t('November'), $this->t('December')],
$ret); $ret
);
return $ret; return $ret;
} }
@ -521,13 +527,17 @@ class L10n
*/ */
public function getDayShort(string $s): string public function getDayShort(string $s): string
{ {
$ret = str_replace(['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], $ret = str_replace(
['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
[$this->t('Mon'), $this->t('Tue'), $this->t('Wed'), $this->t('Thu'), $this->t('Fri'), $this->t('Sat'), $this->t('Sun')], [$this->t('Mon'), $this->t('Tue'), $this->t('Wed'), $this->t('Thu'), $this->t('Fri'), $this->t('Sat'), $this->t('Sun')],
$s); $s
);
$ret = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], $ret = str_replace(
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
[$this->t('Jan'), $this->t('Feb'), $this->t('Mar'), $this->t('Apr'), $this->t('May'), $this->t('Jun'), $this->t('Jul'), $this->t('Aug'), $this->t('Sep'), $this->t('Oct'), $this->t('Nov'), $this->t('Dec')], [$this->t('Jan'), $this->t('Feb'), $this->t('Mar'), $this->t('Apr'), $this->t('May'), $this->t('Jun'), $this->t('Jul'), $this->t('Aug'), $this->t('Sep'), $this->t('Oct'), $this->t('Nov'), $this->t('Dec')],
$ret); $ret
);
return $ret; return $ret;
} }