fix: storage translate

This commit is contained in:
zhaojisen
2026-06-25 10:38:10 +08:00
committed by feng626
parent c78d4699b5
commit e713c8cc52
9 changed files with 113 additions and 1 deletions

View File

@@ -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"

View File

@@ -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 "オフラインビデオプレーヤー"

View File

@@ -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 "오프라인 비디오 플레이어"

View File

@@ -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"

View File

@@ -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 "Офлайн видеоплеер"

View File

@@ -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"

View File

@@ -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 "离线录像播放器"

View File

@@ -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 "離線錄影播放器"

View File

@@ -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")