update for i18n reviews and other refinements.

This commit is contained in:
kunw 2016-07-06 20:22:45 +08:00
parent 1e0f31ac13
commit d68be63585
14 changed files with 87 additions and 69 deletions

View File

@ -64,7 +64,7 @@
<div class="form-group col-md-12 form-group-custom">
<label for="endpoint" class="col-md-3 control-label">// 'endpoint' | tr //:</label>
<div class="col-md-9">
<input type="text" class="form-control form-control-custom" id="endpoint" ng-model="replication.destination.endpoint" name="uEndpoint" ng-value="vm.endpoint" required ng-disabled="!vm.targetEditable || !vm.checkedAddTarget">
<input type="text" class="form-control form-control-custom" id="endpoint" ng-model="replication.destination.endpoint" name="uEndpoint" ng-value="vm.endpoint" placeholder="http://ip_address" required ng-disabled="!vm.targetEditable || !vm.checkedAddTarget">
<div ng-messages="form.$submitted && form.uEndpoint.$error">
<span ng-message="required">// 'endpoint_is_required' | tr //</span>
</div>

View File

@ -312,7 +312,7 @@
}
function pingDestinationFailed(data, status) {
vm.pingAvailable = true;
vm.pingMessage = $filter('tr')('failed_to_ping_target', []) + (data && data.length > 0 ? ':' + data : '.');
vm.pingMessage = $filter('tr')('failed_to_ping_target', []) + (data && data.length > 0 ? ':' + data : '');
vm.pingTIP = false;
}
}

View File

@ -28,7 +28,7 @@
<table class="table table-pane">
<tbody>
<tr ng-if="vm.replicationPolicies.length == 0">
<td colspan="7" height="100%" class="empty-hint" ><h3 class="text-muted">// 'no_replication_policies_add_new' | tr //</h3></td>
<td colspan="7" height="100%" class="empty-hint" ><h4 class="text-muted">// 'no_replication_policies_add_new' | tr //</h4></td>
</tr>
<tr policy_id="//r.id//" ng-if="vm.replicationPolicies.length > 0" ng-repeat="r in vm.replicationPolicies" value="//vm.last = $last//">
<td width="10%">//r.name//</td>
@ -41,8 +41,8 @@
</td>
<td width="15%">
<div class="display-inline-block" ng-switch on="//r.enabled//">
<a href="javascript:void(0);" ng-click="vm.togglePolicy(r.id, 0)" title="// 'disable' | tr //"><span ng-switch-when="1" class="glyphicon glyphicon-stop color-danger"></span></a>
<a href="javascript:void(0);" ng-click="vm.togglePolicy(r.id, 1)" title="// 'enable' | tr //"><span ng-switch-when="0" class="glyphicon glyphicon-play color-success"></span></a>
<a href="javascript:void(0);" ng-click="vm.confirmToTogglePolicy(r.id, 0, r.name)" title="// 'disable' | tr //"><span ng-switch-when="1" class="glyphicon glyphicon-stop color-danger"></span></a>
<a href="javascript:void(0);" ng-click="vm.confirmToTogglePolicy(r.id, 1, r.name)" title="// 'enable' | tr //"><span ng-switch-when="0" class="glyphicon glyphicon-play color-success"></span></a>
</div>
&nbsp;
<a href="javascript:void(0);" data-toggle="modal" data-target="#createPolicyModal" ng-click="vm.editReplication(r.id)" title="// 'edit_policy' | tr //"><span class="glyphicon glyphicon-pencil"></span></a>
@ -91,7 +91,7 @@
</div>
</div>
<div class="input-group">
<button type="button" class="btn btn-success" ng-click="vm.refreshReplicationJob()" loading-progress hide-target = "true" toggle-in-progress="vm.refreshJobTIP" ><span class="glyphicon glyphicon-refresh"></span></button>
<button type="button" class="btn btn-success" ng-click="vm.refreshReplicationJob()" loading-progress hide-target = "true" toggle-in-progress="vm.refreshJobTIP" title="//'refresh' | tr//"><span class="glyphicon glyphicon-refresh"></span></button>
</div>
</div>
<div class="pane-split" id="down-pane">
@ -112,7 +112,7 @@
<table class="table table-pane">
<tbody>
<tr ng-if="vm.replicationJobs.length == 0">
<td colspan="4" height="100%" class="empty-hint" ><h3 class="text-muted">// 'no_replication_jobs' | tr //</h3></td>
<td colspan="4" height="100%" class="empty-hint" ><h4 class="text-muted">// 'no_replication_jobs' | tr //</h4></td>
</tr>
<tr ng-if="vm.replicationJobs.length > 0" ng-repeat="r in vm.replicationJobs">
<td width="15%">//r.repository//</td>

