From eaa04800a42b8cd8496ff613dd0d17055e6e477e Mon Sep 17 00:00:00 2001 From: Yoshie Muranaka Date: Fri, 28 Feb 2020 13:21:27 -0800 Subject: Add translation to user management page Updated TableToolbar component to handle label translation outside of the component which is more consistent with bootstrap table component patterns. Signed-off-by: Yoshie Muranaka Change-Id: Ic2e75e327f6a6067905c541f9a3ea55c5d103f4b --- src/components/Global/TableRowAction.vue | 4 +- src/components/Global/TableToolbar.vue | 4 +- src/locales/en.json | 32 ++++++++ .../LocalUserManagement/LocalUserManagement.vue | 50 ++++++++----- .../LocalUserManagement/ModalUser.vue | 85 ++++++++++++++-------- .../LocalUserManagement/TableRoles.vue | 36 ++++++--- 6 files changed, 148 insertions(+), 63 deletions(-) (limited to 'src') diff --git a/src/components/Global/TableRowAction.vue b/src/components/Global/TableRowAction.vue index da936b6d..d41fd50c 100644 --- a/src/components/Global/TableRowAction.vue +++ b/src/components/Global/TableRowAction.vue @@ -1,13 +1,13 @@ diff --git a/src/components/Global/TableToolbar.vue b/src/components/Global/TableToolbar.vue index e28151cb..041a9c18 100644 --- a/src/components/Global/TableToolbar.vue +++ b/src/components/Global/TableToolbar.vue @@ -13,7 +13,7 @@ class="d-block" @click="$emit('batchAction', action.value)" > - {{ $t(action.labelKey) }} + {{ action.label }} { return prop.every(action => { return ( - action.hasOwnProperty('value') && action.hasOwnProperty('labelKey') + action.hasOwnProperty('value') && action.hasOwnProperty('label') ); }); } diff --git a/src/locales/en.json b/src/locales/en.json index c94e194a..44a57ba0 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -14,6 +14,8 @@ }, "form": { "fieldRequired": "Field required", + "invalidFormat": "Invalid format", + "lengthMustBeBetween": "Length must be between %{min} – %{max} characters", "mustBeAtLeast": "Must be at least %{value}", "selectAnOption": "Select an option", "valueMustBeBetween": "Value must be between %{min} – %{max}" @@ -53,13 +55,43 @@ }, "pageLocalUserManagement": { "accountPolicySettings": "Account policy settings", + "addUser": "Add user", + "deleteUser": "Delete user", + "editUser": "Edit user", + "viewPrivilegeRoleDescriptions": "View privilege role descriptions", "modal": { + "accountStatus": "Account status", "automaticAfterTimeout": "Automatic after timeout", + "cannotStartWithANumber": "Cannot start with a number", + "confirmUserPassword": "Confirm user password", + "deleteConfirmMessage": "Are you sure you want to delete user '%{user}'? This action cannot be undone.", "manual": "Manual", "maxFailedLoginAttempts": "Max failed login attempts", + "noSpecialCharactersExceptUnderscore": "No special characters except underscore", + "passwordMustBeBetween": "Password must be between %{min} – %{max} characters", + "passwordsDoNotMatch": "Passwords do not match", + "privilege": "Privilege", "timeoutDurationSeconds": "Timeout duration (seconds)", + "username": "Username", + "userPassword": "User password", "userUnlockMethod": "User unlock method" }, + "table": { + "privilege": "Privilege", + "status": "Status", + "username": "Username" + }, + "tableRoles": { + "configureComponentsManagedByThisService": "Configure components managed by this service", + "configureManagerResources": "Configure manager resources", + "configureUsersAndTheirAccounts": "Configure users and their accounts", + "ipmiAccessPoint": "IPMI access point", + "logInToTheServiceAndReadResources": "Log in to the service and read resources", + "redfishAccessPoint": "Redfish access point", + "sshAccessPoint": "SSH access point", + "updatePasswordForCurrentUserAccount": "Update password for current user account", + "webUiAccessPoint": "WebUI access point" + }, "toast": { "errorDeleteUsers": "Error deleting %{count} user. | Error deleting %{count} users.", "errorDisableUsers": "Error disabling %{count} user. | Error disabling %{count} users.", diff --git a/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue b/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue index 7b337a4f..23b06dd7 100644 --- a/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue +++ b/src/views/AccessControl/LocalUserManagement/LocalUserManagement.vue @@ -4,11 +4,11 @@ - Account policy settings + {{ $t('pageLocalUserManagement.accountPolicySettings') }} - Add user + {{ $t('pageLocalUserManagement.addUser') }} @@ -52,6 +52,7 @@ :key="index" :value="action.value" :enabled="action.enabled" + :title="action.title" @click:tableAction="onTableRowAction($event, item)" >