add Django 1.3/4 version of smart_text