From 7df8c26d253e6360d1c7a81f3e1ece69eb51ccdb Mon Sep 17 00:00:00 2001 From: Michal Date: Tue, 23 Jan 2018 15:32:08 +0100 Subject: [PATCH] added information about parameters in pluralization strings --- localization.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/localization.md b/localization.md index 86ce303233b..342a3a2aac5 100644 --- a/localization.md +++ b/localization.md @@ -137,6 +137,14 @@ After defining a translation string that has pluralization options, you may use echo trans_choice('messages.apples', 10); +You may also define parameters in translation string: + + 'minutes_ago' => '{1} :value minute ago|[2,*] :value minutes ago', + +Array of replacements should be passed as third argument of `trans_choice` function: + + echo trans_choice('time.minutes_ago', 5, ['value' => 5]); + ## Overriding Package Language Files