JMSTranslationBundle icon indicating copy to clipboard operation
JMSTranslationBundle copied to clipboard

Use choice translation domain

Open artursvonda opened this issue 7 years ago • 12 comments

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

  • [x] Tests
  • [ ] Documentation
  • [ ] Changelog

artursvonda avatar Dec 05 '16 11:12 artursvonda

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.

artursvonda avatar Dec 05 '16 11:12 artursvonda

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

electrixx90 avatar Jan 28 '17 14:01 electrixx90

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.

gnat42 avatar Apr 20 '17 17:04 gnat42

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.

artursvonda avatar Apr 20 '17 17:04 artursvonda

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.

gnat42 avatar Apr 20 '17 18:04 gnat42

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.

artursvonda avatar Apr 20 '17 18:04 artursvonda

Can you rebase this on master please?

gnat42 avatar Apr 20 '17 18:04 gnat42

Done :)

artursvonda avatar Apr 20 '17 18:04 artursvonda

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

gnat42 avatar Apr 20 '17 19:04 gnat42

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

artursvonda avatar Dec 07 '18 15:12 artursvonda

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.

yellow1912 avatar Apr 04 '21 11:04 yellow1912

Rebased against latest develop

artursvonda avatar Apr 11 '21 12:04 artursvonda