server: refactor connect/disconnect popup messages localization

This commit is contained in:
Palakis 2017-11-13 15:56:46 +01:00
parent 3ecb9702ef
commit 952f3a586a
3 changed files with 24 additions and 18 deletions

View File

@ -101,13 +101,15 @@ void WSServer::onNewConnection() {
blog(LOG_INFO, "new client connection from %s:%d", blog(LOG_INFO, "new client connection from %s:%d",
clientIp.toUtf8().constData(), pSocket->peerPort()); clientIp.toUtf8().constData(), pSocket->peerPort());
QString msg = QString(obs_module_text("OBSWebsocket.ConnectNotify.ClientIP")) obs_frontend_push_ui_translation(obs_module_get_string);
+ QString(" ")
+ Utils::FormatIPAddress(clientAddr);
Utils::SysTrayNotify(msg, QString title = tr("OBSWebsocket.NotifyConnect.Title");
QSystemTrayIcon::Information, QString msg = tr("OBSWebsocket.NotifyConnect.Message")
QString(obs_module_text("OBSWebsocket.ConnectNotify.Connected"))); .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", blog(LOG_INFO, "client %s:%d disconnected",
clientIp.toUtf8().constData(), pSocket->peerPort()); clientIp.toUtf8().constData(), pSocket->peerPort());
QString msg = QString(obs_module_text("OBSWebsocket.ConnectNotify.ClientIP")) obs_frontend_push_ui_translation(obs_module_get_string);
+ QString(" ")
+ Utils::FormatIPAddress(clientAddr);
Utils::SysTrayNotify(msg, QString title = tr("OBSWebsocket.NotifyDisconnect.Title");
QSystemTrayIcon::Information, QString msg = tr("OBSWebsocket.NotifyDisconnect.Message")
QString(obs_module_text("OBSWebsocket.ConnectNotify.Disconnected"))); .arg(Utils::FormatIPAddress(clientAddr));
Utils::SysTrayNotify(msg, QSystemTrayIcon::Information, title);
obs_frontend_pop_ui_translation();
} }
} }

View File

@ -6,6 +6,7 @@ OBSWebsocket.Settings.AuthRequired="Enable authentication"
OBSWebsocket.Settings.Password="Password" OBSWebsocket.Settings.Password="Password"
OBSWebsocket.Settings.DebugEnable="Enable debug logging" OBSWebsocket.Settings.DebugEnable="Enable debug logging"
OBSWebsocket.Settings.AlertsEnable="Enable System Tray Alerts" OBSWebsocket.Settings.AlertsEnable="Enable System Tray Alerts"
OBSWebsocket.ConnectNotify.Connected="New WebSocket connection" OBSWebsocket.NotifyConnect.Title="New WebSocket connection"
OBSWebsocket.ConnectNotify.Disconnected="WebSocket client disconnected" OBSWebsocket.NotifyConnect.Message="Client %1 connected"
OBSWebsocket.ConnectNotify.ClientIP="Client Address:" OBSWebsocket.NotifyDisconnect.Title="WebSocket client disconnected"
OBSWebsocket.NotifyDisconnect.Message="Client %1 disconnected"

View File

@ -6,6 +6,7 @@ OBSWebsocket.Settings.AuthRequired="Activer l'authentification"
OBSWebsocket.Settings.Password="Mot de passe" OBSWebsocket.Settings.Password="Mot de passe"
OBSWebsocket.Settings.DebugEnable="Débogage dans le fichier journal" OBSWebsocket.Settings.DebugEnable="Débogage dans le fichier journal"
OBSWebsocket.Settings.AlertsEnable="Notifications de connexion/déconnexion" OBSWebsocket.Settings.AlertsEnable="Notifications de connexion/déconnexion"
OBSWebsocket.ConnectNotify.Connected="Nouvelle connexion WebSocket" OBSWebsocket.NotifyConnect.Title="Nouvelle connexion WebSocket"
OBSWebsocket.ConnectNotify.Disconnected="Déconnexion WebSocket" OBSWebsocket.NotifyConnect.Message="Le client %1 s'est connecté"
OBSWebsocket.ConnectNotify.ClientIP="Adresse du client :" OBSWebsocket.NotifyDisconnect.Title="Déconnexion WebSocket"
OBSWebsocket.NotifyDisconnect.Message="Le client %1 s'est déconnecté"