コード例 #1
0
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
コード例 #2
0
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
コード例 #3
0
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
コード例 #4
0
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
コード例 #5
0
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
コード例 #6
0
ファイル: test_utils.py プロジェクト: zephyrict/pretalx
def test_get_moment_locale(locale, expected):
    assert get_moment_locale(locale) == expected