クラス Gettext_Translations::make_plural_form_function()
目次
クラス Gettext_Translations::make_plural_form_function()
定義ファイル :/blog/wp-includes/pomo/translations.php
1 2 3 4 5 6 7 8 9 10 11 | /** * Makes a function, which will return the right translation index, according to the * plural forms header */ function make_plural_form_function($nplurals, $expression) { $expression = str_replace('n', '$n', $expression); $func_body = " \$index = (int)($expression); return (\$index < $nplurals)? \$index : $nplurals - 1;"; return create_function('$n', $func_body); } |