diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2018-10-18 23:34:18 +0200 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2018-10-30 22:50:22 +0100 |
commit | b443b53919f50bd0176e7b67dfd1efc28276a770 (patch) | |
tree | df4d089d9d431f5223a71e6b40f9d87361705929 /src/helpers.php | |
parent | 90e1a949623ead173c0952f802d7b5c5487251b1 (diff) |
Translation: added pluralization support
Diffstat (limited to 'src/helpers.php')
-rw-r--r-- | src/helpers.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/helpers.php b/src/helpers.php index 84f26dfa..64ca9ec8 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -154,6 +154,23 @@ function __($key, $replace = []) } /** + * Translate the given message + * + * @param string $key + * @param string $keyPlural + * @param int $number + * @param array $replace + * @return string + */ +function _e($key, $keyPlural, $number, $replace = []) +{ + /** @var Translator $translator */ + $translator = app('translator'); + + return $translator->translatePlural($key, $keyPlural, $number, $replace); +} + +/** * @param string $path * @param array $parameters * @return UrlGeneratorInterface|string |