Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
89122a2
frontend: 添加en zh-Hans 俩种模板语言
BennieMeng Nov 22, 2018
0c554aa
frontend: 添加语言切换
BennieMeng Nov 22, 2018
f7d5c65
frontend: 前台nav i18n
BennieMeng Nov 22, 2018
7f2e57c
frontend: sidenav-namespance i18n
BennieMeng Nov 22, 2018
c871d71
frontend: Department i18n
BennieMeng Nov 23, 2018
b79f89d
frontend: product i18n
BennieMeng Nov 23, 2018
fde8166
frontend: namespace apikey i18n
BennieMeng Nov 23, 2018
ac5d758
frontend: deployment i18n
BennieMeng Nov 27, 2018
dc9b2f6
frontend: deployment-create-tpl i18n
BennieMeng Nov 27, 2018
a1e15ae
frontend: 语言切换位置显示
BennieMeng Nov 27, 2018
74a0344
Merge branch 'master' into feature/translate
wilhelmguo Nov 27, 2018
78c6723
Merge branch 'master' into feature/translate
wilhelmguo Nov 27, 2018
3f74bc4
frontend: replace titel with title
BennieMeng Nov 27, 2018
c51c04e
Merge branch 'feature/translate' of github.com:BennieMeng/wayne into …
BennieMeng Nov 27, 2018
85bd3cc
Merge branch 'master' into feature/translate
wilhelmguo Nov 28, 2018
a570801
Merge branch 'master' into feature/translate
wilhelmguo Nov 28, 2018
b8addd2
frontend: separate template title into TMP
BennieMeng Nov 28, 2018
0b0bbf5
Merge branch 'feature/translate' of github.com:BennieMeng/wayne into …
BennieMeng Nov 28, 2018
0617cb5
frontend: statefulset list i18n
BennieMeng Nov 28, 2018
ed1a89f
frontend: replace create_product to create_app
BennieMeng Nov 28, 2018
3bc84b4
frontend: statefulset template i18n
BennieMeng Nov 28, 2018
9ce9194
frontend: daemonset i18n create
BennieMeng Nov 28, 2018
a9ff90f
Merge branch 'master' into feature/translate
BennieMeng Nov 28, 2018
d5136da
frontend: group replace create template word
BennieMeng Nov 29, 2018
a9d74e1
Merge branch 'master' into feature/translate
BennieMeng Nov 29, 2018
43fd38b
frontend: daemonset i18n
BennieMeng Nov 29, 2018
52afaa9
frontend: group replace create i18n
BennieMeng Nov 29, 2018
f5e9b49
Merge branch 'feature/translate' of github.com:BennieMeng/wayne into …
BennieMeng Nov 29, 2018
28e0dc7
frontend: configmap i18n
BennieMeng Nov 30, 2018
5f72414
frontend: secret i18n
BennieMeng Nov 30, 2018
b5f08b9
frontend: pvc i18n
BennieMeng Nov 30, 2018
56f2f4a
frontend: update lib
BennieMeng Nov 30, 2018
9fa3b40
Merge branch 'master' of github.com:Qihoo360/wayne into feature/trans…
BennieMeng Nov 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
frontend: namespace apikey i18n
  • Loading branch information
BennieMeng committed Nov 23, 2018
commit fde81663bacef8f5b8af968523ee7426a15ee874
4 changes: 2 additions & 2 deletions src/frontend/src/app/portal/app-apikey/apikey.component.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="row flex-items-xs-between flex-items-xs-top" style="padding-left: 15px; padding-right: 15px;">
<h2 class="header-title">APIKey列表</h2>
<h2 class="header-title">APIKey {{'TITEL.LIST' | translate}}</h2>
</div>
<div class="table-search">
<div class="table-search-left">
<button *ngIf="authService.currentAppPermission.apiKey.create || authService.currentUser.admin" class="wayne-button normal"
(click)="openModal()">
创建APIKey
{{'ACTION.CREATE' | translate}} APIKey
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这种为什么不把创建 APIkeys 作为一个词条去翻译?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apikey 叫什么,一开始为什么就是英文

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APIkeys 可以暂时先不翻译

</button>
<wayne-filter-box (confirm)="confirmEvent()" (cancel)="cancelEvent()">
<wayne-checkbox-group [(ngModel)]="showList">
Expand Down
2 changes: 2 additions & 0 deletions src/frontend/src/app/portal/app-apikey/apikey.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {CreateEditApiKeyComponent} from './create-edit-apikey/create-edit-apikey
import {ApiKey} from '../../shared/model/v1/apikey';
import {ApiKeyService} from '../../shared/client/v1/apikey.service';
import {ActivatedRoute} from '@angular/router';
import {TranslateService} from '@ngx-translate/core';

