diff --git a/src/controllers/alternateformat.js b/src/controllers/alternateformat.js index 4ec557b25..da15a7471 100644 --- a/src/controllers/alternateformat.js +++ b/src/controllers/alternateformat.js @@ -10,6 +10,7 @@ import luckysheetsizeauto from './resize'; import server from './server'; import { selectHightlightShow } from './select'; import Store from '../store'; +import locale from '../locale/locale'; //交替颜色 const alternateformat = { @@ -411,7 +412,8 @@ const alternateformat = { //选择颜色 确定 添加自定义模板 $(document).off("click.AFselectColorConfirm").on("click.AFselectColorConfirm", "#luckysheet-alternateformat-colorSelect-dialog-confirm", function(){ let $parent = $(this).parents("#luckysheet-alternateformat-colorSelect-dialog"); - + const _locale = locale() + const alternatingColors =_locale.alternatingColors; $("#luckysheet-modal-dialog-mask").hide(); $parent.hide(); @@ -419,10 +421,10 @@ const alternateformat = { let currenColor = $parent.find(".currenColor span").attr("title"); let colorType; - if($parent.find(".luckysheet-modal-dialog-title-text").text() == "选择文本颜色"){ + if($parent.find(".luckysheet-modal-dialog-title-text").text() == alternatingColors.selectionTextColor){ colorType = "fc"; } - else if($parent.find(".luckysheet-modal-dialog-title-text").text() == "选择单元格颜色"){ + else if($parent.find(".luckysheet-modal-dialog-title-text").text() == alternatingColors.selectionCellColor){ colorType = "bc"; } @@ -712,20 +714,25 @@ const alternateformat = { $("#luckysheet-modal-dialog-mask").show(); $("#luckysheet-alternateformat-colorSelect-dialog").remove(); + const _locale = locale() + const alternatingColors =_locale.alternatingColors; + const locale_button = _locale.button; + const locale_toolbar = _locale.toolbar; + let title; if(colorType == "fc"){ - title = "选择文本颜色"; + title = alternatingColors.selectionTextColor; } else if(colorType == "bc"){ - title = "选择单元格颜色"; + title = alternatingColors.selectionCellColor; } $("body").append(replaceHtml(modelHTML, { "id": "luckysheet-alternateformat-colorSelect-dialog", "addclass": "luckysheet-alternateformat-colorSelect-dialog", "title": title, - "content": "
当前颜色:
", - "botton": '', + "content": "
"+ alternatingColors.currentColor +":
", + "botton": '', "style": "z-index:100003" })); let $t = $("#luckysheet-alternateformat-colorSelect-dialog") @@ -756,13 +763,13 @@ const alternateformat = { maxPaletteSize: 8, maxSelectionSize: 8, color: currenColor, - cancelText: "取消", - chooseText: "确定颜色", - togglePaletteMoreText: "自定义", - togglePaletteLessText: "收起", + cancelText: locale_button.cancel, + chooseText: locale_toolbar.confirmColor, + togglePaletteMoreText: locale_toolbar.customColor, + togglePaletteLessText: locale_toolbar.collapse, togglePaletteOnly: true, - clearText: "清除颜色选择", - noColorSelectedText: "没有颜色被选择", + clearText: locale_toolbar.clearText, + noColorSelectedText: locale_toolbar.noColorSelectedText, localStorageKey: "spectrum.textcolor" + server.gridKey, palette: [ ["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"], @@ -790,12 +797,16 @@ const alternateformat = { $("#luckysheet-modal-dialog-mask").hide(); $("#luckysheet-alternateformat-rangeDialog").remove(); + const _locale = locale() + const alternatingColors =_locale.alternatingColors; + const locale_button = _locale.button; + $("body").append(replaceHtml(modelHTML, { "id": "luckysheet-alternateformat-rangeDialog", "addclass": "luckysheet-alternateformat-rangeDialog", - "title": "选择应用范围", - "content": '', - "botton": '', + "title": alternatingColors.selectRange, + "content": '', + "botton": '', "style": "z-index:100003" })); let $t = $("#luckysheet-alternateformat-rangeDialog") @@ -971,7 +982,8 @@ const alternateformat = { }, update: function(){ let _this = this; - + const _locale = locale() + const alternatingColors =_locale.alternatingColors; //获取标识 let dataIndex = $("#luckysheet-alternateformat-remove").data("index"); @@ -980,10 +992,10 @@ const alternateformat = { if(!formula.iscelldata(rangeValue)){ if(isEditMode()){ - alert("您选择的应用范围不是选区!"); + alert(alternatingColors.errorNoRange); } else{ - tooltip.info("您选择的应用范围不是选区!", ""); + tooltip.info(alternatingColors.errorNoRange, ""); } return; @@ -994,10 +1006,10 @@ const alternateformat = { if(isExists){ if(isEditMode()){ - alert("您选择的应用范围已存在交替颜色且不属于你要编辑的应用范围!"); + alert(alternatingColors.errorExistColors); } else{ - tooltip.info("您选择的应用范围已存在交替颜色且不属于你要编辑的应用范围!", ""); + tooltip.info(alternatingColors.errorExistColors, ""); } return; diff --git a/src/controllers/freezen.js b/src/controllers/freezen.js index 60f7fde74..b9bd4df25 100644 --- a/src/controllers/freezen.js +++ b/src/controllers/freezen.js @@ -41,7 +41,10 @@ const luckysheetFreezen = { cancelFreezenVertical: function (sheetIndex) { let _this = this; - $("#luckysheet-freezen-btn-vertical").html(' 冻结首列'); + const _locale = locale(); + const locale_freezen = _locale.freezen; + + $("#luckysheet-freezen-btn-vertical").html(' '+locale_freezen.freezenColumn); _this.freezenverticaldata = null; let isvertical = $("#luckysheet-freezebar-vertical").is(":visible"); $("#luckysheet-freezebar-vertical").hide(); diff --git a/src/controllers/keyboard.js b/src/controllers/keyboard.js index 05137df30..fbbeba272 100644 --- a/src/controllers/keyboard.js +++ b/src/controllers/keyboard.js @@ -509,17 +509,17 @@ export function keyboardInitial(){ //多重选区 行不一样且列不一样时 提示 if(Store.luckysheet_select_save.length > 1){ let isSameRow = true, - str_r = luckysheet_select_save[0].row[0], - end_r = luckysheet_select_save[0].row[1]; + str_r = Store.luckysheet_select_save[0].row[0], + end_r = Store.luckysheet_select_save[0].row[1]; let isSameCol = true, - str_c = luckysheet_select_save[0].column[0], - end_c = luckysheet_select_save[0].column[1]; + str_c = Store.luckysheet_select_save[0].column[0], + end_c = Store.luckysheet_select_save[0].column[1]; - for(let s = 1; s < luckysheet_select_save.length; s++){ - if(luckysheet_select_save[s].row[0] != str_r || luckysheet_select_save[s].row[1] != end_r){ + for(let s = 1; s < Store.luckysheet_select_save.length; s++){ + if(Store.luckysheet_select_save[s].row[0] != str_r || Store.luckysheet_select_save[s].row[1] != end_r){ isSameRow = false; } - if(luckysheet_select_save[s].column[0] != str_c || luckysheet_select_save[s].column[1] != end_c){ + if(Store.luckysheet_select_save[s].column[0] != str_c || Store.luckysheet_select_save[s].column[1] != end_c){ isSameCol = false; } } diff --git a/src/controllers/menuButton.js b/src/controllers/menuButton.js index e37b712a4..70755cd30 100644 --- a/src/controllers/menuButton.js +++ b/src/controllers/menuButton.js @@ -2145,8 +2145,8 @@ const menuButton = { { "text": conditionformat_text.top10_percent, "value": "top10%", "example": conditionformat_text.top10_percent }, { "text": conditionformat_text.last10, "value": "last10", "example": conditionformat_text.last10 }, { "text": conditionformat_text.last10_percent, "value": "last10%", "example": conditionformat_text.last10_percent }, - { "text": conditionformat_text.aboveAverage, "value": "AboveAverage", "example": conditionformat_text.aboveAverage }, - { "text": conditionformat_text.belowAverage, "value": "SubAverage", "example": conditionformat_text.belowAverage } + { "text": conditionformat_text.aboveAverage, "value": "AboveAverage", "example": conditionformat_text.above }, + { "text": conditionformat_text.belowAverage, "value": "SubAverage", "example": conditionformat_text.below } ]; let subitemset2 = _this.createButtonMenu(subitemdata2); let submenu2 = replaceHtml(_this.menu, {"id": "projectSelectRule", "item": subitemset2, "subclass": "luckysheet-menuButton-sub"}); @@ -2240,8 +2240,8 @@ const menuButton = { $("body").append(menu + submenu + submenu2 + submenu3 + submenu4 + submenu6); $menuButton = $("#" + menuButtonId).width(190); - $("#luckysheet-icon-highlightCellRule-menuButton").width(130); - $("#luckysheet-icon-projectSelectRule-menuButton").width(170); + $("#luckysheet-icon-highlightCellRule-menuButton").width(160); + $("#luckysheet-icon-projectSelectRule-menuButton").width(180); $menuButton.find(".luckysheet-cols-menuitem").click(function(){ $menuButton.hide(); diff --git a/src/css/luckysheet-core.css b/src/css/luckysheet-core.css index b2f2db6cd..744f1cf90 100644 --- a/src/css/luckysheet-core.css +++ b/src/css/luckysheet-core.css @@ -1682,7 +1682,7 @@ body:not(.ewa-ipad) .luckysheet-cols-h-cell-nosel:hover, body:not(.ewa-ipad) .lu /* background: #000; */ bottom: 68px; left: 10px; - z-index: 100; + z-index: 1000; } #luckysheet-bottom-add-row{ @@ -4467,7 +4467,7 @@ fieldset[disabled] a.btn { .luckysheet-freezebar-vertical-drop-bar { width: 4px; - background-color: #ababab; + background-color: #f3f3f2; border-width: 2px 1px 2px 2px; margin-top: 19px; top: 0px; @@ -4476,7 +4476,7 @@ fieldset[disabled] a.btn { .luckysheet-freezebar-vertical-drop-title { width: 4px; - background: #616161; + background: #bcbdbc; /* opacity: 0.80; filter: alpha(opacity=80);*/ height: 19px; @@ -4534,7 +4534,7 @@ fieldset[disabled] a.btn { .luckysheet-freezebar-horizontal-drop-bar { height: 4px; overflow: hidden; - background-color: #ababab; + background-color: #f3f3f2; border-width: 2px 2px 1px 2px; margin-left: 45px; left: 0px; @@ -4544,7 +4544,7 @@ fieldset[disabled] a.btn { .luckysheet-freezebar-horizontal-drop-title { height: 4px; - background: #616161; + background: #bcbdbc; /* opacity: 0.80; filter: alpha(opacity=80);*/ width: 45px; diff --git a/src/index.html b/src/index.html index 4a147c12b..68365816c 100644 --- a/src/index.html +++ b/src/index.html @@ -32,7 +32,7 @@ luckysheet.create({ container: 'luckysheet', - lang: 'zh', + lang: 'en', plugins: ['chart'], data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable] }) diff --git a/src/locale/en.js b/src/locale/en.js index 5f9ca3209..7810895c6 100644 --- a/src/locale/en.js +++ b/src/locale/en.js @@ -68,6 +68,11 @@ export default { selectionCellColor:"Click to select cell color", removeColor:"Remove alternating colors", colorShow:"color", + currentColor:"Current", + + tipSelectRange:"Please select the range of alternating colors", + errorNoRange:"No range is selected", + errorExistColors:"Alternating colors already exist and cannot be edited", }, button: { confirm: 'OK', @@ -285,7 +290,11 @@ export default { { "text": 'Scientific', "value": "0.00E+00", "example": "1.01E+5" }, { "text": "", "value": "split", "example": "" }, { "text": 'Accounting', "value": "¥(0.00)", "example": "¥(1200.09)" }, + + { "text": 'Currency', "value": "¥0.00", "example": "¥1200.09" }, + + { "text": "", "value": "split", "example": "" }, { "text": 'Date', "value": "yyyy-MM-dd", "example": "2017-11-29" }, { "text": 'Time', "value": "hh:mm AM/PM", "example": "3:00 PM" }, @@ -412,6 +421,8 @@ export default { "columnOperation":"Column", "secondaryTitle":"then by", + "sortTitle":"Sort range", + "sortRangeTitle":"Sort range from", "sortRangeTitleTo":"to", @@ -755,7 +766,7 @@ export default { pleaseSelectIcon: 'Please click to select a group of icons:', cellValue: 'Cell value', specificText: 'Specific text', - occurrence: 'Date of occurrence', + occurrence: 'Date', greaterThan: 'Greater than', lessThan: 'Less than', between: 'Between', @@ -778,7 +789,7 @@ export default { below: 'Below', belowAverage: 'Below average', all: 'All', - yesterday: 'Yesterday', + yesterday: 'YTD', today: 'Today', tomorrow: 'Tomorrow', lastWeek: 'Last week', @@ -796,8 +807,8 @@ export default { editRuleDescription: 'Edit rule description', newFormatRule: 'New format rule', editFormatRule: 'Edit format rule', - formatStyle: 'Format style', - fillType: 'Fill type', + formatStyle: 'Style', + fillType: 'Fill', color: 'Color', twocolor: 'Two-color', tricolor: 'Tricolor', diff --git a/src/locale/zh.js b/src/locale/zh.js index d49dc8296..a8c7b2a79 100644 --- a/src/locale/zh.js +++ b/src/locale/zh.js @@ -19,6 +19,7 @@ export default { customColor: '自定义', alternatingColors: '交替颜色', confirmColor: '确定颜色', + cancelColor: '取消', collapse: '收起', fillColor: '单元格颜色', border: '边框', @@ -52,7 +53,6 @@ export default { toolLess:"少于", toolClose:"收起", toolMoreTip:"更多功能", - }, alternatingColors:{ applyRange: '应用范围', @@ -64,10 +64,15 @@ export default { textTitle:"格式样式", custom:"自定义", close:"关闭", - selectionTextColor:"点击选择文本颜色", - selectionCellColor:"点击选择单元格颜色", + selectionTextColor:"选择文本颜色", + selectionCellColor:"选择单元格颜色", removeColor:"移除交替颜色", colorShow:"颜色", + currentColor:"当前颜色", + + tipSelectRange:"请选择交替颜色应用范围", + errorNoRange:"您选择的应用范围不是选区!", + errorExistColors:"您选择的应用范围已存在交替颜色且不属于你要编辑的应用范围!", }, button: { confirm: '确定', @@ -96,8 +101,8 @@ export default { detailSave: '已恢复本地缓存', row: '行', column: '列', - loading:"渲染中", + copy:"副本", return:"返回", rename:"重命名", @@ -467,8 +472,6 @@ export default { filterCancel:"取 消", clearFilter:"清除筛选", - - conditionNone:"无", conditionCellIsNull:"单元格为空", conditionCellNotNull:"单元格有数据",