4 次代碼提交 a164ca317a ... 287c708ea1

作者 SHA1 備註 提交日期
  zlSun 287c708ea1 使用Utils的toChinese进行后端数据汉化 1 年之前
  zlSun a9cf4fae7e 表格内容汉化 1 年之前
  zlSun 448a6e233e 审计和模式页面的语句汉化 1 年之前
  zlSun 259aca87c7 schema和tagDetail的汉化 1 年之前

+ 11 - 4
atlas/js/utils/CommonViewFunction.js

@@ -44,8 +44,14 @@ define([ "require", "utils/Utils", "modules/Modal", "utils/Messages", "utils/Enu
                 return resultStr;
             }
         }, getEmptyString = function(key) {
-            return options.getEmptyString ? options.getEmptyString(key) : "N/A";
+            return options.getEmptyString ? options.getEmptyString(key) : "";
         }, getValue = function(val, key) {
+            if("false"===val||false===val){
+                return "否";
+            }
+            else if ("true"===val||true===val){
+                return "是";
+            }
             if (options && options.getValue && (val = options.getValue(val, key)), _.isUndefined(val) || _.isNull(val)) return getEmptyString(key);
             if (!_.isNumber(val) && _.isNaN(parseInt(val)) || !formatIntVal) {
                 var newVal = val;
@@ -115,6 +121,7 @@ define([ "require", "utils/Utils", "modules/Modal", "utils/Messages", "utils/Enu
         return (_.isUndefined(sortBy) || 1 == sortBy) && (valueObjectKeysList = _.sortBy(valueObjectKeysList)),
         valueObjectKeysList.map(function(key) {
             if ("profileData" != key) {
+                console.log("key",key)
                 var keyValue = valueObject[key], listCount = showListCount && _.isArray(keyValue) && keyValue.length > 0 ? " (" + numberFormat(keyValue.length) + ")" : "", defEntity = _.find(attributeDefs, {
                     name: key
                 });
@@ -134,7 +141,7 @@ define([ "require", "utils/Utils", "modules/Modal", "utils/Messages", "utils/Enu
                 var val = "";
                 if (val = _.isObject(valueObject[key]) ? keyValue : "guid" === key || "__guid" === key ? options.guidHyperLink === !1 ? getValue(keyValue, key) : '<a title="' + key + '" href="#!/detailPage/' + _.escape(keyValue) + '">' + getValue(keyValue, key) + "</a>" : getValue(keyValue, key),
                 isTable) {
-                    var value = val, appendClass = "N/A" == value ? "hide-row" : "", htmlTag = '<div class="scroll-y">' + value + "</div>";
+                    var value = val, appendClass = "" == value ? "hide-row" : "", htmlTag = '<div class="scroll-y">' + value + "</div>";
                     if (_.isObject(valueObject[key]) && !_.isEmpty(valueObject[key])) {
                         var matchedLinkString = val.match(/href|value-loader\w*/g), matchedJson = val.match(/json-value|json-string\w*/g), isMatchJSONStringIsSingle = (val.match(/json-key\w*/g),
                         matchedLinkString && matchedLinkString.length <= 5, matchedJson && 1 == matchedJson.length), expandCollapseButton = "";
@@ -144,10 +151,10 @@ define([ "require", "utils/Utils", "modules/Modal", "utils/Messages", "utils/Enu
                             htmlTag = '<pre class="' + className + '">' + expandCollapseButton + "<code>" + val + "</code></pre>";
                         }
                     }
-                    table += '<tr class="' + appendClass + '"><td>' + (_.escape(key) + listCount) + "</td><td>" + htmlTag + "</td></tr>";
+                    table += '<tr class="' + appendClass + '"><td>' + (Utils.toChinese(_.escape(key))+ listCount) + "</td><td>" + htmlTag + "</td></tr>";
                 } else table += "<span>" + val + "</span>";
             }
-        }), table && table.length > 0 ? table : '<tr class="empty"><td colspan="22"><span>No Record found!</span></td></tr>';
+        }), table && table.length > 0 ? table : '<tr class="empty"><td colspan="22"><span>没有记录!</span></td></tr>';
     }, CommonViewFunction.tagForTable = function(obj) {
         var traits = obj.classifications, tagHtml = "", addTag = "", popTag = "", count = 0, entityName = Utils.getName(obj);
         return traits && traits.map(function(tag) {

+ 31 - 1
atlas/js/utils/Utils.js

@@ -513,5 +513,35 @@ define([ "require", "utils/Globals", "pnotify", "utils/Messages", "utils/Enums",
         "-" !== dateValue && (isValidDate === !1 && options && options.defaultDate !== !1 && (dateValue = moment().format(dateFormat)), 
         Globals.isTimezoneFormatEnabled && (!options || options && options.zone !== !1) && (dateValue += " (" + moment.tz(moment.tz.guess()).zoneAbbr() + ")")), 
         dateValue;
-    }, Utils;
+    },Utils.toChinese=function (name){
+        switch (name){
+            case "columns": return "列";
+            case "aliases": return "别名";
+            case "comment": return "备注";
+            case "createTime": return "创建时间";
+            case "db": return "数据库";
+            case "displayName": return "展示名称";
+            case "isIncomplete": return "是否为未完成";
+            case "lastAccessTime": return "上次访问时间";
+            case "name": return "名称";
+            case "owner":return "所有者";
+            case "parameters": return "参数";
+            case "partitionKeys": return "分区键";
+            case "qualifiedName": return "限定符";
+            case "replicatedFrom": return "复制自";
+            case "replicatedTo": return "复制到";
+            case "retention": return "留存";
+            case "sd": return "物理存储";
+            case "tableType": return "表类型";
+            case "temporary": return "临时";
+            case "typeName": return "类型名称";
+            case "userDescription": return "用户描述";
+            case "viewExpandedText": return "视图拓展文本";
+            case "viewOriginalText": return "视图原始文本";
+            case "type": return "类型";
+            default: return name;
+        }
+
+    },
+        Utils;
 });

+ 1 - 1
atlas/js/views/audit/CreateAuditTableLayoutView.js

@@ -88,7 +88,7 @@ define([ "require", "backbone", "hbs!tmpl/audit/CreateAuditTableLayoutView_tmpl"
                                 }) : attributesDetails[key] = Utils.formatDate({
                                     date: attributesDetails[key]
                                 }));
-                            }), that.ui.attributeDetails.removeClass("hide"), that.action.indexOf("Classification") === -1 ? that.ui.panelAttrHeading.html("Technical properties ") : that.ui.panelAttrHeading.html("Properties ");
+                            }), that.ui.attributeDetails.removeClass("hide"), that.action.indexOf("Classification") === -1 ? that.ui.panelAttrHeading.html("技术性能") : that.ui.panelAttrHeading.html("Properties ");
                             var attrTable = that.createTableWithValues(attributesDetails);
                             that.ui.attributeCard.html(attrTable);
                         }

