code/translator/inflector/inflector.php
public static function setPluralRule(callable $rule, $language)
    {
        // temporary set a language for brazilian
        if ("pt_BR" == $language) {
            $language = "xbr";
        }

        if (strlen($language) > 3) {
            $language = substr($language, 0, -strlen(strrchr($language, '_')));
        }

        if (!is_callable($rule)) {
            throw new \LogicException('The given rule can not be called');
        }

        self::$position_rules[$language] = $rule;
    }
public static function setPluralRule(callable $rule, $language)
    {
        // temporary set a language for brazilian
        if ("pt_BR" == $language) {
            $language = "xbr";
        }

        if (strlen($language) > 3) {
            $language = substr($language, 0, -strlen(strrchr($language, '_')));
        }

        if (!is_callable($rule)) {
            throw new \LogicException('The given rule can not be called');
        }

        self::$position_rules[$language] = $rule;
    }
public static function setPluralRule ( callable $ rule , $ language ) { // temporary set a language for brazilian if ( "pt_BR" == $ language ) { $ language = "xbr" ; } if ( strlen ( $ language ) > 3 ) { $ language = substr ( $ language , 0 , - strlen ( strrchr ( $ language , '_' ) ) ) ; } if ( ! is_callable ( $ rule ) ) { throw new \ LogicException ( 'The given rule can not be called' ) ; } self :: $ position_rules [ $ language ] = $ rule ; }
Overrides the default plural rule for a given language.

@param callable $rule    A PHP callable
@param string $language  The language
@throws \LogicException
@return void
Overrides the default plural rule for a given language .