Skip to content

Translation, option to add translations to keys #179

@Nils-1st-retail

Description

@Nils-1st-retail

Hi,

I have been working on creating an extractor for routes defined in annotations. (Migrating from JMSI18nRoutingBundle with JMSTranslationBundle) to using this bundle for the translation part.
I'm missing an option to specify a value for the translation from the extractor.

My suggestion would be to either add an extra optional parameter to SourceLocation defaulting to null or allow to set the translation in the context array.

Then in the Symfony Importer service change line 118 from
$catalogue->set($key, null, $domain);
to
$catalogue->set($key, $sourceLocation->getTranslation(), $domain);
or
$catalogue->set($key, isset($context["translation"]) ? $context["translation"] : null, $domain);

The problem atm. is that because all the route values are set as null, all my routes defaults to '/' until I provide a translation.

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