[aur-dev] [PATCH] Fix Plural String
Signed-off-by: Safa AlFulaij <safa1996alfulaij@gmail.com> --- web/template/pkgreq_results.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/template/pkgreq_results.php b/web/template/pkgreq_results.php index 24ee877..b27963b 100644 --- a/web/template/pkgreq_results.php +++ b/web/template/pkgreq_results.php @@ -39,7 +39,7 @@ if (!$due) { $time_left = $idle_time - (time() - intval($row['RequestTS'])); if ($time_left > 48 * 3600) { - $time_left_fmt = __("~%d days left", round($time_left / (24 * 3600))); + $time_left_fmt = _n("~%d day left", "~%d days left", round($time_left / (24 * 3600))); } elseif ($time_left > 3600) { $time_left_fmt = _n("~%d hour left", "~%d hours left", round($time_left / 3600)); } else { -- 2.9.0
On Thu, 14 Jul 2016 at 08:52:26, safaalfulaij via aur-dev wrote:
Signed-off-by: Safa AlFulaij <safa1996alfulaij@gmail.com> --- web/template/pkgreq_results.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/web/template/pkgreq_results.php b/web/template/pkgreq_results.php index 24ee877..b27963b 100644 --- a/web/template/pkgreq_results.php +++ b/web/template/pkgreq_results.php @@ -39,7 +39,7 @@ if (!$due) { $time_left = $idle_time - (time() - intval($row['RequestTS'])); if ($time_left > 48 * 3600) { - $time_left_fmt = __("~%d days left", round($time_left / (24 * 3600))); + $time_left_fmt = _n("~%d day left", "~%d days left", round($time_left / (24 * 3600)));
Interesting. The singular case can actually never occur because the if-statement above makes sure that round($time_left / (24 * 3600)) is always at least 2. However, we probably still need to call _n() to get the correct behavior for languages with multiple plural forms, so the patch makes sense. Thanks!
} elseif ($time_left > 3600) { $time_left_fmt = _n("~%d hour left", "~%d hours left", round($time_left / 3600)); } else { -- 2.9.0
participants (2)
-
Lukas Fleischer
-
safaalfulaij