aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/session.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-09-13 01:46:00 +0200
committerOleg Pudeyev <oleg@bsdpower.com>2011-11-25 15:04:31 -0500
commitf16d72fcfb9a7621bf64b82cc2c710c6e484d965 (patch)
treefee4024018a61b725035017f7254e248cd229de8 /phpBB/includes/session.php
parent757fcd3e63535f9fda68cf359f849a44059c7b27 (diff)
downloadforums-f16d72fcfb9a7621bf64b82cc2c710c6e484d965.tar
forums-f16d72fcfb9a7621bf64b82cc2c710c6e484d965.tar.gz
forums-f16d72fcfb9a7621bf64b82cc2c710c6e484d965.tar.bz2
forums-f16d72fcfb9a7621bf64b82cc2c710c6e484d965.tar.xz
forums-f16d72fcfb9a7621bf64b82cc2c710c6e484d965.zip
[ticket/10345] Fix documentation on the new function and the switch
Also do not min/max the value, but throw an error on an invalid Plural rule. PHPBB3-10345
Diffstat (limited to 'phpBB/includes/session.php')
-rw-r--r--phpBB/includes/session.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php
index cd1975b9d3..4e5257506c 100644
--- a/phpBB/includes/session.php
+++ b/phpBB/includes/session.php
@@ -1901,6 +1901,10 @@ class user extends session
/**
* Determine which plural form we should use.
* For some languages this is not as simple as for English.
+ *
+ * @param $number int The number we want to get the plural case for
+ * @param $force_rule mixed False to use the plural rule of the language package
+ * or an integer to force a certain plural rule
*/
function get_plural_form($number, $force_rule = false)
{
@@ -1910,10 +1914,17 @@ class user extends session
return 0;
}
- // Default to english system
+ // Default to English system
$plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
- $plural_rule = max(0, min($plural_rule, 15));
+ if ($plural_rule > 15 || $plural_rule < 0)
+ {
+ trigger_error('INVALID_PLURAL_RULE');
+ }
+ /**
+ * The following plural rules are based on a list published by the Mozilla Developer Network
+ * https://developer.mozilla.org/en/Localization_and_Plurals
+ */
switch ($plural_rule)
{
case 0:
=18.34&id=70e952ded7012c6b8e271dc6e7db2400fa722ec4'>Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/share/po/af.po4
-rw-r--r--perl-install/share/po/bs.po16
-rw-r--r--perl-install/share/po/ca.po16
-rw-r--r--perl-install/share/po/cy.po4
-rw-r--r--perl-install/share/po/da.po16
-rw-r--r--perl-install/share/po/de.po10
-rw-r--r--perl-install/share/po/eo.po16
-rw-r--r--perl-install/share/po/es.po16
-rw-r--r--perl-install/share/po/eu.po2
-rw-r--r--perl-install/share/po/fi.po8
-rw-r--r--perl-install/share/po/ga.po10
11 files changed, 59 insertions, 59 deletions
diff --git a/perl-install/share/po/af.po b/perl-install/share/po/af.po
index 830c0c026..40977e4fe 100644
--- a/perl-install/share/po/af.po
+++ b/perl-install/share/po/af.po
@@ -21194,7 +21194,7 @@ msgstr ""
#: standalone/draknfs:527
#, c-format
msgid "Share Directory"
-msgstr "D&eel Gids"
+msgstr "Deel Gids"
#: standalone/draknfs:527
#, c-format
@@ -21856,7 +21856,7 @@ msgstr ""
#: standalone/draksambashare:611
#, c-format
msgid "Print command:"
-msgstr "D&ruk opdrag:"
+msgstr "Druk opdrag:"
#: standalone/draksambashare:612
#, c-format
diff --git a/perl-install/share/po/bs.po b/perl-install/share/po/bs.po
index 172541021..e5177c406 100644
--- a/perl-install/share/po/bs.po
+++ b/perl-install/share/po/bs.po
@@ -19813,7 +19813,7 @@ msgstr "Opširno"
#: standalone/drakboot:127
#, c-format
msgid "Silent"
-msgstr "B&ez ispisa"
+msgstr "Bez ispisa"
#: standalone/drakboot:134
#, c-format
@@ -21178,7 +21178,7 @@ msgstr "IP adresa:"
#: standalone/drakhosts:116
#, c-format
msgid "Host name:"
-msgstr "N&aziv računara:"
+msgstr "Naziv računara:"
#: standalone/drakhosts:117
#, c-format
@@ -21464,7 +21464,7 @@ msgstr ""
#: standalone/draknfs:396
#, c-format
msgid "Access:"
-msgstr "P&ristup:"
+msgstr "Pristup:"
#: standalone/draknfs:396
#, c-format
@@ -21867,7 +21867,7 @@ msgstr "Komentar"
#: standalone/draksambashare:64 standalone/draksambashare:97
#, c-format
msgid "Browseable"
-msgstr "P&reTrazno"
+msgstr "PreTrazno"
#: standalone/draksambashare:65
#, c-format
@@ -22141,7 +22141,7 @@ msgstr "Mogućnost pisanja :"
#: standalone/draksambashare:593 standalone/draksambashare:774
#, c-format
msgid "Browseable:"
-msgstr "P&reTrazno :"
+msgstr "PreTrazno :"
#: standalone/draksambashare:598
#, c-format
@@ -22171,7 +22171,7 @@ msgstr ""
#: standalone/draksambashare:611
#, c-format
msgid "Print command:"
-msgstr "N&aredba za štampu:"
+msgstr "Naredba za štampu:"
#: standalone/draksambashare:612
#, c-format
@@ -22247,7 +22247,7 @@ msgstr ""
#: standalone/draksambashare:928
#, c-format
msgid "User name:"
-msgstr "K&orisničko ime:"
+msgstr "Korisničko ime:"
#: standalone/draksambashare:929 standalone/harddrake2:551
#, c-format
@@ -22327,7 +22327,7 @@ msgstr ""
#: standalone/draksambashare:1238
#, c-format
msgid "Samba Users"
-msgstr "S&amba Korisnici"
+msgstr "Samba Korisnici"
#: standalone/draksambashare:1247
#, c-format
diff --git a/perl-install/share/po/ca.po b/perl-install/share/po/ca.po
index 12598734f..3add727a2 100644
--- a/perl-install/share/po/ca.po
+++ b/perl-install/share/po/ca.po
@@ -21529,7 +21529,7 @@ msgstr "Adreça IP:"
#: standalone/drakhosts:116
#, c-format
msgid "Host name:"
-msgstr "N&om de la màquina:"
+msgstr "Nom de la màquina:"
#: standalone/drakhosts:117
#, c-format
@@ -21819,7 +21819,7 @@ msgstr ""
#: standalone/draknfs:396
#, c-format
msgid "Access:"
-msgstr "A&ccés:"
+msgstr "Accés:"
#: standalone/draknfs:396
#, c-format
@@ -21864,7 +21864,7 @@ msgstr ""
#: standalone/draknfs:527
#, c-format
msgid "Share Directory"
-msgstr "C&omparteix el directori"
+msgstr "Comparteix el directori"
#: standalone/draknfs:527
#, c-format
@@ -22228,7 +22228,7 @@ msgstr "Comentari"
#: standalone/draksambashare:64 standalone/draksambashare:97
#, c-format
msgid "Browseable"
-msgstr "A&ccedible"
+msgstr "Accedible"
#: standalone/draksambashare:65
#, c-format
@@ -22285,7 +22285,7 @@ msgstr "Fitxers ocults"
#: standalone/draksambashare:76 standalone/draksambashare:142
#, c-format
msgid "Preserve case"
-msgstr "C&aixa de manteniment"
+msgstr "Caixa de manteniment"
#
#: standalone/draksambashare:77
@@ -22506,7 +22506,7 @@ msgstr "Escrivible :"
#: standalone/draksambashare:593 standalone/draksambashare:774
#, c-format
msgid "Browseable:"
-msgstr "A&ccedible :"
+msgstr "Accedible :"
#: standalone/draksambashare:598
#, c-format
@@ -22536,7 +22536,7 @@ msgstr ""
#: standalone/draksambashare:611
#, c-format
msgid "Print command:"
-msgstr "O&rdre d'impressió:"
+msgstr "Ordre d'impressió:"
#: standalone/draksambashare:612
#, c-format
@@ -22692,7 +22692,7 @@ msgstr ""
#: standalone/draksambashare:1238
#, c-format
msgid "Samba Users"
-msgstr "U&suaris Samba"
+msgstr "Usuaris Samba"
#: standalone/draksambashare:1247
#, c-format
diff --git a/perl-install/share/po/cy.po b/perl-install/share/po/cy.po
index b1d10195a..a2dade762 100644
--- a/perl-install/share/po/cy.po
+++ b/perl-install/share/po/cy.po
@@ -21963,7 +21963,7 @@ msgstr ""
#: standalone/draksambashare:99
#, c-format
msgid "Print Command"
-msgstr ""
+msgstr "Gorchymyn argraffu"
#: standalone/draksambashare:100
#, c-format
@@ -22181,7 +22181,7 @@ msgstr ""
#: standalone/draksambashare:611
#, c-format
msgid "Print command:"
-msgstr "G&orchymyn argraffu:"
+msgstr "Gorchymyn argraffu:"
#: standalone/draksambashare:612
#, c-format
diff --git a/perl-install/share/po/da.po b/perl-install/share/po/da.po
index 45408b184..ffc221487 100644
--- a/perl-install/share/po/da.po
+++ b/perl-install/share/po/da.po