Parcourir la source

schema和tagDetail的汉化

zlSun il y a 11 mois
Parent
commit
259aca87c7

+ 13 - 2
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: that.toChinese(key),
                     cell: "html",
                     editable: !1,
                     className: "searchTableName",
@@ -132,8 +133,9 @@ define([ "require", "backbone", "hbs!tmpl/schema/SchemaTableLayoutView_tmpl", "c
                         }
                     })
                 });
+                console.log(key)
             }), col.tag = {
-                label: "Classifications",
+                label: "分类",
                 cell: "Html",
                 editable: !1,
                 sortable: !1,
@@ -190,6 +192,15 @@ 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);
+        },
+        toChinese: function (e){
+            switch (e){
+                case "name": return "名称";
+                case "owner": return "所有者";
+                case "type": return "类型";
+                case "comment": return "备注";
+                default: return e;
+            }
         }
     });
     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);