Skip to content

[FrameworkBundle] Add --no-fill option to translation:extract command #58506

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

Merged
merged 1 commit into from
Oct 23, 2024

Conversation

jawira
Copy link
Contributor

@jawira jawira commented Oct 8, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? yes
Deprecations? no
Issues Fix #58451
License MIT

This PR adds the --no-fill option to translation:extract command.
With this option, only translation keys are generated in the output file, while the translation values are left blank.

Example:

bin/console translation:extract --force --no-fill fr

When --no-fill is used the --prefix option has no effect.

@OskarStark
Copy link
Contributor

Thanks for your contribution, please add tests for your new feature 🙏

@jawira jawira marked this pull request as draft October 9, 2024 07:10
@carsonbot carsonbot changed the title Add --no-fill option to translation:extract command [FrameworkBundle] Add --no-fill option to translation:extract command Oct 9, 2024
@OskarStark OskarStark changed the title [FrameworkBundle] Add --no-fill option to translation:extract command [FrameworkBundle] Add --no-fill option to translation:extract command Oct 9, 2024
@jawira jawira force-pushed the no-fill branch 2 times, most recently from 6878c2f to 4068914 Compare October 11, 2024 12:03
@jawira
Copy link
Contributor Author

jawira commented Oct 11, 2024

I have written some tests for TranslationUpdateCommand::removeNoFillTranslations. Please let me know if they are sufficient or if any additional tests are required.

@jawira jawira marked this pull request as ready for review October 11, 2024 13:12
@jawira jawira marked this pull request as draft October 14, 2024 09:44
@jawira jawira marked this pull request as ready for review October 14, 2024 18:59
@@ -271,6 +271,10 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$operationResult = $this->sortCatalogue($operationResult, $sort);
}

if (true === $input->getOption('no-fill')) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (true === $input->getOption('no-fill')) {
if ($input->getOption('no-fill')) {

@nicolas-grekas
Copy link
Member

Thank you @jawira.

@nicolas-grekas nicolas-grekas merged commit eb8b5e7 into symfony:7.2 Oct 23, 2024
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option to prevent pre-filling translations
5 participants