aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-12-06 23:56:24 +0000
committerrub <rub@piwigo.org>2006-12-06 23:56:24 +0000
commitfddfd816a76e231ee02ec7fa58894e9e675f5021 (patch)
tree63c83e2e01d715347ad29f89a40e8bb094679403 /include/functions.inc.php
parentf880be0609a63046c2f8fe961467f97a8a943f10 (diff)
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
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php15
1 files changed, 15 insertions, 0 deletions
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
@@ -935,6 +935,21 @@ function l10n($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
* but this fonction is not avaible on all the providers.