Skip to content

Impossible to configure managed_locales using ENV #420

Description

@raziel057

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...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions