我们从Python开源项目中,提取了以下6个代码示例,用于说明如何使用django.utils.translation.trans_null()。
def __getattr__(self, real_name): from django.conf import settings if settings.USE_I18N: from django.utils.translation import trans_real as trans else: from django.utils.translation import trans_null as trans setattr(self, real_name, getattr(trans, real_name)) return getattr(trans, real_name)