+ 4 - 3
atlas/js/views/schema/SchemaLayoutView.js

@@ -106,6 +106,7 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
             });
         },
         getSchemaTableColumns: function() {
+            var that = this;
             var col = {
                 Check: {
                     name: "selected",
@@ -116,7 +117,7 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
             };
             if (this.schemaTableAttribute) return _.each(_.keys(this.schemaTableAttribute), function(key) {
                 "position" !== key && (col[key] = {
-                    label: key.capitalize(),
+                    label: Utils.toChinese(key),
                     cell: "html",
                     editable: !1,
                     className: "searchTableName",
@@ -133,7 +134,7 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
                     })
                 });
             }), col.tag = {
-                label: "Classifications",
+                label: "分类",
                 cell: "Html",
                 editable: !1,
                 sortable: !1,
@@ -190,7 +191,7 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
         },
         onCheckDeletedEntity: function(e) {
             e.target.checked ? this.deleteObj.length && this.schemaCollection.fullCollection.reset(this.activeObj.concat(this.deleteObj)) : this.schemaCollection.fullCollection.reset(this.activeObj);
-        }
+        },
     });
     return SchemaTableLayoutView;
 });

+ 2 - 2
atlas/js/views/tag/TagDetailTableLayoutView.js

@@ -81,7 +81,7 @@ define([ "require", "backbone", "hbs!tmpl/tag/TagDetailTableLayoutView_tmpl", "u
             });
         },
         renderFilter: function() {
-            var tagName = "<option value='all' selected>All</option>", that = this;
+            var tagName = "<option value='all' selected>全部</option>", that = this;
             "false" === this.value.showPC ? _.each(this.tags.self, function(val) {
                 var typeName = val.typeName;
                 tagName += '<option value="' + typeName + '">' + typeName + "</option>";
@@ -90,7 +90,7 @@ define([ "require", "backbone", "hbs!tmpl/tag/TagDetailTableLayoutView_tmpl", "u
             }), this.ui.tagList.html(tagName), this.value.filter && this.ui.tagList.val() !== this.value.filter && (this.ui.tagList.find("option[value='" + this.value.filter + "']").length > 0 ? (this.ui.tagList.val(this.value.filter), 
             this.updateCollection(this.value.filter)) : (this.tagNotFound = !0, this.updateCollection("all"))), 
             this.ui.tagList.select2({
-                placeholder: "Search for tag"
+                placeholder: "根据标签搜索"
             }).on("change", function() {
                 var value = that.ui.tagList.val();
                 that.updateCollection(value);