From fddfd816a76e231ee02ec7fa58894e9e675f5021 Mon Sep 17 00:00:00 2001 From: rub Date: Wed, 6 Dec 2006 23:56:24 +0000 Subject: Proposition of translations about: A recent picture is a last picture but a last picture is not a recent picture. A recent category is a last category but a last category is not a recent category. So it's a proposition about last is not like recent. Improvement of string including decimal number in order to concord singular and plural. Now, function l10n_dec must be used. git-svn-id: http://piwigo.org/svn/trunk@1637 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/functions.inc.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include/functions.inc.php') diff --git a/include/functions.inc.php b/include/functions.inc.php index 537edc32a..bfa7ad28f 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -934,6 +934,21 @@ function l10n($key) return isset($lang[$key]) ? $lang[$key] : $key; } +/** + * returns the prinft value for strings including %d + * return is concorded with decimal value (singular, plural) + * + * @param singular string key + * @param plural string key + * @param decimal value + * @return string + */ +function l10n_dec($singular_fmt_key, $plural_fmt_key, $decimal) +{ + return sprintf(l10n(($decimal > 1 ? $plural_fmt_key : + $singular_fmt_key)), $decimal); +} + /** * Translate string in string ascii7bits * It's possible to do that with iconv_substr -- cgit v1.2.3