Use the application domain when doing i18n of actions
ClosedPublic

Authored by aacid on Aug 24 2017, 6:18 PM.

Diff Detail

Repository
R317 Kross
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
aacid created this revision.Aug 24 2017, 6:18 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 24 2017, 6:18 PM
Restricted Application added a subscriber: Frameworks. · View Herald Transcript
ltoscano edited edge metadata.Aug 24 2017, 6:47 PM

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?

ilic accepted this revision.Aug 24 2017, 7:56 PM

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.

This revision is now accepted and ready to land.Aug 24 2017, 7:56 PM
aacid closed this revision.Aug 24 2017, 9:26 PM