1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/13762] Moving language related functionality into a separate class

PHPBB3-13762
This commit is contained in:
MateBartus
2015-04-14 02:31:23 +02:00
parent 2f480be02d
commit 179a470022
67 changed files with 1663 additions and 679 deletions

View File

@@ -482,3 +482,22 @@ function phpbb_realpath($path)
return $phpbb_filesystem->realpath($path);
}
/**
* Determine which plural form we should use.
* For some languages this is not as simple as for English.
*
* @param $rule int ID of the plural rule we want to use, see http://wiki.phpbb.com/Plural_Rules#Plural_Rules
* @param $number int|float The number we want to get the plural case for. Float numbers are floored.
* @return int The plural-case we need to use for the number plural-rule combination
*
* @deprecated 3.2.0-dev (To be removed: 3.3.0)
*/
function phpbb_get_plural_form($rule, $number)
{
global $phpbb_container;
/** @var \phpbb\language\language $language */
$language = $phpbb_container->get('language');
return $language->get_plural_form($number, $rule);
}