Browse Source

英文翻译

jie 2 months ago
parent
commit
e9befcf767

+ 3 - 3
atlas/js/utils/CommonViewFunction.js

@@ -363,8 +363,8 @@ define([ "require", "utils/Utils", "modules/Modal", "utils/Messages", "utils/Enu
     }, CommonViewFunction.createEditGlossaryCategoryTermSubmit = function(options) {
         if (options) var ref = options.ref, modal = options.modal, model = options.model, node = options.node, isTermView = options.isTermView, isCategoryView = options.isCategoryView, collection = options.collection, isGlossaryView = options.isGlossaryView, data = ref.ui[isGlossaryView ? "glossaryForm" : "categoryTermForm"].serializeArray().reduce(function(obj, item) {
             return obj[item.name] = item.value.trim(), obj;
-        }, {}), newModel = new options.collection.model(), messageType = "Glossary ";
-        isTermView ? messageType = "Term " : isCategoryView && (messageType = "Category ");
+        }, {}), newModel = new options.collection.model(), messageType = "术语表 ";
+        isTermView ? messageType = "术语 " : isCategoryView && (messageType = "分类 ");
         var ajaxOptions = {
             silent: !0,
             success: function(rModel, response) {
@@ -401,7 +401,7 @@ define([ "require", "utils/Utils", "modules/Modal", "utils/Messages", "utils/Enu
             options.model), newModel = new options.collection.model(), noticeRef = null, ajaxOptions = {
                 success: function(rModel, response) {
                     noticeRef && noticeRef.remove(), Utils.notifySuccess({
-                        content: (isCategoryView || isEntityView ? "Term" : "Category") + " association is removed successfully"
+                        content: (isCategoryView || isEntityView ? "术语" : "分类") + " 连接已成功删除"
                     }), options.callback && options.callback();
                 },
                 cust_error: function() {

+ 10 - 3
atlas/js/utils/Utils.js

@@ -156,7 +156,7 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         response && responseJSON && (message = Utils.replaceToChinese(responseJSON.errorMessage) || responseJSON.message || responseJSON.error || message);
         var existingError = $(".ui-pnotify-container.alert-danger .ui-pnotify-text").text();
         existingError !== message && Utils.notifyError({
-            content: message
+            content: Utils.regexDuplicate(message)
         });
     }, Utils.cookie = {
         setValue: function(cname, cvalue) {
@@ -614,15 +614,22 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
             case "startTime": return "开始时间";
             case "hostName": return "主机名";
             case "__pendingTasks": return "待完成的任务";
+            case "Glossary": return "术语表";
+            case "Category": return "分类";
+            case "Term": return "术语";
             default: return name;
         }
 
+    }, Utils.regexDuplicate=function (txt){
+        var regex=/Glossary term with qualifiedName (.*?) already exists/
+        var match=regex.exec(txt);
+        return match && match[1]?"存在相同名称和术语表的术语"+match[1]+",无法重复创建":txt
     },
-        Utils.replaceToChinese = function(name) {
+    Utils.replaceToChinese = function(name) {
           return  name
               .replace("Names must consist of a letter followed by a sequence of letter, number, space, or _ characters","名称必须由一个字母和一系列字母、数字、空格或_字符组成")
               .replace("invalid name for CLASSIFICATION.","分类的名称无效。")
 
-        },
+    },
         Utils;
 });

+ 1 - 1
atlas/js/views/glossary/AssignTermLayoutView.js

@@ -87,7 +87,7 @@ define([ "require", "backbone", "hbs!tmpl/glossary/AssignTermLayoutView_tmpl", "
             var that = this, data = [], termAttributeFormData = [], selectedItem = this.glossary.selectedItem, selectedGuid = selectedItem.guid, termName = selectedItem.text, ajaxOptions = {
                 success: function(rModel, response) {
                     Utils.notifySuccess({
-                        content: (that.isCategoryView || that.isEntityView || that.isAttributeRelationView ? "Term" : "Category") + " is associated successfully "
+                        content: (that.isCategoryView || that.isEntityView || that.isAttributeRelationView ? "术语" : "分类") + "已成功关联 "
                     }), that.modal.trigger("closeModal"), that.callback && that.callback();
                 },
                 cust_error: function() {

+ 2 - 2
atlas/js/views/glossary/GlossaryLayoutView.js

@@ -463,7 +463,7 @@ define([ "require", "backbone", "hbs!tmpl/glossary/GlossaryLayoutView_tmpl", "ut
                         silent: !0
                     }) : (glossary = that.glossaryCollection.fullCollection.first(), gId = glossary ? glossary.get("guid") : null)), 
                     Utils.notifySuccess({
-                        content: messageType + Messages.getAbbreviationMsg(!1, "deleteSuccessMessage")
+                        content: Utils.toChinese(messageType)  + Messages.getAbbreviationMsg(!1, "deleteSuccessMessage")
                     });
                     var url = gId ? "#!/glossary/" + gId : "#!/glossary";
                     null == gId && (that.glossary.selectedItem = {}, that.value = null, that.query = {
@@ -497,7 +497,7 @@ define([ "require", "backbone", "hbs!tmpl/glossary/GlossaryLayoutView_tmpl", "ut
                 cancel: function(argument) {}
             };
             "Glossary" == type ? messageType = "Glossary" : "GlossaryCategory" == type ? messageType = "Category" : "GlossaryTerm" == type && (messageType = "Term"), 
-            notifyObj.text = "Are you sure you want to delete the " + messageType, Utils.notifyConfirm(notifyObj);
+            notifyObj.text = "确定需要删除该" + Utils.toChinese(messageType) , Utils.notifyConfirm(notifyObj);
         },
         triggerUrl: function(options) {
             if (!this.isAssignView) {

+ 1 - 1
atlas/js/views/glossary/TermRelationAttributeLayoutView.js

@@ -122,7 +122,7 @@ define([ "require", "backbone", "hbs!tmpl/glossary/TermRelationAttributeLayoutVi
             e.stopPropagation();
             var that = this, notifyObj = {
                 modal: !0,
-                text: "Are you sure you want to remove term association",
+                text: "确定删除该关联关系?",
                 ok: function(argument) {
                     var model = new that.glossaryCollection.model(), selectedGuid = $(e.currentTarget).data("termguid"), attributename = $(e.currentTarget).data("attributename"), ajaxOptions = {
                         success: function(rModel, response) {