From 934e4379003ec9a78f450a3c30e1b4102ab14c80 Mon Sep 17 00:00:00 2001 From: Virtually Nick Date: Wed, 4 Jan 2023 21:56:16 -0500 Subject: [PATCH] GUACAMOLE-1293: Tweak translation names to match arguments and use translation service to canonicalize. --- .../src/app/client/directives/guacClientMessage.js | 5 ++++- guacamole/src/main/frontend/src/translations/en.json | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/guacamole/src/main/frontend/src/app/client/directives/guacClientMessage.js b/guacamole/src/main/frontend/src/app/client/directives/guacClientMessage.js index 7bc4b6b6a..5348179d0 100644 --- a/guacamole/src/main/frontend/src/app/client/directives/guacClientMessage.js +++ b/guacamole/src/main/frontend/src/app/client/directives/guacClientMessage.js @@ -44,6 +44,9 @@ angular.module('client').directive('guacClientMessage', [function guacClientMess // Required types const ManagedClientMessage = $injector.get('ManagedClientMessage'); + // Required services + var translationStringService = $injector.get('translationStringService'); + /** * Uses the msgcode to retrieve the correct translation key for * the client message. @@ -56,7 +59,7 @@ angular.module('client').directive('guacClientMessage', [function guacClientMess if (Object.values(Guacamole.Client.Message).includes($scope.message.msgcode)) msgString = Object.keys(Guacamole.Client.Message).find(key => Guacamole.Client.Message[key] === $scope.message.msgcode); - return "CLIENT.CLIENT_MESSAGE_" + msgString.toUpperCase(); + return "CLIENT.MESSAGE_" + translationStringService.canonicalize(msgString); }; /** diff --git a/guacamole/src/main/frontend/src/translations/en.json b/guacamole/src/main/frontend/src/translations/en.json index 02e103974..208b4588b 100644 --- a/guacamole/src/main/frontend/src/translations/en.json +++ b/guacamole/src/main/frontend/src/translations/en.json @@ -72,10 +72,6 @@ "ACTION_SHARE" : "@:APP.ACTION_SHARE", "ACTION_UPLOAD_FILES" : "Upload Files", - "CLIENT_MESSAGE_DEFAULT" : "", - "CLIENT_MESSAGE_JOINED" : "User {ARGS_1} has joined the connection.", - "CLIENT_MESSAGE_LEFT" : "User {ARGS_1} has left the connection.", - "DIALOG_HEADER_CONNECTING" : "Connecting", "DIALOG_HEADER_CONNECTION_ERROR" : "Connection Error", "DIALOG_HEADER_DISCONNECTED" : "Disconnected", @@ -133,6 +129,10 @@ "INFO_CONNECTION_SHARED" : "This connection is now shared.", "INFO_NO_FILE_TRANSFERS" : "No file transfers.", + "MESSAGE_DEFAULT" : "", + "MESSAGE_USER_JOINED" : "User {ARGS_1} has joined the connection.", + "MESSAGE_USER_LEFT" : "User {ARGS_1} has left the connection.", + "NAME_INPUT_METHOD_NONE" : "None", "NAME_INPUT_METHOD_OSK" : "On-screen keyboard", "NAME_INPUT_METHOD_TEXT" : "Text input",