Exemplo n.º 1
0
 def __getattr__(self, real_name):
     from django.conf import settings
     if settings.USE_I18N:
         from django.utils.translation import trans_real as trans
         from django.utils.translation.reloader import watch_for_translation_changes, translation_file_changed
         autoreload_started.connect(watch_for_translation_changes, dispatch_uid='translation_file_changed')
         file_changed.connect(translation_file_changed, dispatch_uid='translation_file_changed')
     else:
         from django.utils.translation import trans_null as trans
     setattr(self, real_name, getattr(trans, real_name))
     return getattr(trans, real_name)
Exemplo n.º 2
0
 def __getattr__(self, real_name):
     from django.conf import settings
     if settings.USE_I18N:
         from django.utils.translation import trans_real as trans
         from django.utils.translation.reloader import watch_for_translation_changes, translation_file_changed
         autoreload_started.connect(watch_for_translation_changes, dispatch_uid='translation_file_changed')
         file_changed.connect(translation_file_changed, dispatch_uid='translation_file_changed')
     else:
         from django.utils.translation import trans_null as trans
     setattr(self, real_name, getattr(trans, real_name))
     return getattr(trans, real_name)
Exemplo n.º 3
0
 def ready(self):
     super().ready()
     file_changed.connect(skip_dist, dispatch_uid="Skip dist autoreload")