BazingaJsTranslationBundle icon indicating copy to clipboard operation
BazingaJsTranslationBundle copied to clipboard

Translator > Added support for other languages from symfony intl bundle

Open zocimek opened this issue 9 years ago • 9 comments

Using language es_419 is currently not supported due to filtering the locales. I've tested regexp against Intl::getLocaleBundle()->getLocales() and added also some test cases.

zocimek avatar Aug 06 '15 13:08 zocimek

What aboout using the same regex than the one used in the Symfony Translator to restrict valid locales ? https://github.com/symfony/symfony/blob/2.8/src/Symfony/Component/Translation/Translator.php#L484

stof avatar Aug 06 '15 13:08 stof

@zocimek FYI, you committed with an email address which is not associated to your github account, so Github does not match these contributions as being ours (in the contributor graph for instance)

stof avatar Aug 06 '15 13:08 stof

@stof thanks for your advice I've changed the pattern to be valid with symfony.

zocimek avatar Aug 06 '15 13:08 zocimek

@stof @willdurand Can anyone merge this change ?

zocimek avatar Aug 10 '15 07:08 zocimek

Given that you accept dashes now, you should normalize them to underscores, to match the Symfony behavior

stof avatar Aug 10 '15 16:08 stof

and I cannot merge this. I'm not a collaborator on the repo

stof avatar Aug 10 '15 16:08 stof

@stof you mean something like this ?

$locales = array_unique(array_map(function ($locale) {
    if (strrchr($locale, '_') !== false) {
        $locale = substr($locale, 0, -strlen(strrchr($locale, '_')));
    }

    return trim($locale);
}, $locales));

zocimek avatar Aug 13 '15 12:08 zocimek

@willdurand @monteiro Could you merge this change?

fatalcoder avatar Nov 30 '16 14:11 fatalcoder

Would solve this issue: https://github.com/willdurand/BazingaJsTranslationBundle/issues/188

ph-teven avatar Dec 22 '16 14:12 ph-teven