Пример #1
0
def get_app_ui_translations(request, domain):
    params = json_request(request.GET)
    lang = params.get("lang", "en")
    key = params.get("key", None)
    one = params.get("one", False)
    translations = Translation.get_translations(lang, key, one)
    if isinstance(translations, dict):
        translations = {
            k: v for k, v in translations.items() if not id_strings.is_custom_app_string(k) and "=" not in k
        }
    return json_response(translations)
Пример #2
0
def get_app_ui_translations(request, domain):
    params = json_request(request.GET)
    lang = params.get('lang', 'en')
    key = params.get('key', None)
    one = params.get('one', False)
    translations = Translation.get_translations(lang, key, one)
    if isinstance(translations, dict):
        translations = {k: v for k, v in translations.items()
                        if not id_strings.is_custom_app_string(k)
                        and '=' not in k}
    return json_response(translations)
Пример #3
0
def get_app_ui_translations(request, domain):
    params = json_request(request.GET)
    lang = params.get('lang', 'en')
    key = params.get('key', None)
    one = params.get('one', False)
    translations = Translation.get_translations(lang, key, one)
    if isinstance(translations, dict):
        translations = {k: v for k, v in translations.items()
                        if not id_strings.is_custom_app_string(k)
                        and '=' not in k}
    return json_response(translations)
Пример #4
0
def get_translations(request):
    params = json_request(request.GET)
    lang = params.get('lang', 'en')
    key = params.get('key', None)
    one = params.get('one', False)
    return json_response(Translation.get_translations(lang, key, one))
Пример #5
0
def get_translations(request):
    params = json_request(request.GET)
    lang = params.get('lang', 'en')
    key  = params.get('key', None)
    one  = params.get('one', False)
    return json_response(Translation.get_translations(lang, key, one))