8000 [FrameworkBundle] Add --no-prefix option to translation:update · symfony/framework-bundle@fc8bb0e · GitHub
[go: up one dir, main page]

Skip to content

Commit fc8bb0e

Browse files
committed
[FrameworkBundle] Add --no-prefix option to translation:update
Remove ending dot from option description for consistency
1 parent 0f990bb commit fc8bb0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Command/TranslationUpdateCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ protected function configure()
3939
new InputArgument('locale', InputArgument::REQUIRED, 'The locale'),
4040
new InputArgument('bundle', InputArgument::OPTIONAL, 'The bundle name or directory where to load the messages, defaults to app/Resources folder'),
4141
new InputOption('prefix', null, InputOption::VALUE_OPTIONAL, 'Override the default prefix', '__'),
42+
new InputOption('no-prefix', null, InputOption::VALUE_NONE, 'If set, no prefix is added to the translations'),
4243
new InputOption('output-format', null, InputOption::VALUE_OPTIONAL, 'Override the default output format', 'yml'),
4344
new InputOption('dump-messages', null, InputOption::VALUE_NONE, 'Should the messages be dumped in the console'),
4445
new InputOption('force', null, InputOption::VALUE_NONE, 'Should the update be done'),
@@ -133,7 +134,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
133134
$extractedCatalogue = new MessageCatalogue($input->getArgument('locale'));
134135
$io->comment('Parsing templates...');
135136
$extractor = $this->getContainer()->get('translation.extractor');
136-
$extractor->setPrefix($input->getOption('prefix'));
137+
$extractor->setPrefix($input->getOption('no-prefix') ? '' : $input->getOption('prefix'));
137138
foreach ($transPaths as $path) {
138139
$path .= 'views';
139140
if (is_dir($path)) {

0 commit comments

Comments
 (0)
0