JMSTranslationBundle
JMSTranslationBundle copied to clipboard
Use choice translation domain
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
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.
When it becomes available this feature? I hope soon...
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.
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.
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.
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.
Can you rebase this on master please?
Done :)
Can you review the test failures and see if you can fix/determine the issue?
Updated tests and rebased. No idea why that one test is failing though.
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.
Rebased against latest develop