schmittjoh / JMSTranslationBundle

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

Use choice translation domain #419

Open artursvonda opened 7 years ago

artursvonda commented 7 years ago
Q A
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Tests pass? yes (relevant)
Fixed tickets 415
License Apache2

Description

Considers choice translation domain when extracting translation strings. Also ignores translates that have false as translation domain.

Todos

artursvonda commented 7 years ago

Wasn't sure if this qualifies as BC break since extractor previously didn't take into account choice_translation_domain which will cause translations to be extracted under different (correct) domain now. Also will correctly skip translations with false translation domain.

electrixx90 commented 7 years ago

When it becomes available this feature? I hope soon...

gnat42 commented 7 years ago

the other issue with this change is that the choice_translation_domain doesn't exist as a valid option for sf 2.3 which for whatever reason this bundle still supports even though 2.3 is no longer supported. We would have to drop support for sf2.3 with this.

artursvonda commented 7 years ago

I don't think we need to drop the support for 2.3. The translation domain falls back to previous behaviour of using translation_domain if choice domain is not available. That is backwards compatible.

gnat42 commented 7 years ago

Well the tests will be trying to pass an option that doesn't exist in 2.3. So if we don't drop 2.3 support we need to then only conditionally run those tests when sf is > 2.3.

artursvonda commented 7 years ago

I don't think test forms are actually executed so it shouldn't matter. And if users try to use the option on the forms, Symfony will inform them that the option doesn't exist.

gnat42 commented 7 years ago

Can you rebase this on master please?

artursvonda commented 7 years ago

Done :)

gnat42 commented 7 years ago

Can you review the test failures and see if you can fix/determine the issue?

artursvonda commented 5 years ago

Updated tests and rebased. No idea why that one test is failing though.

yellow1912 commented 3 years ago

This is a very old pull request but it has some important improvements that can be considered. For example, it seems like in the current version the translation_domain and choice_translation_domain when set to false still trigger the extraction. This is in conflict with Symfony's document which clearly states that false mean no translation.

artursvonda commented 3 years ago

Rebased against latest develop