src/i18n/Messages/Symfony/ModuleYamlLoader.php
protected function normaliseMessage($key, $value, $locale)
    {
        if (!is_array($value)) {
            return $value;
        }
        if (isset($value['default'])) {
            return $value['default'];
        }
        // Plurals
        $pluralised = i18n::encode_plurals($value);
        if ($pluralised) {
            return $pluralised;
        }

        // Warn if mismatched plural forms
        trigger_error("Localisation entity {$locale}.{$key} is invalid", E_USER_WARNING);
        return null;
    }
protected function normaliseMessage($key, $value, $locale)
    {
        if (!is_array($value)) {
            return $value;
        }
        if (isset($value['default'])) {
            return $value['default'];
        }
        // Plurals
        $pluralised = i18n::encode_plurals($value);
        if ($pluralised) {
            return $pluralised;
        }

        // Warn if mismatched plural forms
        trigger_error("Localisation entity {$locale}.{$key} is invalid", E_USER_WARNING);
        return null;
    }
protected function normaliseMessage ( $ key , $ value , $ locale ) { if ( ! is_array ( $ value ) ) { return $ value ; } if ( isset ( $ value [ 'default' ] ) ) { return $ value [ 'default' ] ; } // Plurals $ pluralised = i18n :: encode_plurals ( $ value ) ; if ( $ pluralised ) { return $ pluralised ; } // Warn if mismatched plural forms trigger_error ( "Localisation entity {$locale}.{$key} is invalid" , E_USER_WARNING ) ; return null ; }
Normalise rails-yaml plurals into pipe-separated rules

@link http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
@link http://guides.rubyonrails.org/i18n.html#pluralization
@link http://symfony.com/doc/current/components/translation/usage.html#component-translation-pluralization

@param string $key
@param mixed $value Input value
@param string $locale
@return string
Normalise rails - yaml plurals into pipe - separated rules