-
Notifications
You must be signed in to change notification settings - Fork 94
Default translation with prefix #238
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
Default translation with prefix #238
Conversation
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.
Good. I like that changes are mostly in the Importer
and the command.
* @return ImportResult | ||
*/ | ||
public function extractToCatalogues(Finder $finder, array $catalogues, array $config = []) | ||
public function extractToCatalogues(Finder $finder, array $catalogues, array $config = [], string $prefixTarget = null) |
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.
Why not put it in $config?
@@ -96,6 +98,9 @@ public function extractToCatalogues(Finder $finder, array $catalogues, array $co | |||
$meta = $this->getMetadata($result, $key, $domain); | |||
$meta->setState('new'); | |||
$this->setMetadata($result, $key, $domain, $meta); | |||
if (null !== $prefixTarget) { | |||
$this->setTarget($catalogue, $key, $prefixTarget, $domain, $translation); |
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.
It may be a translation in $meta
. Do this after the if (null === $translation)
block.
@@ -92,13 +92,14 @@ protected function configure() | |||
->addArgument('locale', InputArgument::OPTIONAL, 'The locale ot use. If omitted, we use all configured locales.', false) | |||
->addOption('hide-errors', null, InputOption::VALUE_NONE, 'If we should print error or not') | |||
->addOption('bundle', 'b', InputOption::VALUE_REQUIRED, 'The bundle you want extract translations from.') | |||
->addArgument('prefixTarget', InputArgument::OPTIONAL, 'The prefix of Target', null) |
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.
We should add 2 arguments. One should be prefix
and one key-as-translation
or something similar.
Any progress here? |
Friendly ping |
@xfifix is there any progress? Your PR looks great, it covers more cases like key-as-translation. Would you rebase it and consider comment? Thanks a lot! |
@welcoMattic Sorry, I don't work on the subject and we abandoned this idea. |
<segment> <source>email.logo.title</source> <target>_email.logo.title</target> </segment>