schmittjoh / JMSTranslationBundle

Puts the Symfony2 Translation Component on steroids
http://jmsyst.com/bundles/JMSTranslationBundle
427 stars 291 forks source link

Support for intl-icu translation files #550

Closed mark-gerarts closed 3 years ago

mark-gerarts commented 3 years ago
Q A
Bundle version 1.5.4
Symfony version 5.1.5
PHP version 7.4.9

Transchoice has been deprecated since Symfony 4, in favor if ICU. In order to use this format, you have to suffix your translation files with +intl-icu, e.g. messages+intl-icu.nl.xliff (as per the docs).

Is there a way to create files with the intl-icu suffix using this bundle? I've tried passing it as a domain like this:

{{ 'some_key'|trans({'%count%': count}, 'messages+intl-icu') }}

This causes the extractor to create the files, but the translator now expects the ICU translations in messages+intl-icu+intl-icu.nl.xliff.

goetas commented 3 years ago

This is something that has not been implemented, are you willing to provide a pull request for it?

mark-gerarts commented 3 years ago

I can take a look at it. How would you suggest we go around implementing this? My idea would be to add a boolean configuration setting to indicate icu should be used.

goetas commented 3 years ago

https://github.com/schmittjoh/JMSTranslationBundle/pull/551 is merged