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.

▾ 1 функция вызывает locale_get_plural()

format_plural in includes/common.inc
Форматирует и переводит строку, содержащую число.

Код

<?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];
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Вход в систему