A
A
Alexander2021-08-02 08:57:40
symfony
Alexander, 2021-08-02 08:57:40

How to specify env in path for localization?

Symphony 5.3.6. You need to specify a variable for localization in the path, I do this:

<?php

use Symfony\Config\FrameworkConfig;

return static function (FrameworkConfig $frameworkConfig) {
    $frameworkConfig
        ->defaultLocale('ru')
        ->translator()
        ->paths([
            '%kernel.project_dir%/i18n/default',
            '%kernel.project_dir%/i18n/client/%env(APP_CLIENT)%',
        ])
        ->enabledLocales(['ru', 'en', 'de', 'es', 'zh_cn']);
};


But in the end the error is:

Incompatible use of dynamic environment variables "APP_CLIENT" found in parameters.


But honestly, I can’t understand what the error is and is it even possible?

UPD Based on this discussion, env cannot be used in paths. https://github.com/symfony/symfony/issues/24270 Then the question follows from here, how to make it work, maybe another way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Derepko, 2021-08-02
@uDenX

https://symfony.com/doc/current/configuration.html...
https://symfony.com/doc/current/configuration/env_...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question