Support the ongoing development of →
posted 2 weeks ago
Last updated by @valentino-emirlike 2 weeks ago.

Hello @valentino-emirlike

This is strange, I'm not sure what the version of symfony/translation you have. (You can see that with: composer info symfony/translation)

But I see that it didn't really change for a long time and is this function that validates your locale:

    protected function assertValidLocale(string $locale)
        if (!preg_match('/^[[email protected]_\\.\\-]*$/i', $locale)) {
            throw new InvalidArgumentException(sprintf('Invalid "%s" locale.', $locale));

With that en should be valid, maybe you can have any hidden character in the config file and write it again?


Hi, thank you for trying to help! Composer installed these versions:

symfony/translation                  v6.1.4          Provides tools to internationalize your application
symfony/translation-contracts        v3.1.1          Generic abstractions related to translation

I checked and there are no hidden characters in the config/app.php file. It's utf8 encoded and has linux style line termination (and I'm working in a linux box).


Sign in to participate in this thread!

Full Stack Europe

Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 - All rights reserved.