Commit 3d20d488 authored by Ken you's avatar Ken you

add switch language ---Ken

parent b9f36bc9
......@@ -339,12 +339,12 @@ grunt.initConfig({
dest: '<%= pkg.bundleTemp %>/taxDocumentManage.js'
},
appJs: {
src: ["Scripts/app.js",
"Scripts/app.config.js",
"Scripts/module-part1.js",
"Scripts/module-part2.js",
"Scripts/module-part3.js",
"Scripts/module-part4.js"
src: ["app/app.js",
"app/app.config.js",
"app/module-part1.js",
"app/module-part2.js",
"app/module-part3.js",
"app/module-part4.js"
],
dest: '<%= pkg.bundleTemp %>/app.js'
},
......
......@@ -285,7 +285,11 @@
"cellCommentReplyEmptyMsg": "Please input content",
"chartsetting": "Chart settings",
"dashboard": "Data summary",
"dateFormat4YearMonth": " yyyy 年 mm 月",
"dateFormat4Year": " yyyy ",
"dateFormat4YearMonth": " yyyy-mm ",
"dateFormat4YearMonthDay": "yyyy-mm-dd",
"dateFormat4YearMonthDayCh": "yyyy-mm-dd",
"dateFormat4YearMonthForDX": "yyyy-MM",
"fileupload": "File upload",
"log": "Log",
"logoff": "Log off",
......
{}
\ No newline at end of file
{
"@HowToUse": "在提交前,使用PWC.sortJson()对json内容进行排序",
"1stQuarterlyCITFilingReturn": "1st Quarterly CIT Filing Return",
"2ndQuarterlyCITFilingReturn": "2nd Quarterly CIT Filing Return",
"3rdQuarterlyCITFilingReturn": "3rd Quarterly CIT Filing Return",
"4thQuarterlyCITFilingReturn": "4th Quarterly CIT Filing Return",
"AllTask": "All",
"AnnualCITFilingReturn": "Annual CIT Filing Return",
"AnnualCITFilingWorkingPaper": "Annual CIT Filing Working Paper",
"AuditFeedback": "Tax audit feedback",
"AuditImplementation": "Tax audit implementation",
"AuditNotice": "Tax audit notice",
"AuditReport": "Audit report",
"AuditSolution": "Tax audit solution",
"BNDKJTXE": "Amortization in current year:",
"BS": "Balance sheet",
"BankGroup": "Certificate of bank and group",
"Cancellation": "Establishment, liquidation and cancellation of branches",
"CompleteTask": "Completed",
"CreateTask": "Create Task",
"CreditRecord": "Tax credit record",
"DFFSETotal": "Total Credit Amt:",
"DFJETotal": "Total Credit Amt:",
"DataProcessDataName_AnnualSettlement": "Annual CIT Filing Return",
"DataProcessDataName_CITFirstQuarterly": "1st Quarter",
"DataProcessDataName_CITForthQuarterly": "4th Quarter",
"DataProcessDataName_CITQuarterly": "Quarterly CIT Filing Return",
"DataProcessDataName_CITSecondQuarterly": "2nd Quarter",
"DataProcessDataName_CITThirdQuarterly": "3rd Quarter",
"DataProcessDataName_UpdateReportConfig": "Update Report Configuration",
"DataProcessDataName_FinanceReport": "Financial Report",
"DataProcessDataName_GenerateReport": "Generate Report",
"DataProcessDataName_ModelAnalysis": "Model Analytics",
"DataProcessDataName_UpdateTB": "Update Trial Balance",
"DataProcessDataName_YearWorkPaper": "Annual CIT Filing Working Paper",
"DataProcessData_Generate": "Generate",
"DataProcessData_PreGenerate": "Generate",
"DataProcessData_Update": "Update",
"DepreciationCurrentYearTotal": "Total Depreciation",
"DepreciationPerTaxCurrentYearTotal": "Total Tax Depreciation",
"DividendReturn": "Dividend return",
"DueDate": "Due Date",
"FinancialReport": "Financial Report",
"InprogressTask": "In Progress",
"JFFSETotal": "Total Debit Amt:",
"JFJETotal": "Total Debit Amt:",
"NeedToUpdate": "Need to update",
"NotBeginTask": "Not Started",
"OtherRecordFiling": "Other record filing",
"OutDateTask": "Overdue",
"OutOfDateTask": "Overdue",
"PL": "Profit and Loss statement",
"PZCITCount": "Total Records:",
"Planning": "Tax planning",
"PleaseSelectAtLeastOneItem": "Please select at least one item!",
"ProfitAndLossStatement": "Profit and Loss statement",
"QCYETotal": "Total Begin Balance:",
"QMYETotal": "Total End Balance:",
"QNDKJZJE": "Depreciation last year:",
"QuarterlyCITFilingReturn": "Quarterly CIT Filing Return",
"RecordFiling": "Record filing of tax deduction on asset loss",
"SpecialTasks": "Special tax tasks",
"TBDataNum": "Total Records:",
"TaskDescription": "Description",
"TaskEntity": "Entity",
"TaskName": "Task Name",
"TaxInspection": "Tax inspection",
"TaxStatistics": "Investigation and statistics from tax bureau",
"TaxTaskManage": "Tax Task Management",
"TaxTaskType": "Task Type",
"ThisWeek": "This Week",
"Today": "Today",
"WaitCompleteTask": "In Progress",
"dateFormat4YearMonthDay": "yyyy-mm-dd",
"noData": "No Data",
"toUpdate": "To be updated",
"~MustBeEndOneApp": "I Must be the End One, please!"
}
\ No newline at end of file
......@@ -1549,6 +1549,7 @@
"completed": "Completed",
"customInvoice": "Customs verification",
"dataMapping": "Data mapping",
"dateFormat4Year": " yyyy",
"dateFormat4YearMonth": " yyyy - mm",
"dateFormat4YearMonthDay": "yyyy-mm-dd",
"deleteChart": "确定删除图表",
......
......@@ -1818,6 +1818,8 @@
"showData": "显示数据",
"showGrid": "显示表格",
"startCaculateData": "开始处理",
"ReportExportConfirm": "报表数据还未保存,操作结果可能和实际不一致,确定要执行这个操作吗?",
"LeaveReport": "报表数据还未保存,确定要离开页面吗?离开会导致数据丢失。",
"stepchart": "阶梯图",
"switchValue": "显示数值",
"taxDashboard": "税务指标仪表盘",
......@@ -1834,5 +1836,18 @@
"welfareFundsPayrollSalaryAbnormalRelevance": "应付福利费与应付工资关联异常",
"wronglyDistributedExpenseOrCosts": "错误列支的费用",
"wronglyDistributedExpenseOrCostsDesc": "业务招待费和广告及宣传费未列支在正确的科目下",
"~MustBeEndOneApp": "我必须是最后一个!"
"~MustBeEndOneApp": "我必须是最后一个!",
"DataSourceFilter": "数据源筛选",
"PleaseSelectDatabase": "请选择数据库",
"PleaseEnterTheFiledWordings": "请输入取值字段",
"PleaseEnterTheFilteredCondition": "请输入筛选条件",
"Filter": "筛选",
"PleaseSelectTheField": "请选择字段",
"originator":"Originator",
"associatedSchedule":"Associated Schedule",
"associatedCell":"Associated Cell",
"currentReviewNotesDetails":"Current Review Notes Details",
"ImportFixedAssets":"导入固定资产",
"FixedAssetsMapping":"FA对应关系",
"PleaseFillinAllDataField": "请输入数据源筛选条件"
}
\ No newline at end of file
......@@ -91,7 +91,7 @@ var app = angular.module('adminApp', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.t
.config(['$logProvider', '$translateProvider', '$translatePartialLoaderProvider', 'region', '$compileProvider',
function ($logProvider, $translateProvider, $translatePartialLoaderProvider, region, $compileProvider) {
'use strict';
region = 'zh-CN';
// to disable various debug runtime information in the compiler to DOM elements.
$compileProvider.debugInfoEnabled(false);
// enable output $log.debug by default
......
......@@ -119,6 +119,7 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
urlTemplate: '/app-resources/i18n/{lang}/{part}.json'
});
region = window.localStorage.langTemp || region;
$translateProvider
.preferredLanguage(region)
.fallbackLanguage(region);
......@@ -302,9 +303,9 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
return translation;
}
])
.controller('AppController', ['$scope', '$log', '$location', '$translate', '$translatePartialLoader',
.controller('AppController', ['$rootScope','$scope', '$log', '$location', '$translate', '$translatePartialLoader',
'$window', 'appRoute', 'application', 'appTranslation', '$timeout', '$uibModal', 'loginContext', '$ExceptionlessClient', 'signalRSvc',
'exceptionlessServerURL', function ($scope, $log, $location, $translate, $translatePartialLoader, $window, appRoute,
'exceptionlessServerURL', function ($rootScope,$scope, $log, $location, $translate, $translatePartialLoader, $window, appRoute,
application, appTranslation, $timeout, $uibModal, loginContext, $ExceptionlessClient, signalRSvc, exceptionlessServerURL) {
'use strict';
$log.debug('AppController.ctor()...');
......@@ -332,6 +333,28 @@ var app = angular.module('app', ['ui.tree', 'ui.bootstrap', 'ui.bootstrap.tpls',
$log.debug('$stateChangeSuccess: ');
});
var langs = {};
try {
var obj= JSON.parse(window.localStorage.lang);
if(typeof obj == 'object' && obj ){
langs = obj;
}
} catch(e) {}
var region = langs[loginContext.userName] || 'en-us';
var flag = window.localStorage.langTemp;
$rootScope.changeLanguage = function(lang){
$translate.use(lang);
appTranslation.loadAll();
$rootScope.currentLanguage = lang;
$rootScope.currentLanguageDesc = $rootScope.currentLanguage == 'en-us' ? 'Switch to Chinese':'切换至英文';
langs[loginContext.userName] = lang;
window.localStorage.lang = JSON.stringify(langs);
window.localStorage.langTemp = lang;
if(flag !== window.localStorage.langTemp){
window.location.reload();
}
};
$rootScope.changeLanguage(region);
// publish unbeforeunload event to child scopes
$scope.onbeforeunload = function () {
......
<div class="ack-page">
<div class="ack-footer">
<div class="page-size">
<span>共有<span class="total-number">{{pagingOptions.totalItems}}</span>条记录</span>
<span class="padding-span" ng-show="!hideSelector">每页显示</span>
<select class="padding-span page-box" ng-model="pagingOptions.pageSizeString" ng-change="pagingService.pageSizeSelectionChanged()" ng-show="!hideSelector">
<option ng-repeat="option in pagingOptions.pagingSelection" value="{{option.id}}">{{option.value}}</option>
</select>
<span class="padding-span" ng-show="!hideSelector">条记录</span>
<span class="padding-span" ng-show="!hideSelector">跳至 <span class="padding-span"><input class="page-box " type="number" ng-change="pagingService.pageIndexChanging()" ng-model="pagingOptions.pageIndex" /></span>&nbsp;</span>
<!--共有-->
<span>{{'TotalPage'| translate}}<span class="total-number">{{pageOptions.totalItems}}</span>{{'RecordCount' | translate}}</span>
<!--每页显示-->
<span class="padding-span" ng-show="!hideSelector">{{'RowForPage'| translate}}</span>
<span class="padding-span" ng-show="!hideSelector">当前页 <span class="normal-number">{{pagingOptions.pageIndex}}</span>/<span class="normal-number">{{pagingOptions.totalPages}}</span></span>
<select class="padding-span page-box" ng-model="pageOptions.pageSizeString" ng-change="pagingService.pageSizeSelectionChanged()" ng-show="!hideSelector">
<option ng-repeat="option in pageOptions.pagingSelection" value="{{option.id}}">{{option.value}}</option>
</select>
<!--条记录-->
<span class="padding-span" ng-show="!hideSelector">{{'RecordCount' | translate}}</span>
<!--跳至-->
<span class="padding-span" ng-show="!hideSelector">{{'JumpTo' | translate}} <span class="padding-span"><input class="page-box " type="number" ng-change="pagingService.pageIndexChanging()" ng-model="pageOptions.pageIndex" /></span>&nbsp;{{'Page' | translate}}</span>
<!--当前页-->
<span class="padding-span" ng-show="!hideSelector">{{'CurrentPage' | translate}} <span class="normal-number">{{pageOptions.pageIndex}}</span>/<span class="normal-number">{{pageOptions.totalPages}}</span></span>
</div>
<ul uib-pagination total-items="pagingOptions.totalItems" items-per-page="pagingOptions.pageSize" ng-model="pagingOptions.pageIndex" num-pages="pagingOptions.totalPages" max-size="pagingOptions.maxSize" class="pagination-sm"
boundary-link-numbers="true" ng-change="pagingService.pageIndexChanging()" rotate="true" boundary-links="true" first-text="{{pagingOptions.firstPage}}" previous-text="{{pagingOptions.previousPage}}" last-text="{{pagingOptions.lastPage}}" next-text="{{pagingOptions.nextPage}}"></ul>
<ul uib-pagination total-items="pageOptions.totalItems" items-per-page="pageOptions.pageSize" ng-model="pageOptions.pageIndex" num-pages="pageOptions.totalPages" max-size="pageOptions.maxSize" class="pagination-sm"
boundary-link-numbers="true" ng-change="pagingService.pageIndexChanging()" rotate="true" boundary-links="true" first-text="{{pageOptions.firstPage}}" previous-text="{{pageOptions.previousPage}}" last-text="{{pageOptions.lastPage}}" next-text="{{pageOptions.nextPage}}"></ul>
</div>
</div>
// web service proxy for voucher
webservices.factory('dataProcessService', ['$log', 'vatReportService', function ($log, vatReportService) {
'use strict';
function Job(serviceType, tplId, month, status) {
this.serviceType = serviceType;
this.tplId = tplId;
this.month = month;
this.status = status;
}
var jobsArr = [];
//执行更新项目状态的任务
function status_job() {
var job = jobsArr.shift();
if (job) {
//更新每个状态值
vatReportService.updateProcInfo(job.serviceType, job.tplId, job.month, job.status).then(function (resData) {
setTimeout(status_job, 100);
$log.log("status_job request: " + job.tplId + ", " + job.status);
});
} else {
setTimeout(status_job, 1000);
}
}
//页面容错机制
//1. 后台查询当前项目有没有正在 处理中的报表, 间隔连续两次没查询到,证明没有处理中的,更新页面状态
var timeInterval = 15 * 1000;
var noProcItemCount = 0;
var _serviceType, _projectId, _month, _status,_cb;
function heartBeat() {
vatReportService.heartBeat(_projectId, _month).then(function (resData) {
//if ($scope.isStartProcData) {//如果是当前处理页面
$log.info("heartBeat......" + noProcItemCount);
if (resData && resData.data.result) {
//没有处理中加一次
noProcItemCount++;
//超过两次,就更新状态
if (noProcItemCount > 3) {
//1. 更新项目状态,当前项目状态更改为 处理已完成
//vatReportService.updateProcInfo($scope.serviceType, vatSessionService.project.id, vatSessionService.month, getStatus('completed')).then(function (resData) {
vatReportService.updateProcInfo(_serviceType, _projectId, _month, _status).then(function (resData) {
//更新页面状态
_cb();
timeInterval = 60 * 1000;//60s
});
//注意后台要考虑的问题, 为了防止 signalR 的断线情况,将报表完成状态放到后台更新,前台通知更新显示而已
}
} else {
//表示有处理中
noProcItemCount = 0;
}
if (noProcItemCount == 0) {
timeInterval = 60 * 1000 * 3;//正在处理中,降低频率
} else {
timeInterval = 15 * 1000;
}
setTimeout(heartBeat, timeInterval);
//}
});
}
return {
startJob: function () {
setTimeout(status_job, 100);
},
addJob: function (serviceType, tplId, month, status) {
jobsArr.push(new Job(serviceType, tplId, month, status));
},
startHeartBeat: function (serviceType, projectId, month, status,cb) {
_serviceType = serviceType;
_projectId = projectId;
_month = month;
_status = status;
_cb = cb;
setTimeout(heartBeat, timeInterval);
}
};
}]);
\ No newline at end of file
......@@ -214,9 +214,9 @@
$scope.dateFormat = $translate.instant('dateFormat4Year');
}
if ($scope.serviceTypeId === enums.serviceType.VAT) {
$scope.systemTitle = $translate.instant('增值税申报');
$scope.systemTitle = $translate.instant('MenuVAT');
$scope.viewMode = 1;
$scope.dateFormat = $translate.instant(' yyyy 年 mm 月');
$scope.dateFormat = $translate.instant('dateFormat4YearMonth');
}
......
......@@ -48,10 +48,13 @@
<span style="margin-left: 02px; font-size: 15px;cursor:pointer;">{{loginUserName | limitString:10}}</span>
<i class="fa fa-sort-down"></i>
</div>
<div class="user-menu">
<div class="user-menu" style="width:150px;">
<a ng-click="showChangePassword()" id="userManageMenu">
<p>{{'ChangePassword' | translate}}</p>
</a>
<a href="" ng-click="$root.changeLanguage($root.currentLanguage == 'en-us' ? 'zh-CN' : 'en-us')" id="userManageMenu">
<p>{{$root.currentLanguageDesc}}</p>
</a>
</div>
</div>
<!--铃铛通知-->
......
......@@ -1047,9 +1047,9 @@
$scope.dateFormat = $translate.instant('dateFormat4Year');
}
if ($scope.serviceTypeId === enums.serviceType.VAT) {
$scope.systemTitle = $translate.instant('增值税申报');
$scope.systemTitle = $translate.instant('MenuVAT');
$scope.viewMode = 1;
$scope.dateFormat = $translate.instant(' yyyy 年 mm 月');
$scope.dateFormat = $translate.instant('dateFormat4YearMonth');
}
if ($scope.serviceTypeId === enums.serviceType.AssetsManage) {
$scope.systemTitle = $translate.instant('AssetTitle');
......
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