diff --git a/.translate/export.py b/.translate/export.py index 911bccb6..d989ad65 100644 --- a/.translate/export.py +++ b/.translate/export.py @@ -21,8 +21,12 @@ def flatten(data): return flattened -key_query = '?key=' + main['key'] -response = requests.get(main['host'] + '/api/v3/brands/' + main['brand'] + '/languages/' + source_locale + '/dictionary' + key_query) +headers = { + 'accept': 'application/json', + 'x-api-key': main['key'], +} + +response = requests.get(main['host'] + '/api/v3/brands/' + main['brand'] + '/languages/' + source_locale + '/dictionary', headers=headers) if response.status_code != 200: print('could not fetch existing messages') exit() @@ -35,8 +39,7 @@ f.close() flattened = flatten(data) -url = main['host'] + '/api/v2/messages' + key_query -headers = {'accept': 'application/json'} +url = main['host'] + '/api/v2/messages' for key, value in flattened.items(): if key in messages: diff --git a/.translate/import.py b/.translate/import.py index 519f01c7..79d7bee7 100644 --- a/.translate/import.py +++ b/.translate/import.py @@ -41,10 +41,12 @@ config = configparser.ConfigParser() config.read('config') main = config['main'] -key_query = '?key=' + main['key'] -headers = {'accept': 'application/json'} +headers = { + 'accept': 'application/json', + 'x-api-key': main['key'], +} -response = requests.get(main['host'] + '/api/v2/brands/' + main['brand'] + '/languages' + key_query, headers=headers) +response = requests.get(main['host'] + '/api/v2/brands/' + main['brand'] + '/languages', headers=headers) if response.status_code != 200: raise Exception('Could not fetch brand languages') @@ -52,7 +54,7 @@ languages = json.loads(response.text) for language in languages: print(language['code']) - response = requests.get(main['host'] + '/api/v3/brands/' + main['brand'] + '/languages/' + language['code'] + '/dictionary' + key_query + '&fallback_locale=en_GB') + response = requests.get(main['host'] + '/api/v3/brands/' + main['brand'] + '/languages/' + language['code'] + '/dictionary?fallback_locale=en_GB', headers=headers) if response.status_code != 200: print('could not fetch translations for messages: %s' % language['code']) continue diff --git a/frontend/src/i18n/ru_RU.json b/frontend/src/i18n/ru_RU.json index d2736d45..019acc96 100644 --- a/frontend/src/i18n/ru_RU.json +++ b/frontend/src/i18n/ru_RU.json @@ -73,11 +73,11 @@ "metadata": "Метаданные", "multipleSelectionEnabled": "Мультивыбор включен", "name": "Имя", + "noPreview": "Preview is not available for this file.", "size": "Размер", "sortByLastModified": "Сортировка по дате изменения", "sortByName": "Сортировка по имени", - "sortBySize": "Сортировка по размеру", - "noPreview": "Предварительный просмотр для этого файла недоступен." + "sortBySize": "Сортировка по размеру" }, "help": { "click": "выбрать файл или каталог",