Skip to content

Conversation

xfifix
Copy link

@xfifix xfifix commented Jun 11, 2018

  • define the prefix of default translation in the target
  • added an argument in the command
  • use it in the importer to initialized the xliff file

<segment> <source>email.logo.title</source> <target>_email.logo.title</target> </segment>

Copy link
Member

@Nyholm Nyholm left a 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)
Copy link
Member

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

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

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.

@Nyholm Nyholm added this to the Version 1.0 milestone Aug 9, 2018
@bocharsky-bw
Copy link
Member

Any progress here?

@Nyholm
Copy link
Member

Nyholm commented Sep 5, 2019

Friendly ping

@welcoMattic
Copy link
Member

@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!

@xfifix
Copy link
Author

xfifix commented Jan 21, 2020

@welcoMattic Sorry, I don't work on the subject and we abandoned this idea.
if you want we can close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants