diff --git a/WSServer.cpp b/WSServer.cpp index 38d8b51a..af330a42 100644 --- a/WSServer.cpp +++ b/WSServer.cpp @@ -101,13 +101,15 @@ void WSServer::onNewConnection() { blog(LOG_INFO, "new client connection from %s:%d", clientIp.toUtf8().constData(), pSocket->peerPort()); - QString msg = QString(obs_module_text("OBSWebsocket.ConnectNotify.ClientIP")) - + QString(" ") - + Utils::FormatIPAddress(clientAddr); + obs_frontend_push_ui_translation(obs_module_get_string); - Utils::SysTrayNotify(msg, - QSystemTrayIcon::Information, - QString(obs_module_text("OBSWebsocket.ConnectNotify.Connected"))); + QString title = tr("OBSWebsocket.NotifyConnect.Title"); + QString msg = tr("OBSWebsocket.NotifyConnect.Message") + .arg(Utils::FormatIPAddress(clientAddr)); + + Utils::SysTrayNotify(msg, QSystemTrayIcon::Information, title); + + obs_frontend_pop_ui_translation(); } } @@ -136,12 +138,14 @@ void WSServer::onSocketDisconnected() { blog(LOG_INFO, "client %s:%d disconnected", clientIp.toUtf8().constData(), pSocket->peerPort()); - QString msg = QString(obs_module_text("OBSWebsocket.ConnectNotify.ClientIP")) - + QString(" ") - + Utils::FormatIPAddress(clientAddr); + obs_frontend_push_ui_translation(obs_module_get_string); - Utils::SysTrayNotify(msg, - QSystemTrayIcon::Information, - QString(obs_module_text("OBSWebsocket.ConnectNotify.Disconnected"))); + QString title = tr("OBSWebsocket.NotifyDisconnect.Title"); + QString msg = tr("OBSWebsocket.NotifyDisconnect.Message") + .arg(Utils::FormatIPAddress(clientAddr)); + + Utils::SysTrayNotify(msg, QSystemTrayIcon::Information, title); + + obs_frontend_pop_ui_translation(); } } diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 892bae6d..1387db63 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -6,6 +6,7 @@ OBSWebsocket.Settings.AuthRequired="Enable authentication" OBSWebsocket.Settings.Password="Password" OBSWebsocket.Settings.DebugEnable="Enable debug logging" OBSWebsocket.Settings.AlertsEnable="Enable System Tray Alerts" -OBSWebsocket.ConnectNotify.Connected="New WebSocket connection" -OBSWebsocket.ConnectNotify.Disconnected="WebSocket client disconnected" -OBSWebsocket.ConnectNotify.ClientIP="Client Address:" \ No newline at end of file +OBSWebsocket.NotifyConnect.Title="New WebSocket connection" +OBSWebsocket.NotifyConnect.Message="Client %1 connected" +OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected" +OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected" \ No newline at end of file diff --git a/data/locale/fr-FR.ini b/data/locale/fr-FR.ini index 631bc522..1f37623c 100644 --- a/data/locale/fr-FR.ini +++ b/data/locale/fr-FR.ini @@ -6,6 +6,7 @@ OBSWebsocket.Settings.AuthRequired="Activer l'authentification" OBSWebsocket.Settings.Password="Mot de passe" OBSWebsocket.Settings.DebugEnable="Débogage dans le fichier journal" OBSWebsocket.Settings.AlertsEnable="Notifications de connexion/déconnexion" -OBSWebsocket.ConnectNotify.Connected="Nouvelle connexion WebSocket" -OBSWebsocket.ConnectNotify.Disconnected="Déconnexion WebSocket" -OBSWebsocket.ConnectNotify.ClientIP="Adresse du client :" \ No newline at end of file +OBSWebsocket.NotifyConnect.Title="Nouvelle connexion WebSocket" +OBSWebsocket.NotifyConnect.Message="Le client %1 s'est connecté" +OBSWebsocket.NotifyDisconnect.Title="Déconnexion WebSocket" +OBSWebsocket.NotifyDisconnect.Message="Le client %1 s'est déconnecté" \ No newline at end of file