Upgrade to 3.6.0

This commit is contained in:
Bastian Allgeier
2021-11-16 14:53:37 +01:00
parent 7388fa4d24
commit 92b7a330fa
318 changed files with 20017 additions and 6878 deletions

View File

@@ -26,7 +26,7 @@ class I18n
/**
* Current locale
*
* @var string
* @var string|\Closure
*/
public static $locale = 'en';
@@ -41,7 +41,7 @@ class I18n
* The fallback locale or a
* list of fallback locales
*
* @var string|array
* @var string|array|\Closure
*/
public static $fallback = ['en'];
@@ -56,14 +56,16 @@ class I18n
* Returns the first fallback locale
*
* @deprecated 3.5.1 Use `\Kirby\Toolkit\I18n::fallbacks()` instead
* @todo Add deprecated() helper warning in 3.6.0
* @todo Remove in 3.7.0
*
* @return string
*/
public static function fallback(): string
{
// @codeCoverageIgnoreStart
deprecated('I18n::fallback() has been deprecated. Use I18n::fallbacks() instead.');
return static::fallbacks()[0];
// @codeCoverageIgnoreEnd
}
/**
@@ -205,7 +207,11 @@ class I18n
}
$template = static::translate($key, $fallback, $locale);
return Str::template($template, $replace, '-', '{', '}');
return Str::template($template, $replace, [
'fallback' => '-',
'start' => '{',
'end' => '}'
]);
}
/**
@@ -271,7 +277,7 @@ class I18n
*
* @param string $key
* @param int $count
* @param string $locale
* @param string|null $locale
* @param bool $formatNumber If set to `false`, the count is not formatted
* @return mixed
*/