Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

command translation:extract not found #505

Open
PaddyLock opened this issue Jan 22, 2019 · 2 comments
Open

command translation:extract not found #505

PaddyLock opened this issue Jan 22, 2019 · 2 comments

Comments

@PaddyLock
Copy link

Q A
Bundle version 1.4.3
Symfony version v4.2.1
PHP version 7.2.10

Expected behavior

Should be able to run extraction with this command

php bin/console translation:extract en --config=app --output-format=xliff --enable-extractor=jms_i18n_routing

Actual behavior

 Command "translation:extract" is not defined.

 Do you want to run "translation:update" instead?  (yes/no) [no]:
 > 

Steps to reproduce

use following config

jms_translation:
    configs:
        app:
            dirs: ["%kernel.root_dir%", "%kernel.root_dir%/../src/"]
            output_dir: "%kernel.root_dir%/../translations/"
            extractors: []

also installed jms/i18n-routing-bundle 3.0.2 with following config

jms_i18n_routing:
    default_locale: en
    locales: "%languages%"
    strategy: prefix_except_default

then run the command above.

Also if I run

php bin/console list

I only see translation:update

could there be a conflict in the namespace?

@linaori
Copy link

linaori commented Jun 14, 2019

@PaddyLock do you have the mopa bootstrap bundle? I was looking for people with a similar issue. This bundle doesn't load the command in a specific case:

if (!class_exists('Symfony\Component\ClassLoader\ClassLoader')) {
$loader->load('console.xml');
}

The mopa bootstrap bundle requires the mopa/composer-bridge: https://github.com/phiamo/MopaBootstrapBundle/blob/419bb11abd5940e0957ca6ed254aec0ae402e382/composer.json#L29

This bridge requires the symfony class-loader and thus causes the class loader to exist and not load this command
https://github.com/phiamo/MopaComposerBridge/blob/58661a5c588ce9c3eff7d36c4030f6caa4de1ae2/composer.json#L20

If that's not the case, find out why the class loader is installed and try to remove it.

Question for the maintainers:
Is this case really necessary to not load the command if the classloader is loaded?

@PaddyLock
Copy link
Author

@linaori Yes I do have mopa bootstrap bundle installed.

I ended up using this package instead

And use this to extract

php bin/console translation:extract app en

However, there is also the built in symfony extractor in the docs

I'm not sure which method is recommended now, I haven't looked at this for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants