forked from xiaozhi/xiaozhi-esp32
Modify error messages
This commit is contained in:
@@ -22,9 +22,10 @@
|
||||
"LISTENING": "Listening...",
|
||||
"SPEAKING": "Speaking...",
|
||||
|
||||
"UNABLE_TO_CONNECT_TO_SERVICE": "Unable to connect to service, please try again later",
|
||||
"WAITING_FOR_RESPONSE_TIMEOUT": "Waiting for response timeout",
|
||||
"SENDING_FAILED_PLEASE_CHECK_THE_NETWORK": "Sending failed, please check the network",
|
||||
"SERVER_NOT_FOUND": "Looking for available service",
|
||||
"SERVER_NOT_CONNECTED": "Unable to connect to service, please try again later",
|
||||
"SERVER_TIMEOUT": "Waiting for response timeout",
|
||||
"SERVER_ERROR": "Sending failed, please check the network",
|
||||
|
||||
"CONNECT_TO_HOTSPOT": "Hotspot: ",
|
||||
"ACCESS_VIA_BROWSER": " Config URL: ",
|
||||
@@ -32,9 +33,6 @@
|
||||
"ENTERING_WIFI_CONFIG_MODE": "Entering Wi-Fi configuration mode...",
|
||||
"SCANNING_WIFI": "Scanning Wi-Fi...",
|
||||
|
||||
"UNABLE_TO_ESTABLISH_AUDIO_CHANNEL": "Unable to establish audio channel",
|
||||
"TEST": "Test",
|
||||
|
||||
"NEW_VERSION": "New version ",
|
||||
"OTA_UPGRADE": "OTA Upgrade",
|
||||
"UPGRADING": "System is upgrading...",
|
||||
|
||||
@@ -20,9 +20,10 @@
|
||||
"LISTENING":"聆听中...",
|
||||
"SPEAKING":"说话中...",
|
||||
|
||||
"UNABLE_TO_CONNECT_TO_SERVICE":"无法连接服务",
|
||||
"WAITING_FOR_RESPONSE_TIMEOUT":"等待响应超时",
|
||||
"SENDING_FAILED_PLEASE_CHECK_THE_NETWORK":"发送失败,请检查网络",
|
||||
"SERVER_NOT_FOUND":"正在寻找可用服务",
|
||||
"SERVER_NOT_CONNECTED":"无法连接服务,请稍后再试",
|
||||
"SERVER_TIMEOUT":"等待响应超时",
|
||||
"SERVER_ERROR":"发送失败,请检查网络",
|
||||
|
||||
"CONNECT_TO_HOTSPOT":"手机连接热点 ",
|
||||
"ACCESS_VIA_BROWSER":",浏览器访问 ",
|
||||
@@ -30,9 +31,6 @@
|
||||
"ENTERING_WIFI_CONFIG_MODE":"进入配网模式...",
|
||||
"SCANNING_WIFI":"扫描 Wi-Fi...",
|
||||
|
||||
"UNABLE_TO_ESTABLISH_AUDIO_CHANNEL": "无法建立音频通道",
|
||||
"TEST":"测试",
|
||||
|
||||
"NEW_VERSION": "新版本 ",
|
||||
"OTA_UPGRADE":"OTA 升级",
|
||||
"UPGRADING":"正在升级系统...",
|
||||
|
||||
@@ -47,7 +47,7 @@ bool MqttProtocol::StartMqttClient() {
|
||||
if (endpoint_.empty()) {
|
||||
ESP_LOGE(TAG, "MQTT endpoint is not specified");
|
||||
if (on_network_error_ != nullptr) {
|
||||
on_network_error_(Lang::Strings::UNABLE_TO_CONNECT_TO_SERVICE);
|
||||
on_network_error_(Lang::Strings::SERVER_NOT_FOUND);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -91,7 +91,7 @@ bool MqttProtocol::StartMqttClient() {
|
||||
if (!mqtt_->Connect(endpoint_, 8883, client_id_, username_, password_)) {
|
||||
ESP_LOGE(TAG, "Failed to connect to endpoint");
|
||||
if (on_network_error_ != nullptr) {
|
||||
on_network_error_(Lang::Strings::UNABLE_TO_CONNECT_TO_SERVICE);
|
||||
on_network_error_(Lang::Strings::SERVER_NOT_CONNECTED);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -107,7 +107,7 @@ void MqttProtocol::SendText(const std::string& text) {
|
||||
if (!mqtt_->Publish(publish_topic_, text)) {
|
||||
ESP_LOGE(TAG, "Failed to publish message");
|
||||
if (on_network_error_ != nullptr) {
|
||||
on_network_error_(Lang::Strings::SENDING_FAILED_PLEASE_CHECK_THE_NETWORK);
|
||||
on_network_error_(Lang::Strings::SERVER_ERROR);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -182,7 +182,7 @@ bool MqttProtocol::OpenAudioChannel() {
|
||||
if (!(bits & MQTT_PROTOCOL_SERVER_HELLO_EVENT)) {
|
||||
ESP_LOGE(TAG, "Failed to receive server hello");
|
||||
if (on_network_error_ != nullptr) {
|
||||
on_network_error_(Lang::Strings::WAITING_FOR_RESPONSE_TIMEOUT);
|
||||
on_network_error_(Lang::Strings::SERVER_TIMEOUT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ bool WebsocketProtocol::OpenAudioChannel() {
|
||||
if (!websocket_->Connect(url.c_str())) {
|
||||
ESP_LOGE(TAG, "Failed to connect to websocket server");
|
||||
if (on_network_error_ != nullptr) {
|
||||
on_network_error_(Lang::Strings::UNABLE_TO_CONNECT_TO_SERVICE);
|
||||
on_network_error_(Lang::Strings::SERVER_NOT_FOUND);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -120,7 +120,7 @@ bool WebsocketProtocol::OpenAudioChannel() {
|
||||
if (!(bits & WEBSOCKET_PROTOCOL_SERVER_HELLO_EVENT)) {
|
||||
ESP_LOGE(TAG, "Failed to receive server hello");
|
||||
if (on_network_error_ != nullptr) {
|
||||
on_network_error_(Lang::Strings::WAITING_FOR_RESPONSE_TIMEOUT);
|
||||
on_network_error_(Lang::Strings::SERVER_TIMEOUT);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user