locale_get_plural
modules/locale/locale.module, строка 272
- Версии
- 5
locale_get_plural($count)
- 6
locale_get_plural($count, $langcode = NULL)
Returns plural form index for a specific number.
The index is computed from the formula of this language.
Код
<?php
function locale_get_plural($count) {
global $locale;
static $locale_formula, $plurals = array();
if (!isset($plurals[$count])) {
if (!isset($locale_formula)) {
$languages = locale_supported_languages();
$locale_formula = $languages['formula'][$locale];
}
if ($locale_formula) {
$n = $count;
$plurals[$count] = @eval("return intval($locale_formula);");
return $plurals[$count];
}
else {
$plurals[$count] = -1;
return -1;
}
}
return $plurals[$count];
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии