Python django.utils.translation.trans_real._default() Examples
The following are 14
code examples of django.utils.translation.trans_real._default().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
django.utils.translation.trans_real
, or try the search function
.
Example #1
Source File: autoreload.py From GTDWeb with GNU General Public License v2.0 | 5 votes |
def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local()
Example #2
Source File: signals.py From GTDWeb with GNU General Public License v2.0 | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._default = None trans_real._active = threading.local() if kwargs['setting'] in {'LANGUAGES', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._translations = {} trans_real.check_for_language.cache_clear()
Example #3
Source File: autoreload.py From bioforum with MIT License | 5 votes |
def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local()
Example #4
Source File: signals.py From bioforum with MIT License | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._default = None trans_real._active = threading.local() if kwargs['setting'] in {'LANGUAGES', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._translations = {} trans_real.check_for_language.cache_clear()
Example #5
Source File: autoreload.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local()
Example #6
Source File: signals.py From Hands-On-Application-Development-with-PyCharm with MIT License | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._default = None trans_real._active = threading.local() if kwargs['setting'] in {'LANGUAGES', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._translations = {} trans_real.check_for_language.cache_clear()
Example #7
Source File: autoreload.py From python with Apache License 2.0 | 5 votes |
def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local()
Example #8
Source File: signals.py From python with Apache License 2.0 | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._default = None trans_real._active = threading.local() if kwargs['setting'] in {'LANGUAGES', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._translations = {} trans_real.check_for_language.cache_clear()
Example #9
Source File: signals.py From luscan-devel with GNU General Public License v2.0 | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in ('LOCALE_PATHS', 'LANGUAGE_CODE'): from django.utils.translation import trans_real trans_real._default = None if kwargs['setting'] == 'LOCALE_PATHS': trans_real._translations = {}
Example #10
Source File: autoreload.py From openhgsenti with Apache License 2.0 | 5 votes |
def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local()
Example #11
Source File: signals.py From openhgsenti with Apache License 2.0 | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._default = None trans_real._active = threading.local() if kwargs['setting'] in {'LANGUAGES', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._translations = {} trans_real.check_for_language.cache_clear()
Example #12
Source File: autoreload.py From python2017 with MIT License | 5 votes |
def reset_translations(): import gettext from django.utils.translation import trans_real gettext._translations = {} trans_real._translations = {} trans_real._default = None trans_real._active = threading.local()
Example #13
Source File: signals.py From python2017 with MIT License | 5 votes |
def language_changed(**kwargs): if kwargs['setting'] in {'LANGUAGES', 'LANGUAGE_CODE', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._default = None trans_real._active = threading.local() if kwargs['setting'] in {'LANGUAGES', 'LOCALE_PATHS'}: from django.utils.translation import trans_real trans_real._translations = {} trans_real.check_for_language.cache_clear()
Example #14
Source File: test_autoreload.py From djongo with GNU Affero General Public License v3.0 | 5 votes |
def test_resets_trans_real(self): trans_real._translations = {'foo': 'bar'} trans_real._default = 1 trans_real._active = False autoreload.reset_translations() self.assertEqual(trans_real._translations, {}) self.assertIsNone(trans_real._default) self.assertIsInstance(trans_real._active, _thread._local)