const showState = {
'名称': {hidden: false},
Expand Down Expand Up @@ -46,6 +47,7 @@ export class AppApiKeyComponent implements OnInit, OnDestroy {
private route: ActivatedRoute,
public authService: AuthService,
private messageHandlerService: MessageHandlerService,
public translate: TranslateService,
private deletionDialogService: ConfirmationDialogService) {
this.subscription = deletionDialogService.confirmationConfirm$.subscribe(message => {
if (message &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="row flex-items-xs-between flex-items-xs-top" style="padding-left: 15px; padding-right: 15px;">
<h2 class="header-title">APIKey列表</h2>
<h2 class="header-title">APIKey {{'TITEL.LIST' | translate}}</h2>
</div>
<div class="table-search">
<div class="table-search-left">
<button class="wayne-button normal" *ngIf="authService.currentNamespacePermission.apiKey.create || authService.currentUser.admin"
(click)="openModal()">
创建APIKey
{{'ACTION.CREATE' | translate}} APIKey
</button>
<wayne-filter-box (confirm)="confirmEvent()" (cancel)="cancelEvent()">
<wayne-checkbox-group [(ngModel)]="showList">
<wayne-checkbox>名称</wayne-checkbox>
<wayne-checkbox>角色</wayne-checkbox>
<wayne-checkbox>创建时间</wayne-checkbox>
<wayne-checkbox>过期时间</wayne-checkbox>
<wayne-checkbox>创建者</wayne-checkbox>
<wayne-checkbox>描述</wayne-checkbox>
<wayne-checkbox>操作</wayne-checkbox>
<wayne-checkbox value="name">{{'TITEL.NAME' | translate}}</wayne-checkbox>
<wayne-checkbox value="role">{{'TITEL.ROLE' | translate}}</wayne-checkbox>
<wayne-checkbox value="create_time">{{'TITEL.CREATE_TIME' | translate}}</wayne-checkbox>
<wayne-checkbox value="expire_time">{{'TITEL.EXPIRE_TIME' | translate}}</wayne-checkbox>
<wayne-checkbox value="create_user">{{'TITEL.CREATE_USER' | translate}}</wayne-checkbox>
<wayne-checkbox value="description">{{'TITEL.DESCRIPTION' | translate}}</wayne-checkbox>
<wayne-checkbox value="action">{{'TITEL.ACTION' | translate}}</wayne-checkbox>
</wayne-checkbox-group>
</wayne-filter-box>
</div>
Expand Down
14 changes: 7 additions & 7 deletions src/frontend/src/app/portal/namespace-apikey/apikey.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import {ApiKey} from '../../shared/model/v1/apikey';
import {ApiKeyService} from '../../shared/client/v1/apikey.service';

const showState = {
'名称': {hidden: false},
'角色': {hidden: false},
'创建时间': {hidden: false},
'过期时间': {hidden: false},
'创建者': {hidden: false},
'描述': {hidden: false},
'操作': {hidden: false}
'name': {hidden: false},
'role': {hidden: false},
'create_time': {hidden: false},
'expire_time': {hidden: false},
'create_user': {hidden: false},
'description': {hidden: false},
'action': {hidden: false}
};

@Component({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,38 +3,38 @@
<ng-container>ID</ng-container>
</clr-dg-column>
<clr-dg-column [clrDgField]="'name'">
<ng-container *clrDgHideableColumn="showState['名称']">名称</ng-container>
<ng-container *clrDgHideableColumn="showState['name']">{{'TITEL.NAME' | translate}}</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="showState['角色']">角色</ng-container>
<ng-container *clrDgHideableColumn="showState['role']">{{'TITEL.ROLE' | translate}}</ng-container>
</clr-dg-column>
<clr-dg-column class="col-time">
<ng-container *clrDgHideableColumn="showState['创建时间']">创建时间</ng-container>
<ng-container *clrDgHideableColumn="showState['create_time']">{{'TITEL.CREATE_TIME' | translate}}</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="showState['过期时间']">过期时间(s)</ng-container>
<ng-container *clrDgHideableColumn="showState['expire_time']">{{'TITEL.EXPIRE_TIME' | translate}}(s)</ng-container>
</clr-dg-column>
<clr-dg-column class="col-user">
<ng-container *clrDgHideableColumn="showState['创建者']">创建者</ng-container>
<ng-container *clrDgHideableColumn="showState['create_user']">{{'TITEL.CREATE_USER' | translate}}</ng-container>
</clr-dg-column>
<clr-dg-column>
<ng-container *clrDgHideableColumn="showState['描述']">描述</ng-container>
<ng-container *clrDgHideableColumn="showState['description']">{{'TITEL.DESCRIPTION' | translate}}</ng-container>
</clr-dg-column>
<clr-dg-column class="col-operate">
<ng-container *clrDgHideableColumn="showState['操作']">操作</ng-container>
<ng-container *clrDgHideableColumn="showState['action']">{{'TITEL.ACTION' | translate}}</ng-container>
</clr-dg-column>

<clr-dg-row *ngFor="let apiKey of apiKeys" [clrDgItem]="apiKey">
<clr-dg-cell class="col-id">{{apiKey.id}}</clr-dg-cell>
<clr-dg-cell class="copy">{{apiKey.name}}</clr-dg-cell>
<clr-dg-cell class="copy">{{apiKey.group?.name}}</clr-dg-cell>
<clr-dg-cell class="col-time">{{apiKey.createTime | date:'yyyy-MM-dd HH:mm:ss'}}</clr-dg-cell>
<clr-dg-cell>{{apiKey.expireIn==0 ? "永久有效": apiKey.expireIn}}</clr-dg-cell>
<clr-dg-cell>{{apiKey.expireIn==0 ? "always available": apiKey.expireIn}}</clr-dg-cell>
<clr-dg-cell class="col-user">{{apiKey.user}}</clr-dg-cell>
<clr-dg-cell>{{apiKey.description}}</clr-dg-cell>
<clr-dg-cell class="col-operate">
<button class="wayne-button text" *ngIf="authService.currentNamespacePermission.apiKey.read || authService.currentUser.admin" (click)="tokenDetail(apiKey)">详情</button>
<button class="wayne-button text" *ngIf="authService.currentNamespacePermission.apiKey.delete || authService.currentUser.admin" (click)="deleteApiKey(apiKey)">删除</button>
<button class="wayne-button text" *ngIf="authService.currentNamespacePermission.apiKey.read || authService.currentUser.admin" (click)="tokenDetail(apiKey)">{{'ACTION.DETAIL' | translate}}</button>
<button class="wayne-button text" *ngIf="authService.currentNamespacePermission.apiKey.delete || authService.currentUser.admin" (click)="deleteApiKey(apiKey)">{{'ACTION.DELETE' | translate}}</button>
</clr-dg-cell>
</clr-dg-row>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Page} from '../../../shared/page/page-state';
import {ApiKey} from '../../../shared/model/v1/apikey';
import {TokenDetailComponent} from '../token-detail/token-detail';
import {AuthService} from '../../../shared/auth/auth.service';
import {TranslateService} from '@ngx-translate/core';

@Component({
selector: 'list-apikey',
Expand All @@ -24,7 +25,10 @@ export class ListApiKeyComponent implements OnInit {
@Output() delete = new EventEmitter<ApiKey>();
@Output() edit = new EventEmitter<ApiKey>();

constructor(public authService: AuthService) {
constructor(
public authService: AuthService,
public translate: TranslateService
) {
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<button class="wayne-button normal" (click)="open()" [class.active]="show">{{'TITEL.SHOW_COLUMN' | translate}}</button>
<ng-container *ngIf="show">
<wayne-box class="filter-box" style="width: 190px;">
<wayne-box class="filter-box">
<div class="filter-header">
{{'ACTION.CHOOSE_SHOW_COLUMN' | translate}}
</div>
Expand Down
8 changes: 6 additions & 2 deletions src/frontend/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
"NAME": "Name",
"DESCRIPTION": "Description",
"CREATE_USER": "Create User",
"ACTION": "Action"
"ACTION": "Action",
"LIST": "List",
"ROLE": "Role",
"EXPIRE_TIME": "Expire Time"
},
"ACTION": {
"UNFOLD": "UnFold",
Expand All @@ -82,7 +85,8 @@
"MONITOR": "Monitor",
"EDIT": "Edit",
"DELETE": "Delete",
"CHOOSE_SHOW_COLUMN": "Choose Columns"
"CHOOSE_SHOW_COLUMN": "Choose Columns",
"CREATE": "Create"
},
"PLACEHOLDER": {
"PRODUCT": "Click Here to filter Product",
Expand Down