Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Conversation

@chalasr
Copy link
Member

QA
Branch?master
Bug fix?yes
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#20044
LicenseMIT
Doc PRn/a

This adds an option--no-prefix to thetranslation: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).

ogizanagi reacted with thumbs up emoji
Copy link
Member

@javiereguiluzjaviereguiluz left a 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') :'');
Copy link
Member

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?

Copy link
MemberAuthor

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'),
Copy link
Member

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.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Updated, thank you@javiereguiluz

@chalasrchalasrforce-pushed theframework/translation-upd-no-prefix-opt branch 3 times, most recently from6e318d5 to53ed38fCompareNovember 7, 2016 14:24
$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') :'');
Copy link
Member

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.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

👍 done

@chalasrchalasrforce-pushed theframework/translation-upd-no-prefix-opt branch from53ed38f to914e3a9CompareNovember 7, 2016 19:30
Remove ending dot from option description for consistency
@chalasrchalasrforce-pushed theframework/translation-upd-no-prefix-opt branch from914e3a9 tob5a1584CompareNovember 7, 2016 19:38
@Simperfit
Copy link
Contributor

👍

1 similar comment
@aitboudad
Copy link
Contributor

👍

@chalasr
Copy link
MemberAuthor

Is this planed for 3.2? An unsuccessful fix being released and finally reverted, I think the earlier possible would be the best.

@javiereguiluzjaviereguiluz added this to the3.2 milestoneNov 10, 2016
@xabbuh
Copy link
Member

👍

@fabpot
Copy link
Member

Thank you@chalasr.

@fabpotfabpot merged commitb5a1584 intosymfony:masterNov 11, 2016
fabpot added a commit that referenced this pull requestNov 11, 2016
…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
@fabpotfabpot mentioned this pull requestNov 17, 2016
@chalasrchalasr deleted the framework/translation-upd-no-prefix-opt branchMay 10, 2017 16:44
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@xabbuhxabbuhxabbuh left review comments

Assignees

No one assigned

Projects

None yet

Milestone

3.2

Development

Successfully merging this pull request may close these issues.

7 participants

@chalasr@Simperfit@aitboudad@xabbuh@fabpot@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp