def locale_context(request): context = {} context['js_datetime_format'] = get_javascript_format( 'DATETIME_INPUT_FORMATS') context['js_date_format'] = get_javascript_format('DATE_INPUT_FORMATS') context['js_locale'] = get_moment_locale() return context
def locale_context(request): context = {} context["js_datetime_format"] = get_javascript_format("DATETIME_INPUT_FORMATS") context["js_date_format"] = get_javascript_format("DATE_INPUT_FORMATS") context["js_locale"] = get_moment_locale() context["quotation_open"] = _("“") context["quotation_close"] = _("”") return context
def locale_context(request): context = {} context['js_datetime_format'] = get_javascript_format('DATETIME_INPUT_FORMATS') context['js_date_format'] = get_javascript_format('DATE_INPUT_FORMATS') context['js_locale'] = get_moment_locale() context['quotation_open'] = _('“') context['quotation_close'] = _('”') return context
def locale_context(request): context = {} context["js_datetime_format"] = get_javascript_format( "DATETIME_INPUT_FORMATS") context["js_date_format"] = get_javascript_format("DATE_INPUT_FORMATS") context["js_locale"] = get_moment_locale() context["quotation_open"] = _("“") context["quotation_close"] = _("”") lang = translation.get_language() context["html_locale"] = translation.get_language_info(lang).get( "public_code", lang) return context
def locale_context(request): context = {} context["js_datetime_format"] = get_javascript_format("DATETIME_INPUT_FORMATS") context["js_date_format"] = get_javascript_format("DATE_INPUT_FORMATS") context["js_locale"] = get_moment_locale() context["quotation_open"] = _("“") context["quotation_close"] = _("”") lang = translation.get_language() context["html_locale"] = translation.get_language_info(lang).get( "public_code", lang ) context["rtl"] = getattr(request, "LANGUAGE_CODE", "en") in settings.LANGUAGES_RTL return context
def test_get_moment_locale(locale, expected): assert get_moment_locale(locale) == expected