diff --git a/apps/i18n/core/es/LC_MESSAGES/django.po b/apps/i18n/core/es/LC_MESSAGES/django.po index eac739e00..efd76400e 100644 --- a/apps/i18n/core/es/LC_MESSAGES/django.po +++ b/apps/i18n/core/es/LC_MESSAGES/django.po @@ -13225,6 +13225,18 @@ msgstr "Importación de licencia exitosa" msgid "Invalid license" msgstr "Licencia no válida" +msgid "Connection refused" +msgstr "Conexión rechazada" + +msgid "Connection timeout" +msgstr "Tiempo de conexión agotado" + +msgid "Unable to resolve the address" +msgstr "No se puede resolver la dirección" + +msgid "Unable to connect to the host" +msgstr "No se puede conectar al host" + #~ msgid "Offline video player" #~ msgstr "Reproductor de video fuera de línea" diff --git a/apps/i18n/core/ja/LC_MESSAGES/django.po b/apps/i18n/core/ja/LC_MESSAGES/django.po index d92c5199b..6b6b1a04e 100644 --- a/apps/i18n/core/ja/LC_MESSAGES/django.po +++ b/apps/i18n/core/ja/LC_MESSAGES/django.po @@ -12778,6 +12778,18 @@ msgstr "ライセンスのインポートに成功" msgid "Invalid license" msgstr "ライセンスが無効です" +msgid "Connection refused" +msgstr "接続が拒否されました" + +msgid "Connection timeout" +msgstr "接続がタイムアウトしました" + +msgid "Unable to resolve the address" +msgstr "アドレスを解決できません" + +msgid "Unable to connect to the host" +msgstr "ホストに接続できません" + #~ msgid "Offline video player" #~ msgstr "オフラインビデオプレーヤー" diff --git a/apps/i18n/core/ko/LC_MESSAGES/django.po b/apps/i18n/core/ko/LC_MESSAGES/django.po index 9799aa6b3..a4572f16f 100644 --- a/apps/i18n/core/ko/LC_MESSAGES/django.po +++ b/apps/i18n/core/ko/LC_MESSAGES/django.po @@ -12786,6 +12786,18 @@ msgstr "라이센스 가져오기 성공" msgid "Invalid license" msgstr "라이센스가 유효하지 않습니다." +msgid "Connection refused" +msgstr "연결이 거부되었습니다" + +msgid "Connection timeout" +msgstr "연결 시간이 초과되었습니다" + +msgid "Unable to resolve the address" +msgstr "주소를 확인할 수 없습니다" + +msgid "Unable to connect to the host" +msgstr "호스트에 연결할 수 없습니다" + #~ msgid "Offline video player" #~ msgstr "오프라인 비디오 플레이어" diff --git a/apps/i18n/core/pt_BR/LC_MESSAGES/django.po b/apps/i18n/core/pt_BR/LC_MESSAGES/django.po index 62b74fdd5..08ab023a3 100644 --- a/apps/i18n/core/pt_BR/LC_MESSAGES/django.po +++ b/apps/i18n/core/pt_BR/LC_MESSAGES/django.po @@ -12920,6 +12920,18 @@ msgstr "Importação de licença bem-sucedida" msgid "Invalid license" msgstr "Licença inválida" +msgid "Connection refused" +msgstr "Conexão recusada" + +msgid "Connection timeout" +msgstr "Tempo de conexão esgotado" + +msgid "Unable to resolve the address" +msgstr "Não foi possível resolver o endereço" + +msgid "Unable to connect to the host" +msgstr "Não foi possível conectar ao host" + #~ msgid "Offline video player" #~ msgstr "Reprodutor de Gravação Offline" diff --git a/apps/i18n/core/ru/LC_MESSAGES/django.po b/apps/i18n/core/ru/LC_MESSAGES/django.po index d651bdd18..d4512cd39 100644 --- a/apps/i18n/core/ru/LC_MESSAGES/django.po +++ b/apps/i18n/core/ru/LC_MESSAGES/django.po @@ -12946,6 +12946,18 @@ msgstr "Лицензия успешно импортирована" msgid "Invalid license" msgstr "Лицензия недействительна" +msgid "Connection refused" +msgstr "Соединение отклонено" + +msgid "Connection timeout" +msgstr "Тайм-аут соединения" + +msgid "Unable to resolve the address" +msgstr "Не удалось разрешить адрес" + +msgid "Unable to connect to the host" +msgstr "Не удалось подключиться к хосту" + #~ msgid "Offline video player" #~ msgstr "Офлайн видеоплеер" diff --git a/apps/i18n/core/vi/LC_MESSAGES/django.po b/apps/i18n/core/vi/LC_MESSAGES/django.po index f1b73131a..de97f2dfe 100644 --- a/apps/i18n/core/vi/LC_MESSAGES/django.po +++ b/apps/i18n/core/vi/LC_MESSAGES/django.po @@ -12966,6 +12966,18 @@ msgstr "Nhập giấy phép thành công" msgid "Invalid license" msgstr "Giấy phép không hợp lệ" +msgid "Connection refused" +msgstr "Kết nối bị từ chối" + +msgid "Connection timeout" +msgstr "Hết thời gian kết nối" + +msgid "Unable to resolve the address" +msgstr "Không thể phân giải địa chỉ" + +msgid "Unable to connect to the host" +msgstr "Không thể kết nối đến máy chủ" + #~ msgid "Offline video player" #~ msgstr "Trình phát video ngoại tuyến" diff --git a/apps/i18n/core/zh/LC_MESSAGES/django.po b/apps/i18n/core/zh/LC_MESSAGES/django.po index 42fce58ac..042fb4a22 100644 --- a/apps/i18n/core/zh/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh/LC_MESSAGES/django.po @@ -12468,6 +12468,18 @@ msgstr "许可证导入成功" msgid "Invalid license" msgstr "许可证无效" +msgid "Connection refused" +msgstr "连接被拒绝" + +msgid "Connection timeout" +msgstr "连接超时" + +msgid "Unable to resolve the address" +msgstr "无法解析地址" + +msgid "Unable to connect to the host" +msgstr "无法连接到主机" + #~ msgid "Offline video player" #~ msgstr "离线录像播放器" diff --git a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po index 971c7f22c..9bd86ec3e 100644 --- a/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po +++ b/apps/i18n/core/zh_Hant/LC_MESSAGES/django.po @@ -12490,6 +12490,18 @@ msgstr "許可證匯入成功" msgid "Invalid license" msgstr "許可證無效" +msgid "Connection refused" +msgstr "連線被拒絕" + +msgid "Connection timeout" +msgstr "連線逾時" + +msgid "Unable to resolve the address" +msgstr "無法解析位址" + +msgid "Unable to connect to the host" +msgstr "無法連線到主機" + #~ msgid "Offline video player" #~ msgstr "離線錄影播放器" diff --git a/apps/terminal/api/component/storage.py b/apps/terminal/api/component/storage.py index 9465106a8..6e7d3d1a9 100644 --- a/apps/terminal/api/component/storage.py +++ b/apps/terminal/api/component/storage.py @@ -123,13 +123,29 @@ class ReplayStorageViewSet(BaseStorageViewSetMixin, viewsets.ModelViewSet): class BaseStorageTestConnectiveMixin: + error_keywords_map = [ + ('authentication failed', _('Authentication failed')), + ('connection refused', _('Connection refused')), + ('timed out', _('Connection timeout')), + ('name or service not known', _('Unable to resolve the address')), + ('no route to host', _('Unable to connect to the host')), + ] + + def get_test_failure_msg(self, error): + raw = str(error) + lower = raw.lower() + for keyword, message in self.error_keywords_map: + if keyword in lower: + return _("Test failure: {}").format(message) + return _("Test failure: {}").format(raw) + def retrieve(self, request, *args, **kwargs): instance = self.get_object() try: is_valid = instance.is_valid() except Exception as e: is_valid = False - msg = _("Test failure: {}".format(str(e))) + msg = self.get_test_failure_msg(e) else: if is_valid: msg = _("Test successful")