diff options
author | Jakob Sack <mail@jakobsack.de> | 2013-07-16 22:16:53 +0200 |
---|---|---|
committer | Jakob Sack <mail@jakobsack.de> | 2013-07-16 22:16:53 +0200 |
commit | bb0c5bff5fc493dd24c2c9cbbf27986fd5098de1 (patch) | |
tree | 9aa2eceb270a6f9fbeaba5ec74b3a37f0121a5cc /lib/l10n | |
parent | 18fc22b52bdf1d8372a6e9c602872c423ce50eff (diff) | |
download | nextcloud-server-bb0c5bff5fc493dd24c2c9cbbf27986fd5098de1.tar.gz nextcloud-server-bb0c5bff5fc493dd24c2c9cbbf27986fd5098de1.zip |
Add multiple plural forms to the php part
Diffstat (limited to 'lib/l10n')
-rw-r--r-- | lib/l10n/string.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/l10n/string.php b/lib/l10n/string.php index 1bef7330945..3cda5eab506 100644 --- a/lib/l10n/string.php +++ b/lib/l10n/string.php @@ -18,10 +18,17 @@ class OC_L10N_String{ public function __toString() { $translations = $this->l10n->getTranslations(); + $localizations = $this->l10n->getLocalizations(); $text = $this->text; if(array_key_exists($this->text, $translations)) { - $text = $translations[$this->text]; + if(is_array($translations[$this->text])) { + $id = $localizations["selectplural"]( $count ); + $text = $translations[$this->text][$id] + } + else{ + $text = $translations[$this->text]; + } } // Replace %n first (won't interfere with vsprintf) $text = str_replace('%n', $this->count, $text); |