JMSTranslationBundle icon indicating copy to clipboard operation
JMSTranslationBundle copied to clipboard

Extract translations by domain ?

Open ikodev opened this issue 8 years ago • 1 comments

Hello ! Is it possible (or could be a nice improvement) to allow the extraction by domain ? I havn't found that feature in the doc...

Currently in our team, when we extract by configuration (--config=...), the command regenerate useless files with only a timestamp changed in top file (xliff). These committed files in our project are useless for our diff check before a production delivery. Sometimes we would love to extract translations by domains only.

$container->get('translator')->trans('our_key', [], 'specific_domain_to_extract');

Thank you for your advice :)

| ---------------- | --- | Bundle version | 1.3.2 | Symfony version | 3.3.9 | PHP version | 7.0

ikodev avatar Oct 05 '17 11:10 ikodev

Few solutions:

  • Don't extract references and dates at all:
jms_translation:
    # ...
    dumper:
        add_references: false
        add_date: false
  • Use --domain argument:
$ bin/console translation:extract --config=example_config --domain=specific_domain_to_extract
  • Add domains to config:
jms_translation:
    # ...
    configs:
        example_config:
            # ...
            domains: ["specific_domain_to_extract"]

Nattfarinn avatar Nov 15 '17 08:11 Nattfarinn