8000 Minor BC break in TranslationUpdateCommand · Issue #26007 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
Minor BC break in TranslationUpdateCommand #26007
Closed
@pevdh

Description

@pevdh
Q A
Bug report? yes
Feature request? no
BC Break report? yes
RFC? no
Symfony version 3.4.4

According to the documentation and the translation:update description, php bin/console translation:update --force --dump-messages en is supposed to store translations in app/Resources by default.

However, in #25065 the defaultTransPath constructor argument was set to %kernel.project_dir%/translations instead of %kernel.project_dir%/app/Resources:

public function __construct($writer = null, TranslationReaderInterface $reader = null, ExtractorInterface $extractor = null, $defaultLocale = null, $defaultTransPath = null, $defaultViewsPath = null)

<service id="console.command.translation_update" class="Symfony\Bundle\FrameworkBundle\Command\TranslationUpdateCommand">
<argument type="service" id="translation.writer" />
<argument type="service" id="translation.reader" />
<argument type="service" id="translation.extractor" />
<argument>%kernel.default_locale%</argument>
<argument>%translator.default_path%</argument>
<argument /> <!-- %twig.default_path% -->
<tag name="console.command" command="translation:update" />
</service>

$container->setParameter('translator.default_path', $config['default_path']);

->scalarNode('default_path')
->info('The default path used to load translations')
->defaultValue('%kernel.project_dir%/translations')
->end()

The former is indeed correct for sf4 projects, but directly contradicts the description of the command (and probably some documentation) in 3.4:

Usage:
  translation:update [options] [--] <locale> [<bundle>]

Arguments:
  locale                               The locale
  bundle                               The bundle name or directory where to load the messages, defaults to >>> app/Resources <<<  folder

php bin/console translation:update --force --dump-messages en app does store the translations in app/Resources/translations.

I really don't mind typing the 3 extra letters, but I thought I'd mention it either way :)
Also, not really sure if I missed anything here.

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

      0