Refactored DjangoTranslation class

Also fixes #18192 and #21055.