View File

@ -44,6 +44,8 @@
vm.retrievePolicy = retrievePolicy;
vm.retrieveJob = retrieveJob;
vm.confirmToTogglePolicy = confirmToTogglePolicy;
vm.togglePolicy = togglePolicy;
vm.downloadLog = downloadLog;
@ -148,8 +150,26 @@
console.log('Selected policy ID:' + vm.policyId);
}
function togglePolicy(policyId, enabled) {
ToggleReplicationPolicyService(policyId, enabled)
function confirmToTogglePolicy(policyId, enabled, name) {
vm.policyId = policyId;
vm.enabled = enabled;
var status = $filter('tr')(vm.enabled === 1 ? 'enabled':'disabled');
$scope.$emit('modalTitle', $filter('tr')('confirm_to_toggle_policy_title'));
$scope.$emit('modalMessage', $filter('tr')('confirm_to_toggle_policy', [name, status]));
var emitInfo = {
'contentType': 'text/html',
'confirmOnly': false,
'action': vm.togglePolicy
}
$scope.$emit('raiseInfo', emitInfo);
}
function togglePolicy() {
ToggleReplicationPolicyService(vm.policyId, vm.enabled)
.success(toggleReplicationPolicySuccess)
.error(toggleReplicationPolicyFailed);
}

View File

@ -11,7 +11,7 @@
<div class="pane">
<div class="sub-pane">
<div ng-if="vm.repositories.length == 0" class="empty-hint">
<h3 style="margin-top: 120px;" class="text-muted">// 'no_repositories' | tr //</h3>
<h4 style="margin-top: 120px;" class="text-muted">// 'no_repositories' | tr //</h4>
</div>
<div ng-if="vm.repositories.length > 0" class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div class="panel panel-default" ng-repeat="repo in vm.repositories">

View File

@ -26,7 +26,7 @@
<table class="table table-pane">
<tbody>
<tr ng-if="vm.destinations.length == 0">
<td colspan="7" height="100%" class="empty-hint" ><h3 class="text-muted">// 'no_destinations' | tr //</h3></td>
<td colspan="7" height="100%" class="empty-hint" ><h4 class="text-muted">// 'no_destinations' | tr //</h4></td>
</tr>
<tr ng-if="vm.destinations.length > 0" ng-repeat="r in vm.destinations">
<td width="20%">//r.name//</td>
@ -35,7 +35,7 @@
<td width="15%">
<a href="javascript:void(0);" data-toggle="modal" data-target="#createDestinationModal" ng-click="vm.editDestination(r.id)" title="// 'edit' | tr //" ><span class="glyphicon glyphicon-pencil"></span></a>
&nbsp;
<a href="javascript:void(0);" ng-click="vm.confirmToDelete(r.id)" title="// 'delete' | tr //"><span class="glyphicon glyphicon-trash"></span></a>
<a href="javascript:void(0);" ng-click="vm.confirmToDelete(r.id, r.name)" title="// 'delete' | tr //"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</tbody>

View File

@ -44,11 +44,11 @@
console.log('Action for destination:' + vm.action + ', target ID:' + vm.targetId);
}
function confirmToDelete(targetId) {
function confirmToDelete(targetId, name) {
vm.selectedTargetId = targetId;
$scope.$emit('modalTitle', $filter('tr')('confirm_delete_destination_title'));
$scope.$emit('modalMessage', $filter('tr')('confirm_delete_destination'));
$scope.$emit('modalMessage', $filter('tr')('confirm_delete_destination', [name]));
var emitInfo = {
'confirmOnly': false,

View File

@ -28,7 +28,7 @@
<table class="table table-pane">
<tbody>
<tr ng-if="vm.replications.length == 0">
<td colspan="7" height="100%" class="empty-hint" ><h3 class="text-muted">// 'no_replication_policies' | tr //</h3></td>
<td colspan="7" height="100%" class="empty-hint" ><h4 class="text-muted">// 'no_replication_policies' | tr //</h4></td>
</tr>
<tr ng-if="vm.replications.length > 0" ng-repeat="r in vm.replications">
<td width="14%"><a href="repository#/replication?project_id=//r.project_id//">//r.name//</a></td>

View File

@ -33,7 +33,7 @@
<toggle-admin has-admin-role="u.has_admin_role == 1" user-id="//u.user_id//"></toggle-admin>
</td>
<td width="20%">
&nbsp;&nbsp;<a href="javascript:void(0)" ng-click="vm.confirmToDelete(u.user_id)"><span class="glyphicon glyphicon-trash"></span></a>
&nbsp;&nbsp;<a href="javascript:void(0)" ng-click="vm.confirmToDelete(u.user_id, u.username)"><span class="glyphicon glyphicon-trash"></span></a>
</td>
</tr>
</tbody>

View File

@ -32,11 +32,11 @@
.error(deleteUserFailed);
}
function confirmToDelete(userId) {
function confirmToDelete(userId, username) {
vm.selectedUserId = userId;
$scope.$emit('modalTitle', $filter('tr')('confirm_delete_user_title'));
$scope.$emit('modalMessage', $filter('tr')('confirm_delete_user'));
$scope.$emit('modalMessage', $filter('tr')('confirm_delete_user', [username]));
var emitInfo = {
'confirmOnly': false,

View File

@ -128,18 +128,17 @@ var locale_messages = {
'alert_delete_tag': 'Delete tag "$0" now?',
'close': 'Close',
'ok': 'OK',
'welcome': 'Welcome ',
'to_harbor': ' to Harbor!',
'welcome': 'Welcome to Harbor!',
'continue' : 'Continue',
'no_projects_add_new_project': 'No projects, add new project now.',
'no_projects_add_new_project': 'No projects available now.',
'no_repositories': 'No repositories found, please use "docker push" to upload images.',
'failed_to_add_member': 'Project member can not be added, insuffient permissions.',
'failed_to_change_member': 'Project member can not be changed, insuffient permissions.',
'failed_to_delete_member': 'Project member can not be deleted, insuffient permissions.',
'confirm_delete_user_title': 'Delete user',
'confirm_delete_user': 'Are you sure to delete the current user?',
'confirm_delete_destination_title': 'Delete destination',
'confirm_delete_destination': 'Are you sure to delete the current destination?',
'confirm_delete_user_title': 'User Deletion',
'confirm_delete_user': 'Are you sure to delete the user "$0" ?',
'confirm_delete_destination_title': 'Destination Deletion',
'confirm_delete_destination': 'Are you sure to delete the destination "$0" ?',
'replication': 'Replication',
'name': 'Name',
'description': 'Description',
@ -156,48 +155,46 @@ var locale_messages = {
'enable': 'Enable',
'disabled': 'Disabled',
'disable': 'Disable',
'no_replication_policies_add_new': 'No replication policies, add new replication policy.',
'no_replication_policies_add_new': 'No replication policies, please add new policy.',
'no_replication_policies': 'No replication policies.',
'no_replication_jobs': 'No replication jobs.',
'no_destinations': 'No destinations, add new destination.',
'no_destinations': 'No destinations, please add new destination.',
'name_is_required': 'Name is required.',
'name_is_too_long': 'Name is too long. (maximum 20 characters)',
'description_is_too_long': 'Description is too long. (maximum 20 characters)',
'enable': 'Enable',
'description_is_too_long': 'Description is too long. ',
'general_setting': 'General',
'destination_setting': 'Destination Setting',
'destination_setting': 'Destination Settings',
'endpoint': 'Endpoint',
'endpoint_is_required': 'Endpoint is required.',
'test_connection': 'Test connection',
'add_new_destination': 'New Destination',
'edit_destination': 'Edit Destination',
'successful_changed_password': 'Password has been changed successfully.',
'change_profile': 'Change Profile',
'successful_changed_profile': 'User profile has been changed successfully.',
'form_is_invalid': 'Form content is invalid',
'form_is_invalid_message': 'Form content is invalid, please fill the required fields.',
'administrator': 'Administrator',
'popular_repositories': 'Popular Repositories',
'harbor_intro_title': 'About Harbor',
'mail_has_been_sent': 'Resetting Email has been sent.',
'mail_has_been_sent': 'Password resetting Email has been sent.',
'send': 'Send',
'successful_signed_up': 'Signed up successfully.',
'add_new_policy': 'Add New Policy',
'edit_policy': 'Edit Policy',
'add_new_title': 'Add User',
'add_new': 'Add',
'successful_added': 'Added new user successfully.',
'successful_added': 'New user added successfully.',
'copyright': 'Copyright',
'all_rights_reserved': 'All Rights Reserved.',
'pinging_target': 'Testing connection, please stand by...',
'successful_ping_target': 'Test connection successfully.',
'failed_to_ping_target': 'Cannot connect to the target.',
'policy_already_exists': 'Policy alreay exists.',
'pinging_target': 'Testing connection ...',
'successful_ping_target': 'Connection tested successfully.',
'failed_to_ping_target': 'Connetion test failed, please check your settings.',
'policy_already_exists': 'Policy already exists.',
'destination_already_exists': 'Destination already exists.',
'refresh': 'Refresh',
'select_all': 'Select All',
'delete_tag': 'Delete Tag',
'delete_repo': 'Delete Repo',
'download_log': 'Download Logs',
'download_log': 'View Logs',
'edit': 'Edit',
'delete': 'Delete',
'transfer': 'Transfer',
@ -244,11 +241,13 @@ var locale_messages = {
'developer': 'Developer',
'guest': 'Guest',
'inline_help_role_title': '<strong>The Definitions of Roles</strong>',
'inline_help_role': '<strong>Project Admin</strong>: When creating a new project, you will be assigned the "ProjectAdmin" role to the project. Besides read-write privileges, the "ProjectAdmin" also has some management privileges, such as adding and removing members.<br/>' +
'<strong>Developer</strong>: Developer has read and write privileges for a project.<br/>' +
'inline_help_role': '<strong>Project Admin</strong>: Project Admin has read/write and member management privileges to the project.<br/>' +
'<strong>Developer</strong>: Developer has read and write privileges to the project.<br/>' +
'<strong>Guest</strong>: Guest has read-only privilege for a specified project.',
'inline_help_publicity_title': '<strong>Publicity of Project</strong>',
'inline_help_publicity': 'Setting the project as public.',
'alert_job_contains_error': 'Found errors in the current replication jobs, please look into it.',
'caution': 'Caution'
'alert_job_contains_error': 'Found errors in the current replication jobs, please check.',
'caution': 'Caution',
'confirm_to_toggle_policy_title': 'Policy Toggle',
'confirm_to_toggle_policy': 'Are you sure to toggle policy $0 to <strong>$1</strong> status?'
};

View File

@ -127,18 +127,17 @@ var locale_messages = {
'alert_delete_tag': '删除镜像标签 "$0" ?',
'close': '关闭',
'ok': '确认',
'welcome': '欢迎 ',
'to_harbor': ' 使用Harbor!',
'welcome': '欢迎使用Harbor!',
'continue' : '继续',
'no_projects_add_new_project': '当前没有项目,请新增项目。',
'no_projects_add_new_project': '当前没有项目。',
'no_repositories': '未发现镜像,请用"docker push"命令上传镜像。',
'failed_to_add_member': '无法添加项目成员,权限不足。',
'failed_to_change_member': '无法修改项目成员,权限不足。',
'failed_to_delete_member': '无法删除项目成员,权限不足。',
'confirm_delete_user_title': '删除用户',
'confirm_delete_user': '确认删除当前用户吗?',
'confirm_delete_user_titlen_title': '删除目标',
'confirm_delete_destination': '确认删除当前目标吗',
'confirm_delete_user': '确认删除用户 "$0" ?',
'confirm_delete_destination_title': '删除目标',
'confirm_delete_destination': '确认删除目标 "$0"',
'replication': '复制',
'name': '名称',
'description': '描述',
@ -162,7 +161,7 @@ var locale_messages = {
'no_destinations': '没有目标设置,请新增目标。',
'name_is_required': '名称为必填项',
'name_is_too_long': '名称长度超出限制。最长为20个字符',
'description_is_too_long': '描述内容长度超出限制。最长为20个字符',
'description_is_too_long': '描述内容长度超出限制。',
'general_setting': '一般设置',
'destination_setting': '目标设置',
'endpoint': '终端URL',
@ -171,10 +170,8 @@ var locale_messages = {
'add_new_destination': '新建目标',
'edit_destination': '编辑目标',
'successful_changed_password': '修改密码操作成功。',
'change_profile': '修改个人信息',
'successful_changed_profile': '修改个人信息操作成功。',
'form_is_invalid': '表单内容无sign_up效',
'form_is_invalid_message': '表单内容无效,请填写必填字段。',
'change_profile': '修改账户信息',
'successful_changed_profile': '修改账户信息操作成功。',
'administrator': '管理员',
'popular_repositories': '热门镜像仓库',
'harbor_intro_title': '关于 Harbor',
@ -188,16 +185,16 @@ var locale_messages = {
'successful_added': '新增用户成功。',
'copyright': '版权所有',
'all_rights_reserved': '保留所有权利。',
'pinging_target': '正在测试连接,请稍候……',
'pinging_target': '正在测试连接……',
'successful_ping_target': '测试连接目标成功。',
'failed_to_ping_target': '测试连接目标失败',
'failed_to_ping_target': '测试连接目标失败,请检查设置。',
'policy_already_exists': '策略已存在。',
'destination_already_exists': '目标已存在。',
'refresh': '刷新',
'select_all': '全选',
'delete_tag': '删除镜像标签',
'delete_repo': '删除镜像仓库',
'download_log': '下载日志',
'download_log': '查看日志',
'edit': '修改',
'delete': '删除',
'all': '全部',
@ -212,12 +209,12 @@ var locale_messages = {
'failed_to_get_project_member': '无法获取当前项目成员。',
'failed_to_delete_repo': '无法删除镜像仓库。',
'failed_to_delete_repo_insuffient_permissions': '无法删除镜像仓库,权限不足。',
'failed_to_get_tag': '获得tag数据失败。',
'failed_to_get_log': '获取log数据失败。',
'failed_to_get_project': '获取project数据失败。',
'failed_to_get_tag': '获取标签数据失败。',
'failed_to_get_log': '获取日志数据失败。',
'failed_to_get_project': '获取项目数据失败。',
'failed_to_update_user': '更新用户信息失败。',
'failed_to_get_stat': '获取统计数据失败。',
'failed_to_get_top_repo': '获取Top镜像仓库数据失败。',
'failed_to_get_top_repo': '获取热门镜像仓库数据失败。',
'failed_to_get_user_log': '获取用户日志数据失败。',
'failed_to_send_email': '发送邮件失败。',
'failed_to_reset_pasword': '重置邮件失败。',
@ -238,17 +235,19 @@ var locale_messages = {
'failed_to_delete_destination': '删除目标失败。',
'failed_to_create_destination': '创建目标失败。',
'failed_to_update_destination': '修改目标失败。',
'failed_to_toggle_publicity_insuffient_permissions': '切换项目公开失败,权限不足。',
'failed_to_toggle_publicity': '切换项目公开失败。',
'failed_to_toggle_publicity_insuffient_permissions': '切换项目公开失败,权限不足。',
'failed_to_toggle_publicity': '切换项目公开失败。',
'project_admin': '项目管理员',
'developer': '开发人员',
'guest': '来宾用户',
'guest': '访客',
'inline_help_role_title': '<strong>角色定义</strong>',
'inline_help_role': '<strong>项目管理员</strong>: 当创建一个新项目后,您将被指派一个“项目管理员”角色。除了具备读/写权限外,“项目管理员”还拥有添加、删除其他项目成员的管理权限。<br/>'+
'inline_help_role': '<strong>项目管理员</strong>: “项目管理员”拥有一个项目的读/写和成员管理的权限。<br/>'+
'<strong>开发人员</strong>: “开发人员” 拥有一个项目的读/写权限。<br/>' +
'<strong>来宾用户</strong>: “来宾用户”拥有特定项目的只读权限。',
'<strong>访客</strong>: “访客”拥有特定项目的只读权限。',
'inline_help_publicity_title': '<strong>公开项目</strong>',
'inline_help_publicity': '设置该项目为公开。',
'alert_job_contains_error': '当前复制任务中包含错误,请检查。',
'caution': '注意'
'caution': '注意',
'confirm_to_toggle_policy_title': '切换复制策略状态',
'confirm_to_toggle_policy': '确认将复制策略 $0 切换为 <strong>$1</strong> 状态吗?'
};

View File

@ -40,7 +40,7 @@
<table class="table table-pane">
<tbody>
<tr>
<td colspan="5" height="320px" class="empty-hint" ng-if="vm.projects.length === 0"><h3 class="text-muted">// 'no_projects_add_new_project' | tr //</h3></td>
<td colspan="5" height="320px" class="empty-hint" ng-if="vm.projects.length === 0"><h4 class="text-muted">// 'no_projects_add_new_project' | tr //</h4></td>
</tr>
<tr ng-if="vm.projects.length > 0" ng-repeat="p in vm.projects">
<td width="15%"><a href="/repository#/repositories?project_id=//p.project_id//&is_public=//p.public//">//p.name//</a></td>

View File

@ -1,6 +1,6 @@
{{ if eq .HasLoggedIn true }}
<div class="has-logged-in">
<h4>// 'welcome' | tr // <strong>{{ .Username }}</strong> // 'to_harbor' | tr //</h4>
<h4>// 'welcome' | tr //</h4>
<!--p class="text-muted last-logged-in-time">Last login time: //vm.lastLoggedInTime//</p-->
<p class="control-button"><input type="button" class="btn btn-default pull-right" value="// 'continue' | tr //" ng-click="vm.doContinue()"></p>
<p class="control-button"><input type="button" class="btn btn-link pull-right" value="// 'log_out' | tr //" ng-click="vm.doLogOut()"></p>