Details
Diff Detail
- Repository
- R317 Kross
- Branch
- master
- Lint
No Linters Available - Unit
No Unit Test Coverage
I was wondering: can it happen if this code is set in a library, where the translation domain is set through TRANSLATION_DOMAIN, would it work?
If I understand the code correctly, i18n is set with the domain is TRANSLATION_DOMAIN is set. Maybe if the applicationDomain is empty we can just call i18n as before?
I'd say the patch is fine as it is. If this code is invoked through an intermediate library, that library's definition of TRANSLATION_DOMAIN will have no effect, instead kross' TRANSLATION_DOMAIN will be used. Therefore if applicationDomain is empty, then there is no place to fetch translation from, and untranslated string should be returned (as it will happen with this patch).
Alternatively, in case of empty applicationDomain some sort of warning could be produced.