X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FL10n.php;h=2c8a9eef9cd0ef4d14c5013509655ffbe20de8cd;hb=0a4119adaf6294bf43d135a0f435c1dd677c50e0;hp=b27228cf809f66f0a39aa8bd664b35a85d8f719f;hpb=7a2f4dc54ee94d54df46dd3ae6a8b8fa8aa8072e;p=friendica.git diff --git a/src/Core/L10n.php b/src/Core/L10n.php index b27228cf80..2c8a9eef9c 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -4,14 +4,14 @@ */ namespace Friendica\Core; -use Friendica\BaseObject; use Friendica\Core\L10n\L10n as L10nClass; +use Friendica\DI; /** * Provide Language, Translation, and Localization functions to the application * Localization can be referred to by the numeronym L10N (as in: "L", followed by ten more letters, and then "N"). */ -class L10n extends BaseObject +class L10n { /** * Returns the current language code @@ -20,7 +20,7 @@ class L10n extends BaseObject */ public static function getCurrentLang() { - return self::getClass(L10nClass::class)->getCurrentLang(); + return DI::l10n()->getCurrentLang(); } /** @@ -32,11 +32,11 @@ class L10n extends BaseObject */ public static function withLang(string $lang) { - return self::getClass(L10nClass::class)->withLang($lang); + return DI::l10n()->withLang($lang); } /** - * @brief Return the localized version of the provided string with optional string interpolation + * Return the localized version of the provided string with optional string interpolation * * This function takes a english string as parameter, and if a localized version * exists for the current language, substitutes it before performing an eventual @@ -54,11 +54,11 @@ class L10n extends BaseObject */ public static function t($s, ...$vars) { - return self::getClass(L10nClass::class)->t($s, ...$vars); + return DI::l10n()->t($s, ...$vars); } /** - * @brief Return the localized version of a singular/plural string with optional string interpolation + * Return the localized version of a singular/plural string with optional string interpolation * * This function takes two english strings as parameters, singular and plural, as * well as a count. If a localized version exists for the current language, they @@ -79,11 +79,11 @@ class L10n extends BaseObject */ public static function tt(string $singular, string $plural, int $count) { - return self::getClass(L10nClass::class)->tt($singular, $plural, $count); + return DI::l10n()->tt($singular, $plural, $count); } /** - * @brief Return installed languages codes as associative array + * Return installed languages codes as associative array * * Scans the view/lang directory for the existence of "strings.php" files, and * returns an alphabetical list of their folder names (@-char language codes). @@ -99,7 +99,7 @@ class L10n extends BaseObject } /** - * @brief Translate days and months names. + * Translate days and months names. * * @param string $s String with day or month name. * @@ -107,11 +107,11 @@ class L10n extends BaseObject */ public static function getDay($s) { - return self::getClass(L10nClass::class)->getDay($s); + return DI::l10n()->getDay($s); } /** - * @brief Translate short days and months names. + * Translate short days and months names. * * @param string $s String with short day or month name. * @@ -119,7 +119,7 @@ class L10n extends BaseObject */ public static function getDayShort($s) { - return self::getClass(L10nClass::class)->getDayShort($s); + return DI::l10n()->getDayShort($s); } /** @@ -131,6 +131,6 @@ class L10n extends BaseObject */ public static function getPokeVerbs() { - return self::getClass(L10nClass::class)->getPokeVerbs(); + return DI::l10n()->getPokeVerbs(); } }