Final translations for Settings

This commit is contained in:
kiswa 2017-03-15 21:36:25 +00:00
parent 99329f3eaa
commit 84ce6121f5
5 changed files with 53 additions and 27 deletions

View File

@ -146,6 +146,7 @@ export class AutoActions {
this.types = this.typesList;
this.updateTriggerSources();
this.updateActionSources();
this.updateActiveUser(this.activeUser);
});
}
@ -251,6 +252,10 @@ export class AutoActions {
let desc = '',
board = this.getBoard(action.board_id);
if (!board) {
return;
}
switch (+action.trigger) {
case ActionTrigger.MovedToColumn:
desc = this.strings.settings_triggerMoveToColumn + ' ';
@ -278,6 +283,10 @@ export class AutoActions {
let desc = '',
board = this.getBoard(action.board_id);
if (!board) {
return;
}
switch (+action.type) {
case ActionType.SetColor:
desc = this.strings.settings_actionSetColor + ' <span style="background-color: ' +
@ -389,12 +398,10 @@ export class AutoActions {
+activeUser.user_option_id,
activeUser.username,
activeUser.board_access);
this.noActionsMessage = 'There are no current automatic actions. ' +
'Use the Add Action form below to add one.';
this.noActionsMessage = this.strings.settings_noActions;
if (activeUser.security_level === 3) {
this.noActionsMessage = 'There are no automatic actions. ' +
'Contact an admin user to create one.';
if (activeUser.security_level < 3) {
this.noActionsMessage = this.strings.settings_noActionsAdmin;
}
}

View File

@ -80,6 +80,7 @@ export class BoardAdmin {
});
stringsService.stringsChanged.subscribe(newStrings => {
this.strings = newStrings;
this.updateActiveUser(this.activeUser);
});
}
@ -262,16 +263,14 @@ export class BoardAdmin {
private validateBoard(): boolean {
if (this.modalProps.name === '') {
this.notes
.add(new Notification('error',
'Board name is required.'));
this.notes.add(
new Notification('error', this.strings.settings_boardNameError));
return false;
}
if (this.modalProps.columns.length === 0) {
this.notes
.add(new Notification('error',
'At least one column is required.'));
this.notes.add(
new Notification('error', this.strings.settings_columnError));
return false;
}
@ -318,12 +317,10 @@ export class BoardAdmin {
activeUser.username,
activeUser.board_access);
this.noBoardsMessage = 'You are not assigned to any boards. ' +
'Contact an admin user to be added to a board.';
this.noBoardsMessage = this.strings.settings_noBoards;
if (+activeUser.security_level === 1) {
this.noBoardsMessage = 'There are no current boards. ' +
'Use the <strong>Add Board</strong> button below to add one.';
this.noBoardsMessage = this.strings.settings_noBoardsAdmin;
}
}

View File

@ -204,19 +204,20 @@ export class UserAdmin {
let user = this.modalProps.user;
if (user.username === '') {
this.notes.add(new Notification('error', 'Username is required.'));
this.notes.add(
new Notification('error', this.strings.settings_usernameRequired));
return false;
}
if (this.modalProps.prefix && user.password === '') {
this.notes.add(new Notification('error', 'Password is required.'));
this.notes.add(
new Notification('error', this.strings.settings_passwordRequired));
return false;
}
if (user.password !== user.password_verify) {
this.notes.add(new Notification(
'error',
'New password and verify password do not match.'));
this.notes.add(
new Notification('error', this.strings.settings_verifyError));
return false;
}
@ -224,7 +225,8 @@ export class UserAdmin {
let match = user.email.match(emailRegex);
if (!match && user.email !== '') {
this.notes.add(new Notification('error', 'Invalid email address.'));
this.notes.add(
new Notification('error', this.strings.settings_emailError));
return false;
}
@ -253,17 +255,17 @@ export class UserAdmin {
return filtered[0].name;
}
return 'None';
return this.strings.none;
}
private updateUserList(): void {
this.users.forEach((user: UserDisplay) => {
user.default_board_name = this.getDefaultBoardName(user);
user.security_level_name = +user.security_level === 1
? 'Admin'
? this.strings.settings_admin
: +user.security_level === 2
? 'Board Admin'
: 'User';
? this.strings.settings_boardAdmin
: this.strings.settings_user;
user.can_admin = true;
if (+user.id === +this.activeUser.id ||

View File

@ -52,6 +52,10 @@
"settings_boardAccess": "Board Access",
"settings_boardAdmin": "Board Admin",
"settings_admin": "Admin",
"settings_usernameRequired": "Username is required.",
"settings_passwordRequired": "Password is required.",
"settings_verifyError": "New password and verify password do not match.",
"settings_emailError": "Invalid email address.",
"settings_boardAdministration": "Board Administration",
"settings_currentBoards": "Current Boards",
@ -90,6 +94,10 @@
"settings_boardAdminMessage": "Including a Board Admin, makes them an admin of this board.",
"settings_adminAccessMessage": "Administrators have access to all boards and are not listed here.",
"settings_saveBoard": "Save Board",
"settings_noBoards": "You are not assigned to any boards. Contact an admin user to be added to a board.",
"settings_noBoardsAdmin": "There are no current boards. Use the <strong>Add Board</strong> button below to add one.",
"settings_boardNameError": "Board name is required.",
"settings_columnError": "At least one column is required.",
"settings_automaticActions": "Automatic Actions",
"settings_currentAction": "Current Actions",
@ -118,6 +126,8 @@
"settings_selectUser": "Select User",
"settings_selectCategory": "Select Category",
"settings_selectAssignee": "Select Assignee",
"settings_alterByPoints": "Alter color by points"
"settings_alterByPoints": "Alter color by points",
"settings_noActions": "There are no automatic actions. Contact an admin user to create one.",
"settings_noActionsAdmin": "There are no automatic actions. Use the <strong>Add Action</strong> form below to add one."
}

View File

@ -52,6 +52,10 @@
"settings_boardAccess": "Acceso a los Tableros",
"settings_boardAdmin": "Administrador de los Tableros",
"settings_admin": "Administrador",
"settings_usernameRequired": "Se requiere nombre de usuario.",
"settings_passwordRequired": "Se requiere contraseña.",
"settings_verifyError": "La nueva contraseña y la contraseña de verificación no coinciden.",
"settings_emailError": "Email no válida.",
"settings_boardAdministration": "Administración de Tableros",
"settings_currentBoards": "Tableros Actuales",
@ -90,6 +94,10 @@
"settings_boardAdminMessage": "Incluyendo un Administrador de Tableros, hace de ellos un administrador de este tablero.",
"settings_adminAccessMessage": "Los administradores tienen acceso a todas las tableros y no se enumeran aquí.",
"settings_saveBoard": "Guardar Tablero",
"settings_noBoards": "Usted no está asignado a ninguno tablero. Póngase en contacto con un usuario de administración para que se agregue a un tablero.",
"settings_noBoardsAdmin": "No hay tablas actuales. Utilice el botón <strong>Agregar Tablero</strong> a continuación para agregar uno.",
"settings_boardNameError": "El nombre del Tablero es obligatorio.",
"settings_columnError": "Se requiere al menos una columna.",
"settings_automaticActions": "Acciones Automáticas",
"settings_currentAction": "Acción Actual",
@ -118,6 +126,8 @@
"settings_selectUser": "Seleccionar Usuario",
"settings_selectCategory": "Seleccionar Categoría",
"settings_selectAssignee": "Seleccionar Cesionario",
"settings_alterByPoints": "Alterar color por puntos"
"settings_alterByPoints": "Alterar color por puntos",
"settings_noActions": "No hay acciones automáticas. Póngase en contacto con un usuario administrador para crear uno.",
"settings_noActionsAdmin": "No hay acciones automáticas. Utilice el botón <strong>Agregar Acción</strong> de abajo para agregar uno."
}