GUACAMOLE-1293: Tweak translation names to match arguments and use translation service to canonicalize.

This commit is contained in:
Virtually Nick
2023-01-04 21:56:16 -05:00
parent b666aebce8
commit 934e437900
2 changed files with 8 additions and 5 deletions

View File

@@ -44,6 +44,9 @@ angular.module('client').directive('guacClientMessage', [function guacClientMess
// Required types // Required types
const ManagedClientMessage = $injector.get('ManagedClientMessage'); const ManagedClientMessage = $injector.get('ManagedClientMessage');
// Required services
var translationStringService = $injector.get('translationStringService');
/** /**
* Uses the msgcode to retrieve the correct translation key for * Uses the msgcode to retrieve the correct translation key for
* the client message. * the client message.
@@ -56,7 +59,7 @@ angular.module('client').directive('guacClientMessage', [function guacClientMess
if (Object.values(Guacamole.Client.Message).includes($scope.message.msgcode)) 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); 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);
}; };
/** /**

View File

@@ -72,10 +72,6 @@
"ACTION_SHARE" : "@:APP.ACTION_SHARE", "ACTION_SHARE" : "@:APP.ACTION_SHARE",
"ACTION_UPLOAD_FILES" : "Upload Files", "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_CONNECTING" : "Connecting",
"DIALOG_HEADER_CONNECTION_ERROR" : "Connection Error", "DIALOG_HEADER_CONNECTION_ERROR" : "Connection Error",
"DIALOG_HEADER_DISCONNECTED" : "Disconnected", "DIALOG_HEADER_DISCONNECTED" : "Disconnected",
@@ -133,6 +129,10 @@
"INFO_CONNECTION_SHARED" : "This connection is now shared.", "INFO_CONNECTION_SHARED" : "This connection is now shared.",
"INFO_NO_FILE_TRANSFERS" : "No file transfers.", "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_NONE" : "None",
"NAME_INPUT_METHOD_OSK" : "On-screen keyboard", "NAME_INPUT_METHOD_OSK" : "On-screen keyboard",
"NAME_INPUT_METHOD_TEXT" : "Text input", "NAME_INPUT_METHOD_TEXT" : "Text input",