Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Add --no-prefix option to translation:update#20432
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[FrameworkBundle] Add --no-prefix option to translation:update#20432
Uh oh!
There was an error while loading.Please reload this page.
Conversation
javiereguiluz left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍
Adding this option looks like the only possible alternative to solve this issue without creating more troubles.
| $extractor->setPrefix(null ===$prefix ?'' :$prefix); | ||
| if (false ===$input->getOption('no-prefix')) { | ||
| $extractor->setPrefix(false ===$input->getOption('no-prefix') ?$input->getOption('prefix') :''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thefalse === $input->getOption('no-prefix') condition is redundant here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Oops :) it is fixed now
| newInputArgument('locale', InputArgument::REQUIRED,'The locale'), | ||
| newInputArgument('bundle', InputArgument::OPTIONAL,'The bundle name or directory where to load the messages, defaults to app/Resources folder'), | ||
| newInputOption('prefix',null, InputOption::VALUE_OPTIONAL,'Override the default prefix','__'), | ||
| newInputOption('no-prefix',null, InputOption::VALUE_NONE,'Should the prefix be an empty string'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Maybe we could reword this description as:If set, no prefix is added to the translations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Updated, thank you@javiereguiluz
6e318d5 to53ed38fCompare| $prefix =$input->getOption('prefix'); | ||
| $extractor =$this->getContainer()->get('translation.extractor'); | ||
| $extractor->setPrefix(null ===$prefix ?'' :$prefix); | ||
| $extractor->setPrefix(false ===$input->getOption('no-prefix') ?$input->getOption('prefix') :''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I think$input->getOption('no-prefix') ? '' : $input->getOption('prefix') will be more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
👍 done
53ed38f to914e3a9CompareRemove ending dot from option description for consistency
914e3a9 tob5a1584CompareSimperfit commentedNov 7, 2016
👍 |
1 similar comment
aitboudad commentedNov 9, 2016
👍 |
chalasr commentedNov 10, 2016
Is this planed for 3.2? An unsuccessful fix being released and finally reverted, I think the earlier possible would be the best. |
xabbuh commentedNov 10, 2016
👍 |
fabpot commentedNov 11, 2016
Thank you@chalasr. |
…date (chalasr)This PR was merged into the 3.2-dev branch.Discussion----------[FrameworkBundle] Add --no-prefix option to translation:update| Q | A| ------------- | ---| Branch? | master| Bug fix? | yes| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#20044| License | MIT| Doc PR | n/aThis adds an option `--no-prefix` to the `translation:update` command, allowing to use an empty string as prefix. I guess it should be treated as a feature as it adds a new option to the command, but it indeed fixes the bug reported in#20044 (yeah, really this time).Commits-------b5a1584 [FrameworkBundle] Add --no-prefix option to translation:update
This adds an option
--no-prefixto thetranslation:updatecommand, allowing to use an empty string as prefix. I guess it should be treated as a feature as it adds a new option to the command, but it indeed fixes the bug reported in#20044 (yeah, really this time).