X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FL10n.php;h=215c6f6fb11c1c9a682a22c473d4618a145fecdd;hb=630cdaeb9683cd71686adf79bca8cde4bb81975d;hp=be19d546d08886bffeb0674ffdbef25baeb42ce6;hpb=7158aa7ded17a3bb563cb44d4597524bab8caa22;p=friendica.git diff --git a/src/Core/L10n.php b/src/Core/L10n.php index be19d546d0..215c6f6fb1 100644 --- a/src/Core/L10n.php +++ b/src/Core/L10n.php @@ -115,12 +115,12 @@ class L10n while ($p = dba::fetch($addons)) { $name = $p['name']; if (file_exists("addon/$name/lang/$lang/strings.php")) { - include("addon/$name/lang/$lang/strings.php"); + include "addon/$name/lang/$lang/strings.php"; } } if (file_exists("view/lang/$lang/strings.php")) { - include("view/lang/$lang/strings.php"); + include "view/lang/$lang/strings.php"; } } @@ -132,9 +132,9 @@ class L10n * string interpolation (sprintf) with additional optional arguments. * * Usages: - * - t('This is an example') - * - t('URL %s returned no result', $url) - * - t('Current version: %s, new version: %s', $current_version, $new_version) + * - L10n::t('This is an example') + * - L10n::t('URL %s returned no result', $url) + * - L10n::t('Current version: %s, new version: %s', $current_version, $new_version) * * @param string $s * @return string @@ -165,8 +165,8 @@ class L10n * is performed using the count as parameter. * * Usages: - * - tt('Like', 'Likes', $count) - * - tt("%s user deleted", "%s users deleted", count($users)) + * - L10n::tt('Like', 'Likes', $count) + * - L10n::tt("%s user deleted", "%s users deleted", count($users)) * * @global type $lang * @param string $singular @@ -184,9 +184,10 @@ class L10n if (is_array($t)) { $plural_function = 'string_plural_select_' . str_replace('-', '_', $lang); if (function_exists($plural_function)) { - $plural_function = 'stringPluralSelectDefault'; + $i = $plural_function($count); + } else { + $i = self::stringPluralSelectDefault($count); } - $i = $plural_function($count); $s = $t[$i]; } else { $s = $t;