Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to configure managed_locales using ENV #420

Open
raziel057 opened this issue Jun 30, 2022 · 1 comment
Open

Impossible to configure managed_locales using ENV #420

raziel057 opened this issue Jun 30, 2022 · 1 comment

Comments

@raziel057
Copy link
Contributor

raziel057 commented Jun 30, 2022

Hello,

I was trying to make the configuration of manage_locales configurable by ENV but it's not working as the resolution of env vars is not done at compile time. See symfony/symfony#33358

So in this case if I configure:

parameters:
    env(ACTIVE_LANGUAGES): '["fr, en"]'

lexik_translation:
    managed_locales: '%env(json:ACTIVE_LANGUAGES)%'

I got the following error in LexikTranslationExtension:
Fatal error: Uncaught TypeError: sort(): Argument #1 ($array) must be of type array, string given in X:\workspace-novento\novento-vip-lounge\vendor\lexik\translation-bundle\DependencyInjection\LexikTranslationExtension.php:45 Stack trace: #0 X:\workspace-novento\novento-vip-lounge\vendor\lexik\translation-bundle\DependencyInjection\LexikTranslationExtension.php(45): sort('env_60da4350975...')

Because managed_locales is env_60da435097537916_json_resolve_ACTIVE_LANGUAGES_8287d553308fc5cd29...

@raziel057
Copy link
Contributor Author

This issue is related to symfony/symfony#40794

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant