Commit 59d92f6b authored by Jason Song's avatar Jason Song Committed by Jason Song

polish translations and fix some bugs introduced

parent aee511ba
......@@ -45,6 +45,7 @@ public class WebMvcConfig implements WebMvcConfigurer, WebServerFactoryCustomize
addCacheControl(registry, "scripts", 86400);
addCacheControl(registry, "styles", 86400);
addCacheControl(registry, "views", 86400);
addCacheControl(registry, "i18n", 86400);
}
private void addCacheControl(ResourceHandlerRegistry registry, String folder, int cachePeriod) {
......
......@@ -11,7 +11,7 @@ public class AppDTO extends BaseDTO{
@Pattern(
regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR,
message = "AppId格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
message = "Invalid AppId format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
)
private String appId;
......
......@@ -11,7 +11,7 @@ public class ClusterDTO extends BaseDTO{
@NotBlank(message = "cluster name cannot be blank")
@Pattern(
regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR,
message = "Cluster格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
message = "Invalid Cluster format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
)
private String name;
......
......@@ -12,7 +12,7 @@ public class NamespaceDTO extends BaseDTO{
@Pattern(
regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR,
message = "Namespace格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
message = "Invalid Namespace format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
)
private String namespaceName;
......
......@@ -22,7 +22,7 @@ public class AppNamespace extends BaseEntity {
@NotBlank(message = "AppNamespace Name cannot be blank")
@Pattern(
regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR,
message = "Namespace格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE
message = "Invalid Namespace format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE
)
@Column(name = "Name", nullable = false)
private String name;
......
......@@ -8,8 +8,8 @@ import java.util.regex.Pattern;
* @author Jason Song(song_s@ctrip.com)
*/
public class InputValidator {
public static final String INVALID_CLUSTER_NAMESPACE_MESSAGE = "只允许输入数字,字母和符号 - _ .";
public static final String INVALID_NAMESPACE_NAMESPACE_MESSAGE = "不允许以.json, .yml, .yaml, .xml, .properties结尾";
public static final String INVALID_CLUSTER_NAMESPACE_MESSAGE = "Only digits, alphabets and symbol - _ . are allowed";
public static final String INVALID_NAMESPACE_NAMESPACE_MESSAGE = "not allowed to end with .json, .yml, .yaml, .xml, .properties";
public static final String CLUSTER_NAMESPACE_VALIDATOR = "[0-9a-zA-Z_.-]+";
private static final String APP_NAMESPACE_VALIDATOR = "[a-zA-Z0-9._-]+(?<!\\.(json|yml|yaml|xml|properties))$";
private static final Pattern CLUSTER_NAMESPACE_PATTERN = Pattern.compile(CLUSTER_NAMESPACE_VALIDATOR);
......
......@@ -59,7 +59,7 @@ public class ClusterController {
if (!InputValidator.isValidClusterNamespace(clusterName)) {
throw new BadRequestException(
String.format("Cluster Name 格式错误: %s", InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE));
String.format("Invalid ClusterName format: %s", InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE));
}
if (userService.findByUserId(operator) == null) {
......
......@@ -68,7 +68,7 @@ public class NamespaceController {
appNamespaceDTO.getFormat(), appNamespaceDTO.getDataChangeCreatedBy());
if (!InputValidator.isValidAppNamespace(appNamespaceDTO.getName())) {
throw new BadRequestException(String.format("Namespace格式错误: %s",
throw new BadRequestException(String.format("Invalid Namespace format: %s",
InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & "
+ InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE));
}
......
......@@ -193,7 +193,7 @@ public class NamespaceController {
@RequestParam(defaultValue = "true") boolean appendNamespacePrefix,
@Valid @RequestBody AppNamespace appNamespace) {
if (!InputValidator.isValidAppNamespace(appNamespace.getName())) {
throw new BadRequestException(String.format("Namespace格式错误: %s",
throw new BadRequestException(String.format("Invalid Namespace format: %s",
InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE + " & " + InputValidator.INVALID_NAMESPACE_NAMESPACE_MESSAGE));
}
......
......@@ -154,7 +154,7 @@ public class PermissionController {
Set<String> assignedUser = rolePermissionService.assignRoleToUsers(RoleUtils.buildNamespaceRoleName(appId, namespaceName, roleType, env),
Sets.newHashSet(user), userInfoHolder.getUser().getUserId());
if (CollectionUtils.isEmpty(assignedUser)) {
throw new BadRequestException(user + "已授权");
throw new BadRequestException(user + " already authorized");
}
return ResponseEntity.ok().build();
......@@ -209,7 +209,7 @@ public class PermissionController {
Set<String> assignedUser = rolePermissionService.assignRoleToUsers(RoleUtils.buildNamespaceRoleName(appId, namespaceName, roleType),
Sets.newHashSet(user), userInfoHolder.getUser().getUserId());
if (CollectionUtils.isEmpty(assignedUser)) {
throw new BadRequestException(user + "已授权");
throw new BadRequestException(user + " already authorized");
}
return ResponseEntity.ok().build();
......@@ -253,7 +253,7 @@ public class PermissionController {
Set<String> assignedUsers = rolePermissionService.assignRoleToUsers(RoleUtils.buildAppRoleName(appId, roleType),
Sets.newHashSet(user), userInfoHolder.getUser().getUserId());
if (CollectionUtils.isEmpty(assignedUsers)) {
throw new BadRequestException(user + "已授权");
throw new BadRequestException(user + " already authorized");
}
return ResponseEntity.ok().build();
......
......@@ -14,7 +14,7 @@ public class AppModel {
@NotBlank(message = "appId cannot be blank")
@Pattern(
regexp = InputValidator.CLUSTER_NAMESPACE_VALIDATOR,
message = "AppId格式错误: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
message = "Invalid AppId format: " + InputValidator.INVALID_CLUSTER_NAMESPACE_MESSAGE
)
private String appId;
......
......@@ -12,11 +12,11 @@ public class RelativeDateFormat {
private static final long ONE_HOUR = 3600000L;
private static final long ONE_DAY = 86400000L;
private static final String ONE_SECOND_AGO = "秒前";
private static final String ONE_MINUTE_AGO = "分钟前";
private static final String ONE_HOUR_AGO = "小时前";
private static final String ONE_DAY_AGO = "天前";
private static final String ONE_MONTH_AGO = "月前";
private static final String ONE_SECOND_AGO = " seconds ago";
private static final String ONE_MINUTE_AGO = " minutes ago";
private static final String ONE_HOUR_AGO = " hours ago";
private static final String ONE_DAY_AGO = " days ago";
private static final String ONE_MONTH_AGO = " months ago";
public static String format(Date date) {
if (date.after(new Date())) {
......@@ -39,11 +39,11 @@ public class RelativeDateFormat {
Date lastDayBeginTime = getDateOffset(-1);
if (date.after(lastDayBeginTime)) {
return "昨天";
return "yesterday";
}
Date lastTwoDaysBeginTime = getDateOffset(-2);
if (date.after(lastTwoDaysBeginTime)) {
return "前天";
return "the day before yesterday";
}
if (delta < 30L * ONE_DAY) {
long days = toDays(delta);
......
......@@ -61,7 +61,7 @@
<div class="form-group">
<label class="col-sm-3 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Common.AppOwner' | translate }}</label>
{{'Common.AppOwnerLong' | translate }}</label>
<div class="col-sm-6 J_ownerSelectorPanel">
<apollouserselector apollo-id="'ownerSelector'" disabled="isOpenManageAppMasterRoleLimit"></apollouserselector>
<small style="color: maroon" ng-if="isOpenManageAppMasterRoleLimit">{{'App.AppOwnerTips' | translate }}</small>
......
......@@ -147,7 +147,7 @@
<section class="context" ng-show="!hasAssignUserPermission">
<div class="panel-body text-center">
<h4 translate="App.Setting.NoPermissonTips" translate-value-users="{{admins.join(',')}}"></h4>
<h4 translate="App.Setting.NoPermissionTips" translate-value-users="{{admins.join(',')}}"></h4>
</div>
</section>
</div>
......
......@@ -61,7 +61,7 @@
{{'Common.ClusterName' | translate }}</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="clusterName" ng-model="clusterName">
<small>{{'Cluster.CreaterNameTips' | translate }}</small>
<small>{{'Cluster.CreateNameTips' | translate }}</small>
</div>
</div>
<div class="form-group">
......
......@@ -181,7 +181,7 @@
<!--default cluster tip -->
<div ng-show="pageContext.clusterName == 'default'">
<strong>{{'Config.Note' | translate }}:</strong>
<span translate="Config.ClusterIsDefualtTipContent"
<span translate="Config.ClusterIsDefaultTipContent"
translate-value-name="{{envMapClusters[pageContext.env]}}"></span>
</div>
......
......@@ -25,10 +25,10 @@
<div class="operation-caption release-operation-normal text-center" style="left:0;">
<small>{{'Config.History.MasterVersionPublish' | translate }}</small>
</div>
<div class="operation-caption release-operation-rollback text-center" style="left: 80px;">
<div class="operation-caption release-operation-rollback text-center" style="left: 110px;">
<small>{{'Config.History.MasterVersionRollback' | translate }}</small>
</div>
<div class="operation-caption release-operation-gray text-center" style="left: 160px;">
<div class="operation-caption release-operation-gray text-center" style="left: 220px;">
<small>{{'Config.History.GrayscaleOperator' | translate }}</small>
</div>
</div>
......@@ -94,7 +94,7 @@
<div class="load-more media panel-heading text-center hover" ng-show="!hasLoadAll"
ng-click="findReleaseHistory()">
{{'Config.History.LoadingMore' | translate }}
{{'Config.History.LoadMore' | translate }}
</div>
</div>
......@@ -114,12 +114,12 @@
<div class="btn-group">
<button type="button" class="btn btn-default btn-sm"
ng-class="{'active':history.viewType == 'diff'}" data-tooltip="tooltip"
data-placement="bottom" title="查看此次发布与上次版本的变更"
data-placement="bottom" title="{{'Config.History.ChangedItemTips' | translate }}"
ng-click="switchConfigViewType(history, 'diff')">{{'Config.History.ChangedItem' | translate }}
</button>
<button type="button" class="btn btn-default btn-sm"
ng-class="{'active':history.viewType == 'all'}" data-tooltip="tooltip"
data-placement="bottom" title="查看此次发布的所有配置信息"
data-placement="bottom" title="{{'Config.History.AllItemTips' | translate }}"
ng-click="switchConfigViewType(history, 'all')">{{'Config.History.AllItem' | translate }}
</button>
</div>
......@@ -249,7 +249,7 @@
<div class="panel-body" ng-show="isConfigHidden || !releaseHistories || releaseHistories.length == 0">
<h4 class="text-center empty-container" ng-show="isConfigHidden">
{{'Config.History.NoPermissonTips' | translate }}</h4>
{{'Config.History.NoPermissionTips' | translate }}</h4>
<h4 class="text-center empty-container" ng-show="!isConfigHidden">
{{'Config.History.NoPublishHistory' | translate }}</h4>
</div>
......
......@@ -44,7 +44,7 @@
ng-click="getUserCreatedApps()">
<div href="#" class="thumbnail hover cursor-pointer">
<img class="more-img" src="img/more.png" />
<h5>{{'Index.LoadingMore' | translate }}</h5>
<h5>{{'Index.LoadMore' | translate }}</h5>
</div>
</div>
</aside>
......@@ -77,7 +77,7 @@
<div class="col-md-2 text-center" ng-show="hasMoreFavorites" ng-click="getUserFavorites()">
<div href="#" class="thumbnail hover cursor-pointer">
<img class="more-img" src="img/more.png" />
<h5>{{'Index.LoadingMore' | translate }}</h5>
<h5>{{'Index.LoadMore' | translate }}</h5>
</div>
</div>
<div class="no-favorites text-center" ng-show="!favorites || favorites.length == 0">
......@@ -89,7 +89,7 @@
<section class="media visit-app-list" ng-show="visitedApps && visitedApps.length">
<aside class="media-left text-center">
<h5>{{'Index.RecentyViewedItems' | translate }}</h5>
<h5>{{'Index.RecentlyViewedItems' | translate }}</h5>
</aside>
<aside class="media-body">
<div class="app-panel col-md-2 text-center" ng-repeat="app in visitedApps"
......@@ -117,10 +117,6 @@
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-loader-static-files.min.js"></script>
<script src="vendor/angular/angular-translate.2.18.1/angular-translate-storage-cookie.min.js"></script>
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-translate/2.18.1/angular-translate.min.js"></script>-->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-translate/2.18.1/angular-translate-storage-cookie/angular-translate-storage-cookie.min.js"></script>-->
<!--<script src="https://cdnjs.cloudflare.com/ajax/libs/angular-translate/2.18.1/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js"></script>-->
<!-- jquery.js -->
<script src="vendor/jquery.min.js" type="text/javascript"></script>
<script src="vendor/select2/select2.min.js" type="text/javascript"></script>
......
......@@ -62,10 +62,10 @@
<div class="row text-right" style="padding-right: 20px;">
<div class="btn-group btn-group-sm" role="group" aria-label="...">
<button type="button" class="btn btn-default" ng-class="{active:type=='link'}"
ng-click="switchType('link')">{{'Namespace.AssociationPublicNamespcae' | translate }}
ng-click="switchType('link')">{{'Namespace.AssociationPublicNamespace' | translate }}
</button>
<button type="button" class="btn btn-default" ng-class="{active:type=='create'}"
ng-click="switchType('create')">{{'Namespace.CreateNamespcae' | translate }}
ng-click="switchType('create')">{{'Namespace.CreateNamespace' | translate }}
</button>
</div>
</div>
......@@ -142,16 +142,16 @@
ng-show="type == 'create' && (pageSetting.canAppAdminCreatePrivateNamespace || hasRootPermission)">
<label class="col-sm-3 control-label">
<apollorequiredfield></apollorequiredfield>
{{'Namespace.NamespcaeType' | translate }}
{{'Namespace.NamespaceType' | translate }}
</label>
<div class="col-sm-4" valdr-form-group>
<label class="radio-inline">
<input type="radio" name="namespaceType" value="true" ng-value="true"
ng-model="appNamespace.isPublic"> {{'Namespace.NamespcaeType.Public' | translate }}
ng-model="appNamespace.isPublic"> {{'Namespace.NamespaceType.Public' | translate }}
</label>
<label class="radio-inline">
<input type="radio" name="namespaceType" value="false" ng-value="false"
ng-model="appNamespace.isPublic"> {{'Namespace.NamespcaeType.Private' | translate }}
ng-model="appNamespace.isPublic"> {{'Namespace.NamespaceType.Private' | translate }}
</label>
</div>
</div>
......
......@@ -40,7 +40,7 @@
<div class="form-horizontal">
<div class="form-group">
<label
class="col-sm-2 control-label">{{'Namespace.Role.GrantModifyTo' | translate }}<br><small>{{'Namespace.Role.GrantModifyT2' | translate }}</small></label>
class="col-sm-2 control-label">{{'Namespace.Role.GrantModifyTo' | translate }}<br><small>{{'Namespace.Role.GrantModifyTo2' | translate }}</small></label>
<div class="col-sm-8">
<form class="form-inline" ng-submit="assignRoleToUser('ModifyNamespace')">
<div class="form-group">
......@@ -88,7 +88,7 @@
<div class="form-horizontal">
<div class="col-sm-2 text-right">
<label
class="control-label">{{'Namespace.Role.GrantPubishTo' | translate }}<br><small>{{'Namespace.Role.GrantPubishTo2' | translate }}</small></label>
class="control-label">{{'Namespace.Role.GrantPublishTo' | translate }}<br><small>{{'Namespace.Role.GrantPublishTo2' | translate }}</small></label>
</div>
<div class="col-sm-8">
<form class="form-inline" ng-submit="assignRoleToUser('ReleaseNamespace')">
......@@ -138,7 +138,7 @@
</div>
<div class="panel-body text-center" ng-show="!hasAssignUserPermission">
<h2>{{'Namespace.Role.NoPermisson' | translate }}</h2>
<h2>{{'Namespace.Role.NoPermission' | translate }}</h2>
</div>
</section>
......
......@@ -2,7 +2,7 @@ appUtil.service('AppUtil', ['toastr', '$window', '$q', '$translate', function (t
function parseErrorMsg(response) {
if (response.status == -1) {
return $translate.instant('Common.LoginExprieTips');
return $translate.instant('Common.LoginExpiredTips');
}
var msg = "Code:" + response.status;
if (response.data.message != null) {
......@@ -13,7 +13,7 @@ appUtil.service('AppUtil', ['toastr', '$window', '$q', '$translate', function (t
function parsePureErrorMsg(response) {
if (response.status == -1) {
return $translate.instant('Common.LoginExprieTips');
return $translate.instant('Common.LoginExpiredTips');
}
if (response.data.message != null) {
return response.data.message;
......
......@@ -2,15 +2,19 @@
var appUtil = angular.module('app.util', ['toastr', 'ngCookies', 'pascalprecht.translate'])
.config(['$translateProvider', function ($translateProvider) {
// $translateProvider.useMissingTranslationHandlerLog();
$translateProvider.useSanitizeValueStrategy(null); // disable sanitization by default
$translateProvider.useCookieStorage();
$translateProvider.useStaticFilesLoader({
prefix: '/i18n/',
suffix: '.json'
});
$translateProvider.preferredLanguage('en');
$translateProvider.fallbackLanguage('zh-cn');
$translateProvider.registerAvailableLanguageKeys(['en', 'zh-CN'], {
'zh-*': 'zh-CN',
'zh': 'zh-CN',
'en-*': 'en',
"*": "en"
})
$translateProvider.uniformLanguageTag('bcp47').determinePreferredLanguage();
}]);
/**service module 定义*/
var appService = angular.module('app.service', ['ngResource', 'app.util'])
......
......@@ -27,7 +27,7 @@ function createAppController($scope, $window, $translate, toastr, AppService, Ap
organizations.push(org);
});
$('#organization').select2({
placeholder: $translate.instant('Common.PelaseChooseDepartment'),
placeholder: $translate.instant('Common.PleaseChooseDepartment'),
width: '100%',
data: organizations
});
......@@ -60,7 +60,7 @@ function createAppController($scope, $window, $translate, toastr, AppService, Ap
var selectedOrg = $('#organization').select2('data')[0];
if (!selectedOrg.id) {
toastr.warning($translate.instant('Common.PelaseChooseDepartment'));
toastr.warning($translate.instant('Common.PleaseChooseDepartment'));
$scope.submitBtnDisabled = false;
return;
}
......@@ -74,7 +74,7 @@ function createAppController($scope, $window, $translate, toastr, AppService, Ap
owner = { id: $scope.currentUser.userId };
}
if (!owner) {
toastr.warning($translate.instant('Common.PelaseChooseOwner'));
toastr.warning($translate.instant('Common.PleaseChooseOwner'));
$scope.submitBtnDisabled = false;
return;
}
......
......@@ -62,7 +62,7 @@ function DeleteAppClusterNamespaceController($scope, $translate, toastr, AppUtil
toastr.warning($translate.instant('Delete.PleaseEnterAppId'));
return;
}
if (confirm($translate.instant('Delete.PleaseEnterAppId', { appId: $scope.app.appId }))) {
if (confirm($translate.instant('Delete.ConfirmDeleteAppId', { appId: $scope.app.appId }))) {
AppService.delete_app($scope.app.appId).then(function (result) {
toastr.success($translate.instant('Delete.Deleted'));
$scope.deleteAppBtnDisabled = true;
......@@ -99,9 +99,9 @@ function DeleteAppClusterNamespaceController($scope, $translate, toastr, AppUtil
return;
}
var confirmTip = $translate.instant('Delete.ConfirmDeleteCluster', {
appId: result.appId,
appId: $scope.cluster.appId,
env: $scope.cluster.env,
clusterName: result.name
clusterName: $scope.cluster.name
});
if (confirm(confirmTip)) {
......
......@@ -8,10 +8,12 @@ function LoginController($scope, $window, $location, $translate, toastr, AppUtil
if (params.error) {
$translate('Login.UserNameOrPasswordIncorrect').then(function(result) {
$scope.info = result;
})
});
}
if (params.logout) {
$scope.info = $translate.instant('Login.LogoutSuccessfully');
$translate('Login.LogoutSuccessfully').then(function(result) {
$scope.info = result;
});
}
}
......
......@@ -118,7 +118,7 @@ namespace_module.controller("LinkNamespaceController",
var namespaceNameLength = $scope.concatNamespace().length;
if (namespaceNameLength > 32) {
var errorTip = $translate.instant('Namespace.ChecknamespaceNameLengthTip', {
var errorTip = $translate.instant('Namespace.CheckNamespaceNameLengthTip', {
departmentLength: namespaceNameLength - $scope.appNamespace.name.length,
namespaceLength: $scope.appNamespace.name.length
});
......
......@@ -7,17 +7,17 @@ server_config_module.controller('ServerConfigController',
$scope.create = function () {
ServerConfigService.create($scope.serverConfig).then(function (result) {
toastr.success($translate.instant('SericeConfig.Saved'));
toastr.success($translate.instant('ServiceConfig.Saved'));
$scope.saveBtnDisabled = true;
$scope.serverConfig = result;
}, function (result) {
toastr.error(AppUtil.errorMsg(result), $translate.instant('SericeConfig.SaveFailed'));
toastr.error(AppUtil.errorMsg(result), $translate.instant('ServiceConfig.SaveFailed'));
});
};
$scope.getServerConfigInfo = function () {
if (!$scope.serverConfig.key) {
toastr.warning($translate.instant('SericeConfig.PleaseEnterKey'));
toastr.warning($translate.instant('ServiceConfig.PleaseEnterKey'));
return;
}
......@@ -25,11 +25,11 @@ server_config_module.controller('ServerConfigController',
$scope.saveBtnDisabled = false;
if (!result.key) {
toastr.info($translate.instant('SericeConfig.KeyNotExistsAndCreateTip', { key: $scope.serverConfig.key }));
toastr.info($translate.instant('ServiceConfig.KeyNotExistsAndCreateTip', { key: $scope.serverConfig.key }));
return;
}
toastr.info($translate.instant('SericeConfig.KeyExistsAndSaveTip', { key: $scope.serverConfig.key }));
toastr.info($translate.instant('ServiceConfig.KeyExistsAndSaveTip', { key: $scope.serverConfig.key }));
$scope.serverConfig = result;
}, function (result) {
AppUtil.showErrorMsg(result);
......
......@@ -49,7 +49,7 @@ function SettingController($scope, $location, $translate, toastr,
organizations.push(org);
});
$orgWidget.select2({
placeholder: $translate.instant('Common.PelaseChooseDepartment'),
placeholder: $translate.instant('Common.PleaseChooseDepartment'),
width: '100%',
data: organizations
});
......@@ -177,7 +177,7 @@ function SettingController($scope, $location, $translate, toastr,
var selectedOrg = $orgWidget.select2('data')[0];
if (!selectedOrg.id) {
toastr.warning($translate.instant('Common.PelaseChooseDepartment'));
toastr.warning($translate.instant('Common.PleaseChooseDepartment'));
return;
}
......@@ -187,13 +187,13 @@ function SettingController($scope, $location, $translate, toastr,
// owner
var owner = $('.ownerSelector').select2('data')[0];
if (!owner) {
toastr.warning($translate.instant('Common.PelaseChooseOwner'));
toastr.warning($translate.instant('Common.PleaseChooseOwner'));
return;
}
app.ownerName = owner.id;
AppService.update(app).then(function (app) {
toastr.success($translate.instant('Common.Modifed'));
toastr.success($translate.instant('App.Setting.Modified'));
initApplication();
$scope.display.app.edit = false;
$scope.submitBtnDisabled = false;
......
......@@ -45,7 +45,7 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, $trans
loadAppInfo();
handleFavorite();
}, function (result) {
toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.GetrUserInfoFailed'));
toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.GetUserInfoFailed'));
});
handlePermission();
......@@ -326,7 +326,7 @@ function ConfigBaseInfoController($rootScope, $scope, $window, $location, $trans
$scope.favoriteId = 0;
toastr.success($translate.instant('Config.CancelledFavorite'));
}, function (result) {
toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.CanceFavoriteFailed'));
toastr.error(AppUtil.errorMsg(result), $translate.instant('Config.CancelFavoriteFailed'));
})
};
}
......
......@@ -35,7 +35,7 @@ function OpenManageController($scope, $translate, toastr, AppUtil, OrganizationS
organizations.push(org);
});
$orgWidget.select2({
placeholder: $translate.instant('Common.PelaseChooseDepartment'),
placeholder: $translate.instant('Common.PleaseChooseDepartment'),
width: '100%',
data: organizations
});
......@@ -103,7 +103,7 @@ function OpenManageController($scope, $translate, toastr, AppUtil, OrganizationS
var selectedOrg = $orgWidget.select2('data')[0];
if (!selectedOrg.id) {
toastr.warning($translate.instant('Common.PelaseChooseDepartment'));
toastr.warning($translate.instant('Common.PleaseChooseDepartment'));
return;
}
......@@ -113,7 +113,7 @@ function OpenManageController($scope, $translate, toastr, AppUtil, OrganizationS
// owner
var owner = $('.ownerSelector').select2('data')[0];
if (!owner) {
toastr.warning($translate.instant('Common.PelaseChooseOwner'));
toastr.warning($translate.instant('Common.PleaseChooseOwner'));
return;
}
$scope.consumer.ownerName = owner.id;
......
......@@ -18,9 +18,10 @@ directive_module.directive('apollonav',
scope.$apply(function () {});
});
$('#app-search-list').select2({
placeholder: $translate.instant('ApolloConfirmDialog.SearchPlaceHolder'),
ajax: {
$translate('ApolloConfirmDialog.SearchPlaceHolder').then(function(placeholderLabel) {
$('#app-search-list').select2({
placeholder: placeholderLabel,
ajax: {
url: "/apps/search",
dataType: 'json',
delay: 400,
......@@ -28,44 +29,45 @@ directive_module.directive('apollonav',
return {
query: params.term || '',
page: params.page ? params.page - 1 : 0,
size: 20
};
},
processResults: function (data) {
if (data && data.content) {
var hasMore = data.content.length
=== data.size;
var result = [];
data.content.forEach(function (app) {
result.push({
id: app.appId,
text: app.appId + ' / ' + app.name
})
});
return {
results: result,
pagination: {
more: hasMore
}
size: 20
};
} else {
return {
results: [],
pagination: {
more: false
}
};
}
},
processResults: function (data) {
if (data && data.content) {
var hasMore = data.content.length
=== data.size;
var result = [];
data.content.forEach(function (app) {
result.push({
id: app.appId,
text: app.appId + ' / ' + app.name
})
});
return {
results: result,
pagination: {
more: hasMore
}
};
} else {
return {
results: [],
pagination: {
more: false
}
};
}
}
}
}
});
});
$('#app-search-list').on('select2:select', function () {
var selected = $('#app-search-list').select2('data');
if (selected && selected.length) {
jumpToConfigPage(selected[0].id)
}
$('#app-search-list').on('select2:select', function () {
var selected = $('#app-search-list').select2('data');
if (selected && selected.length) {
jumpToConfigPage(selected[0].id)
}
});
});
function jumpToConfigPage(selectedAppId) {
......
......@@ -124,7 +124,7 @@ function itemModalDirective($translate, toastr, $sce, AppUtil, EventManager, Con
AppUtil.hideModal('#itemModal');
toastr.success($translate.instant('ItemModal.ModifedTips'));
toastr.success($translate.instant('ItemModal.ModifiedTips'));
}, function (result) {
toastr.error(AppUtil.errorMsg(result), $translate.instant('ItemModal.ModifyFailed'));
});
......
......@@ -659,7 +659,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
branch.rules
)
.then(function (result) {
toastr.success($translate.instant('ApolloNsPanel.GrayscaleModifed'));
toastr.success($translate.instant('ApolloNsPanel.GrayscaleModified'));
//show tips if branch has not release configs
if (branch.itemModifiedCnt) {
......@@ -729,7 +729,7 @@ function directive($window, $translate, toastr, AppUtil, EventManager, Permissio
namespace.baseInfo.namespaceName,
model).then(
function (result) {
toastr.success($translate.instant('ApolloNsPanel.ModifedTips'));
toastr.success($translate.instant('ApolloNsPanel.ModifiedTips'));
//refresh all namespace items
EventManager.emit(EventManager.EventType.REFRESH_NAMESPACE,
{
......
......@@ -10,7 +10,7 @@
<link rel="stylesheet" type="text/css" href="vendor/select2/select2.min.css">
<link rel="stylesheet" type="text/css" media='all' href="vendor/angular/loading-bar.min.css">
<link rel="stylesheet" type="text/css" href="styles/common-style.css">
<title>{{'SericeConfig.Title' | translate }}</title>
<title>{{'ServiceConfig.Title' | translate }}</title>
</head>
<body>
......@@ -22,8 +22,8 @@
<div class="col-md-8 col-md-offset-2">
<div class="panel">
<header class="panel-heading">
{{'SericeConfig.Title' | translate }}
<small>{{'SericeConfig.Tips' | translate }}</small>
{{'ServiceConfig.Title' | translate }}
<small>{{'ServiceConfig.Tips' | translate }}</small>
</header>
<div class="panel-body">
......@@ -31,12 +31,12 @@
<div class="form-group">
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'SericeConfig.Key' | translate }}
{{'ServiceConfig.Key' | translate }}
</label>
<div class="col-sm-8">
<input type="text" class="form-control" name="key" ng-model="serverConfig.key"
required>
<small>{{'SericeConfig.KeyTips' | translate }}</small>
<small>{{'ServiceConfig.KeyTips' | translate }}</small>
</div>
<div class="col-sm-1">
<button class="btn btn-info"
......@@ -46,7 +46,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
{{'SericeConfig.Value' | translate }}
{{'ServiceConfig.Value' | translate }}
</label>
<div class="col-sm-9">
<textarea class="form-control" rows="4" name="value"
......@@ -55,7 +55,7 @@
</div>
<div class="form-group">
<label class="col-sm-2 control-label">
{{'SericeConfig.Comment' | translate }}</label>
{{'ServiceConfig.Comment' | translate }}</label>
<div class="col-sm-9">
<textarea class="form-control" rows="4" name="comment"
ng-model="serverConfig.comment"></textarea>
......
......@@ -297,7 +297,7 @@ table th {
.project-info th {
text-align: right;
padding: 4px 6px;
padding: 4px 2px;
width: 5em;
}
......@@ -654,7 +654,7 @@ table th {
.release-history .operation-caption {
position: absolute;
top: 45px;
width: 75px;
width: 100px;
height: 18px;
color: #fff;
font-size: 12px;
......
......@@ -31,7 +31,7 @@
<ul class="dropdown-menu">
<li value="en"><a href="javascript:void(0)" ng-click="changeLanguage('en')">English</a></li>
<li value="zh-cn"><a href="javascript:void(0)" ng-click="changeLanguage('zh-cn')">简体中文</a></li>
<li value="zh-CN"><a href="javascript:void(0)" ng-click="changeLanguage('zh-CN')">简体中文</a></li>
</ul>
</li>
<li class="dropdown" ng-if="hasRootPermission">
......
<table class="table table-hover" style="width: 250px">
<table class="table table-hover" style="width: 300px">
<thead>
<tr>
<td><input type="checkbox" ng-checked="envAllSelected" ng-click="toggleEnvsCheckedStatus()"></td>
......
......@@ -159,7 +159,7 @@
title="{{'Component.Namespace.Branch.Body.DeletedItem' | translate }}">{{'Component.Namespace.Branch.Body.Delete' | translate }}</span>
<span class="label label-info" ng-if="!config.isDeleted && config.masterItemExists"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ChangedFormMaster' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
title="{{'Component.Namespace.Branch.Body.ChangedFromMaster' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
<span class="label label-success"
ng-if="!config.isDeleted && !config.masterItemExists" data-tooltip="tooltip"
data-placement="bottom"
......@@ -268,7 +268,7 @@
<span class="label label-info"
ng-if="config.isModified && config.oldValue && !config.isDeleted"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ModifedItem' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
title="{{'Component.Namespace.Branch.Body.ModifiedItem' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
<span class="label label-danger" ng-if="config.isDeleted" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.DeletedItem' | translate }}">{{'Component.Namespace.Branch.Body.Delete' | translate }}</span>
......@@ -307,7 +307,7 @@
<div class="alert alert-warning no-radius"
ng-show="!namespace.hasModifyPermission && !namespace.hasReleasePermission">
<strong>Tips:</strong>
{{'Component.Namespace.Branch.GrayScaleRule.NoPermissonTips' | translate }}
{{'Component.Namespace.Branch.GrayScaleRule.NoPermissionTips' | translate }}
</div>
<table class="table table-bordered table-hover">
......@@ -397,7 +397,7 @@
<div class="row text-center"
ng-show="namespace.branch.latestReleaseInstances.content.length < namespace.branch.latestReleaseInstances.total">
<button class="btn btn-default"
ng-click="loadInstanceInfo(namespace.branch)">{{'Component.Namespace.Branch.Instance.LoadingMore' | translate }}</button>
ng-click="loadInstanceInfo(namespace.branch)">{{'Component.Namespace.Branch.Instance.LoadMore' | translate }}</button>
</div>
</div>
......@@ -450,7 +450,7 @@
<!--兼容老数据,不显示item类型为空行和注释的item-->
<tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
<td width="2%">
<td width="6%">
{{'Component.Namespace.Branch.History.NewAdded' | translate }}
</td>
<td width="20%" title="{{item.key}}">
......@@ -458,9 +458,9 @@
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' :''"></span>
</td>
<td width="30%">
<td width="28%">
</td>
<td width="30%" class="cursor-pointer" title="{{item.value}}"
<td width="28%" class="cursor-pointer" title="{{item.value}}"
ng-click="showText(item.value)">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
......@@ -471,19 +471,19 @@
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.updateItems">
<td width="2%">
{{'Component.Namespace.Branch.History.Modifed' | translate }}
<td width="6%">
{{'Component.Namespace.Branch.History.Modified' | translate }}
</td>
<td width="20%" title="{{item.newItem.key}}">
<span ng-bind="item.newItem.key | limitTo: 250"></span>
<span ng-bind="item.newItem.key.length > 250 ? '...' :''"></span>
</td>
<td width="30%" class="cursor-pointer" title="{{item.oldItem.value}}"
<td width="28%" class="cursor-pointer" title="{{item.oldItem.value}}"
ng-click="showText(item.oldItem.value)">
<span ng-bind="item.oldItem.value | limitTo: 250"></span>
<span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="30%" class="cursor-pointer" title="{{item.newItem.value}}"
<td width="28%" class="cursor-pointer" title="{{item.newItem.value}}"
ng-click="showText(item.newItem.value)">
<span ng-bind="item.newItem.value | limitTo: 250"></span>
<span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
......@@ -495,18 +495,18 @@
</tr>
<tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment">
<td width="2%">
<td width="6%">
{{'Component.Namespace.Branch.History.Deleted' | translate }}
</td>
<td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' :''"></span>
</td>
<td width="30%" title="{{item.value}}">
<td width="28%" title="{{item.value}}">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="30%">
<td width="28%">
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
......@@ -537,7 +537,7 @@
</div>
<div class="text-center">
<button type="button" class="btn btn-default" ng-show="!namespace.branch.hasLoadAllCommit"
ng-click="loadCommitHistory(namespace.branch)">{{'Component.Namespace.Branch.History.LoadingMore' | translate }}
ng-click="loadCommitHistory(namespace.branch)">{{'Component.Namespace.Branch.History.LoadMore' | translate }}
<span class="glyphicon glyphicon-menu-down"></span></button>
</div>
<div class="empty-container text-center"
......
......@@ -80,7 +80,7 @@
<span class="label label-info"
ng-if="config.isModified && config.oldValue && !config.isDeleted"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Publish.ModifedTips' | translate }}">{{'Component.Publish.Modifed' | translate }}</span>
title="{{'Component.Publish.ModifiedTips' | translate }}">{{'Component.Publish.Modified' | translate }}</span>
<span class="label label-danger" ng-if="config.isDeleted" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Publish.DeletedTips' | translate }}">{{'Component.Publish.Deleted' | translate }}</span>
......
......@@ -6,7 +6,7 @@
aria-hidden="true">&times;</span></button>
<div class="modal-title text-center">
<span style="font-size: 18px;" ng-bind="toRollbackNamespace.firstRelease.name"></span>
<span style="font-size: 18px;"> &nbsp;{{'Component.Rollback.Goto' | translate }}&nbsp;</span>
<span style="font-size: 18px;"> &nbsp;{{'Component.Rollback.To' | translate }}&nbsp;</span>
<span style="font-size: 18px;" ng-bind="toRollbackNamespace.secondRelease.name"></span>
</div>
</div>
......@@ -14,7 +14,7 @@
<div class="alert alert-warning" role="alert">
{{'Component.Rollback.Tips' | translate }}
<a target="_blank"
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{toRollbackNamespace.baseInfo.clusterName}}&namespaceName={{toRollbackNamespace.baseInfo.namespaceName}}">点击查看</a>
href="/config/history.html?#/appid={{appId}}&env={{env}}&clusterName={{toRollbackNamespace.baseInfo.clusterName}}&namespaceName={{toRollbackNamespace.baseInfo.namespaceName}}">{{'Component.Rollback.ClickToView' | translate }}</a>
</div>
<div class="form-group" style="margin-top: 15px;">
......@@ -46,7 +46,7 @@
<span
ng-show="change.type == 'ADDED'">{{'Component.Rollback.Added' | translate }}</span>
<span
ng-show="change.type == 'MODIFIED'">{{'Component.Rollback.Modifed' | translate }}</span>
ng-show="change.type == 'MODIFIED'">{{'Component.Rollback.Modified' | translate }}</span>
<span
ng-show="change.type == 'DELETED'">{{'Component.Rollback.Deleted' | translate }}</span>
</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment