Handle plurals in translations

Use ngettext() to handle plurals properly. Also, split pagination
captions into two strings.

Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
This commit is contained in:
Lukas Fleischer 2014-07-04 12:10:00 +02:00
parent b113764b0b
commit 7f29756196
4 changed files with 26 additions and 7 deletions

View file

@ -70,6 +70,13 @@ function __() {
return $translated;
}
function _n($msgid1, $msgid2, $n) {
global $l10n;
$translated = sprintf($l10n->ngettext($msgid1, $msgid2, $n), $n);
return htmlspecialchars($translated, ENT_QUOTES);
}
# set up the visitor's language
#
function set_lang() {