Skip to content

TranslationLoader deprecation message in Symfony 3.4.2 #25518

Closed
@iquito

Description

@iquito
Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.4.2

In my application I get the following deprecation message:

The class "Symfony\Bundle\FrameworkBundle\Translation\TranslationLoader" is deprecated since version 3.4 and will be removed in 4.0. Use "Symfony\Component\Translation\Reader\TranslationReader" instead. 

I am using translations, and also JMSTranslationBundle as a helper (to extract annotations and generate .xlf files). But TranslationLoader or anything like it is not used anyhere in my code base. I am basically using a very standard setup for translations, with translator: { fallbacks: [de] } and .xlf files. It is the most basic setup I can imagine.

This is the output in Symfony Profiler for the error:

[▼
    "exception" => SilencedErrorContext {#1537 ▼
        +count: 1
        -severity: E_USER_DEPRECATED
        trace: {▼
        /projectdir/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php:17 {▶}
        /projectdir/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:143 {▶}
        }
    }
]

{▼
    /projectdir/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php:17 {▼
        › 
        › @trigger_error(sprintf('The class "%s" is deprecated since version 3.4 and will be removed in 4.0. Use "%s" instead. ', TranslationLoader::class, TranslationReader::class), E_USER_DEPRECATED);
        › 
    }
    /projectdir/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php:143 {▼
        › if ($file = $this->classLoader[0]->findFile($class)) {
        ›     require $file;
        › }
        arguments: {▼
        "/projectdir/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Translation/TranslationLoader.php"
        }
    }
}

I do not know where the actual usage of TranslationLoader originates, or how to find out, because the stack trace only goes back to DebugClassLoader. So I am not sure if this is a bug or just some other problem. Maybe someone knows how to actually get to the root of this problem, or how to find out more.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions