Merge pull request #3953 from ninjadq/fix_text_bugs

Fix bugs about i18n & text
This commit is contained in:
Qian Deng 2018-01-18 13:19:02 +08:00 committed by GitHub
commit b61e0ec867
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 25 additions and 19 deletions

View File

@ -20,7 +20,7 @@ import { ConfirmationState, ConfirmationTargets, ConfirmationButtons } from '../
import { CONFIRMATION_DIALOG_TEMPLATE } from './confirmation-dialog.component.html'; import { CONFIRMATION_DIALOG_TEMPLATE } from './confirmation-dialog.component.html';
import { CONFIRMATION_DIALOG_STYLE } from './confirmation-dialog.component.css'; import { CONFIRMATION_DIALOG_STYLE } from './confirmation-dialog.component.css';
import {BatchInfo} from "./confirmation-batch-message"; import {BatchInfo} from './confirmation-batch-message';
@Component({ @Component({
selector: 'confirmation-dialog', selector: 'confirmation-dialog',
@ -29,16 +29,16 @@ import {BatchInfo} from "./confirmation-batch-message";
}) })
export class ConfirmationDialogComponent { export class ConfirmationDialogComponent {
opened: boolean = false; opened = false;
dialogTitle: string = ""; dialogTitle = '';
dialogContent: string = ""; dialogContent = '';
message: ConfirmationMessage; message: ConfirmationMessage;
buttons: ConfirmationButtons; buttons: ConfirmationButtons;
@Output() confirmAction = new EventEmitter<ConfirmationAcknowledgement>(); @Output() confirmAction = new EventEmitter<ConfirmationAcknowledgement>();
@Output() cancelAction = new EventEmitter<ConfirmationAcknowledgement>(); @Output() cancelAction = new EventEmitter<ConfirmationAcknowledgement>();
@Input() batchInfors: BatchInfo[] = []; @Input() batchInfors: BatchInfo[] = [];
isDelete: boolean = false; isDelete = false;
constructor( constructor(
private translate: TranslateService) {} private translate: TranslateService) {}
@ -49,7 +49,7 @@ export class ConfirmationDialogComponent {
this.message = msg; this.message = msg;
this.translate.get(this.dialogTitle).subscribe((res: string) => this.dialogTitle = res); this.translate.get(this.dialogTitle).subscribe((res: string) => this.dialogTitle = res);
this.translate.get(this.dialogContent, { 'param': msg.param }).subscribe((res: string) => this.dialogContent = res); this.translate.get(this.dialogContent, { 'param': msg.param }).subscribe((res: string) => this.dialogContent = res);
//Open dialog // Open dialog
this.buttons = msg.buttons; this.buttons = msg.buttons;
this.opened = true; this.opened = true;
} }
@ -81,7 +81,8 @@ export class ConfirmationDialogComponent {
} }
cancel(): void { cancel(): void {
if(!this.message){//Inproper condition if (!this.message) {
// Inproper condition
this.close(); this.close();
return; return;
} }

View File

@ -31,7 +31,7 @@
"clarity-icons": "^0.10.17", "clarity-icons": "^0.10.17",
"clarity-ui": "^0.10.17", "clarity-ui": "^0.10.17",
"core-js": "^2.4.1", "core-js": "^2.4.1",
"harbor-ui": "0.6.19", "harbor-ui": "0.6.20-beta.4",
"intl": "^1.2.5", "intl": "^1.2.5",
"mutationobserver-shim": "^0.3.2", "mutationobserver-shim": "^0.3.2",
"ngx-cookie": "^1.0.0", "ngx-cookie": "^1.0.0",

View File

@ -13,7 +13,7 @@
<button id="config-system" class="btn btn-link nav-link" aria-controls="system_settings" [class.active]='isCurrentTabLink("config-system")' type="button" (click)='tabLinkClick("config-system")'>{{'CONFIG.SYSTEM' | translate }}</button> <button id="config-system" class="btn btn-link nav-link" aria-controls="system_settings" [class.active]='isCurrentTabLink("config-system")' type="button" (click)='tabLinkClick("config-system")'>{{'CONFIG.SYSTEM' | translate }}</button>
</li> </li>
<li role="presentation" class="nav-item" *ngIf="withClair"> <li role="presentation" class="nav-item" *ngIf="withClair">
<button id="config-vulnerability" class="btn btn-link nav-link" aria-controls="vulnerability" [class.active]='isCurrentTabLink("config-vulnerability")' type="button" (click)='tabLinkClick("config-vulnerability")'>{{'VULNERABILITY.SINGULAR' | translate}}</button> <button id="config-vulnerability" class="btn btn-link nav-link" aria-controls="vulnerability" [class.active]='isCurrentTabLink("config-vulnerability")' type="button" (click)='tabLinkClick("config-vulnerability")'>{{'CONFIG.VULNERABILITY' | translate}}</button>
</li> </li>
</ul> </ul>
<section id="authentication" role="tabpanel" aria-labelledby="config-auth" [hidden]='!isCurrentTabContent("authentication")'> <section id="authentication" role="tabpanel" aria-labelledby="config-auth" [hidden]='!isCurrentTabContent("authentication")'>

View File

@ -217,7 +217,6 @@
"OF": "of", "OF": "of",
"SWITCH_TITLE": "Confirm project members switch", "SWITCH_TITLE": "Confirm project members switch",
"SWITCH_SUMMARY": "Do you want to switch project members {{param}}?" "SWITCH_SUMMARY": "Do you want to switch project members {{param}}?"
}, },
"AUDIT_LOG": { "AUDIT_LOG": {
"USERNAME": "Username", "USERNAME": "Username",
@ -424,6 +423,7 @@
"REPLICATION": "Replication", "REPLICATION": "Replication",
"EMAIL": "Email", "EMAIL": "Email",
"SYSTEM": "System Settings", "SYSTEM": "System Settings",
"VULNERABILITY": "Vulnerability",
"CONFIRM_TITLE": "Confirm to cancel", "CONFIRM_TITLE": "Confirm to cancel",
"CONFIRM_SUMMARY": "Some changes have not been saved. Do you want to discard them?", "CONFIRM_SUMMARY": "Some changes have not been saved. Do you want to discard them?",
"SAVE_SUCCESS": "Configuration has been successfully saved.", "SAVE_SUCCESS": "Configuration has been successfully saved.",

View File

@ -327,6 +327,7 @@
"TARGETS":"Target", "TARGETS":"Target",
"MODE": "Mode", "MODE": "Mode",
"SOURCE": "Source", "SOURCE": "Source",
"REPLICATE": "Replicate",
"DELETE_REMOTE_IMAGES":"Delete remote images when locally deleted", "DELETE_REMOTE_IMAGES":"Delete remote images when locally deleted",
"REPLICATE_IMMEDIATE":"Replicate existing images immediately" "REPLICATE_IMMEDIATE":"Replicate existing images immediately"
}, },
@ -361,8 +362,7 @@
"PLACEHOLDER": "We couldn't find any endpoints!" "PLACEHOLDER": "We couldn't find any endpoints!"
}, },
"REPOSITORY": { "REPOSITORY": {
"COPY_ID": "Copiar ID", "COPY_DIGEST_ID": "Copy Digest",
"COPY_PARENT_ID": "Copiar ID padre",
"DELETE": "Eliminar", "DELETE": "Eliminar",
"NAME": "Nombre", "NAME": "Nombre",
"TAGS_COUNT": "Etiquetas", "TAGS_COUNT": "Etiquetas",
@ -423,6 +423,7 @@
"REPLICATION": "Replicación", "REPLICATION": "Replicación",
"EMAIL": "Email", "EMAIL": "Email",
"SYSTEM": "Opciones del Sistema", "SYSTEM": "Opciones del Sistema",
"VULNERABILITY": "Vulnerability",
"CONFIRM_TITLE": "Confirma cancelación", "CONFIRM_TITLE": "Confirma cancelación",
"CONFIRM_SUMMARY": "Algunos cambios no han sido guardados aún. ¿Quiere descartarlos?", "CONFIRM_SUMMARY": "Algunos cambios no han sido guardados aún. ¿Quiere descartarlos?",
"SAVE_SUCCESS": "La configuración ha sido guardada satisfactoriamente.", "SAVE_SUCCESS": "La configuración ha sido guardada satisfactoriamente.",
@ -525,6 +526,8 @@
"PRO_ITEM": "PROYECTOS", "PRO_ITEM": "PROYECTOS",
"REPO_ITEM": "REPOSITORIOS", "REPO_ITEM": "REPOSITORIOS",
"INDEX_PRIVATE": "PRIVADO", "INDEX_PRIVATE": "PRIVADO",
"INDEX_MY_PROJECTS": "MY PROJECTS",
"INDEX_MY_REPOSITORIES": "MY REPOSITORIES",
"INDEX_PUB": "PÚBLICO", "INDEX_PUB": "PÚBLICO",
"INDEX_TOTAL": "TOTAL", "INDEX_TOTAL": "TOTAL",
"STORAGE": "ALMACENAMIENTO", "STORAGE": "ALMACENAMIENTO",

View File

@ -202,7 +202,6 @@
"DEVELOPER": "开发人员", "DEVELOPER": "开发人员",
"GUEST": "访客", "GUEST": "访客",
"DELETE": "删除", "DELETE": "删除",
"OF": "共计",
"ITEMS": "条记录", "ITEMS": "条记录",
"ACTIONS": "操作", "ACTIONS": "操作",
"USERNAME_IS_REQUIRED": "用户名为必填项。", "USERNAME_IS_REQUIRED": "用户名为必填项。",
@ -215,6 +214,7 @@
"ADDED_SUCCESS": "成功新增成员。", "ADDED_SUCCESS": "成功新增成员。",
"DELETED_SUCCESS": "成功删除成员。", "DELETED_SUCCESS": "成功删除成员。",
"SWITCHED_SUCCESS": "切换角色成功。", "SWITCHED_SUCCESS": "切换角色成功。",
"OF": "共计",
"SWITCH_TITLE": "切换项目成员确认", "SWITCH_TITLE": "切换项目成员确认",
"SWITCH_SUMMARY": "你确认切换项目成员 {{param}}??" "SWITCH_SUMMARY": "你确认切换项目成员 {{param}}??"
}, },
@ -233,10 +233,10 @@
"OTHERS": "其他", "OTHERS": "其他",
"ADVANCED": "高级检索", "ADVANCED": "高级检索",
"SIMPLE": "简单检索", "SIMPLE": "简单检索",
"OF": "共计",
"ITEMS": "条记录", "ITEMS": "条记录",
"FILTER_PLACEHOLDER": "过滤日志", "FILTER_PLACEHOLDER": "过滤日志",
"INVALID_DATE": "无效日期。" "INVALID_DATE": "无效日期。",
"OF": "共计"
}, },
"REPLICATION": { "REPLICATION": {
"REPLICATION_RULE": "复制规则", "REPLICATION_RULE": "复制规则",
@ -327,6 +327,7 @@
"TARGETS":"目标", "TARGETS":"目标",
"MODE": "模式", "MODE": "模式",
"SOURCE": "资源", "SOURCE": "资源",
"REPLICATE": "复制",
"DELETE_REMOTE_IMAGES":"删除本地镜像时同时也删除远程的镜像。", "DELETE_REMOTE_IMAGES":"删除本地镜像时同时也删除远程的镜像。",
"REPLICATE_IMMEDIATE":"立即复制现有的镜像。" "REPLICATE_IMMEDIATE":"立即复制现有的镜像。"
}, },
@ -422,6 +423,7 @@
"REPLICATION": "复制", "REPLICATION": "复制",
"EMAIL": "邮箱", "EMAIL": "邮箱",
"SYSTEM": "系统设置", "SYSTEM": "系统设置",
"VULNERABILITY": "漏洞",
"CONFIRM_TITLE": "确认取消", "CONFIRM_TITLE": "确认取消",
"CONFIRM_SUMMARY": "配置项有改动, 确定取消?", "CONFIRM_SUMMARY": "配置项有改动, 确定取消?",
"SAVE_SUCCESS": "变更的配置项成功保存。", "SAVE_SUCCESS": "变更的配置项成功保存。",