Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
feat(zh-cn): zh-cn
Browse files Browse the repository at this point in the history
zh-cn
  • Loading branch information
wpxp123456 committed Jul 24, 2020
1 parent e31f4af commit 01f9521
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 296 deletions.
529 changes: 259 additions & 270 deletions src/controllers/constant.js

Large diffs are not rendered by default.

39 changes: 20 additions & 19 deletions src/controllers/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ import { update, genarate } from '../global/format';
import method from '../global/method';
import { getBorderInfoCompute } from '../global/border';
import { luckysheetDrawMain } from '../global/draw';
import locale from '../locale/locale';
import Store from '../store';

//, columeflowset, rowflowset
Expand Down Expand Up @@ -884,10 +885,10 @@ export default function luckysheetHandler() {
if (obj_s["row"] != null && obj_s["row"][0] == 0 && obj_s["row"][1] == Store.flowdata.length - 1) {
Store.luckysheetRightHeadClickIs = "column";

$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("列");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("宽");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("左");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("右");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.width);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right);

$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
Expand Down Expand Up @@ -929,10 +930,10 @@ export default function luckysheetHandler() {
else if (obj_s["column"] != null && obj_s["column"][0] == 0 && obj_s["column"][1] == Store.flowdata[0].length - 1) {
Store.luckysheetRightHeadClickIs = "row";

$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("行");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("高");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("上");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("下");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.row);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.height);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.top);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.bottom);

$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
Expand Down Expand Up @@ -4536,10 +4537,10 @@ export default function luckysheetHandler() {

$("#luckysheet-cols-rows-shift").hide();
Store.luckysheetRightHeadClickIs = "row";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("行");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("高");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("上");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("下");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.row);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.height);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.top);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.bottom);

$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
Expand Down Expand Up @@ -4924,10 +4925,10 @@ export default function luckysheetHandler() {
}

Store.luckysheetRightHeadClickIs = "column";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("列");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("宽");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("左");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("右");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.width);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right);

$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
Expand Down Expand Up @@ -5192,9 +5193,9 @@ export default function luckysheetHandler() {
let offset = $(this).offset();
$("#luckysheet-cols-rows-shift").show();
Store.luckysheetRightHeadClickIs = "column";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("列");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("左");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("右");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right);

$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").hide();
Expand Down
5 changes: 3 additions & 2 deletions src/function/func.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,12 @@ function luckysheet_compareWith() {
fp[m][n] = booleanToNum(fp[m][n]);
tp[m][n] = booleanToNum(tp[m][n]);

let value;
if(isRealNum(fp[m][n]) && isRealNum(tp[m][n])){
let value = parseFloat(fp[m][n]) * parseFloat(tp[m][n]);
value = parseFloat(fp[m][n]) * parseFloat(tp[m][n]);
}
else{
let value = error.v;
value = error.v;
}

rowArr.push(value);
Expand Down
2 changes: 1 addition & 1 deletion src/global/createdom.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export default function luckysheetcreatedom(colwidth, rowheight, data, menu, tit
//新建行菜单
$("body").append(maskHTML);
$("body").append(colsmenuHTML);
$("body").append(rightclickHTML);
$("body").append(rightclickHTML());
$("body").append(inputHTML);
$("body").append(replaceHtml(filtermenuHTML, { "menuid": "filter" }));
$("body").append(replaceHtml(filtersubmenuHTML, { "menuid": "filter" }));
Expand Down
3 changes: 2 additions & 1 deletion src/global/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,8 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
luckysheetTableContent.font = fontset;

let textMetrics = luckysheetTableContent.measureText(value).width;
let oneLineTextHeight = menuButton.getTextSize("田", fontset)[1];
// let oneLineTextHeight = menuButton.getTextSize("田", fontset)[1];
let oneLineTextHeight = menuButton.getTextSize(value, fontset)[1];

let textW, textH;

Expand Down
61 changes: 60 additions & 1 deletion src/locale/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,65 @@ export default {
MicrosoftYaHei:"YaHei",
},
fontarray: ["Times New Roman","Arial","Tahoma","Verdana"],
fontjson: {"arial":1,"times new roman":0,"tahoma":2,"verdana":3}
fontjson: {"arial":1,"times new roman":0,"tahoma":2,"verdana":3},
rightclick: {
copy: 'Copy',
copyAs: 'Copy as',
paste: 'Paste',
insert: 'Insert',
delete: 'Delete',
deleteSelected: 'Delete selected ',
hide: 'Hide',
hideSelected: 'Hide selected ',
showHide: 'Show hide',
to: 'Towards',
left: 'Left',
right: 'Right',
top: 'Top',
bottom: 'Bottom',
add: 'Add',
row: 'Row',
column: 'Column',
width: 'Width',
height: 'Height',
number: 'Number',
confirm: 'Confirm',
orderAZ: 'A-Z order',
orderZA: 'Z-A order',
clearContent: 'Clear content',
matrix: 'Matrix operation selection',
sortSelection: 'Sort selection',
filterSelection: 'Filter selection',
chartGeneration: 'Chart generation',
firstLineTitle: 'First line title',
untitled: 'Untitled',
array1: 'One-dimensional array',
array2: 'Two-dimensional array',
array3: 'Multidimensional Arrays',
diagonal: 'Diagonal',
antiDiagonal: 'Anti-diagonal',
diagonalOffset: 'Diagonal offset',
offset: 'Offset',
Boolean: '布尔值',
flip: 'Flip',
upAndDown: 'Up and down',
leftAndRight: 'Left and right',
clockwise: 'Clockwise',
counterclockwise: 'Counterclockwise',
transpose: 'Transpose',
matrixCalculation: 'Matrix calculation',
plus: 'Plus',
minus: 'Minus',
multiply: 'Multiply',
divided: 'Divided',
power: 'Power',
root: 'Root',
log: 'Log',
delete0: 'Delete 0 values at both ends',
removeDuplicate: 'Remove duplicate values',
byRow: 'By row',
byCol: 'By column',
generateNewMatrix: 'Generate new matrix',
}
};

62 changes: 60 additions & 2 deletions src/locale/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,64 @@ export default {
MicrosoftYaHei:"Microsoft YaHei",
},
fontarray: ["微软雅黑","宋体","黑体","楷体","仿宋","新宋体","华文新魏","华文行楷","华文隶书","Arial","Times New Roman","Tahoma","Verdana"],
fontjson: {"微软雅黑":0,"microsoft yahei":0,"宋体":1,"simsun":1,"黑体":2,"simhei":2,"楷体":3,"kaiti":3,"仿宋":4,"fangsong":4,"新宋体":5,"nsimsun":5,"华文新魏":6,"stxinwei":6,"华文行楷":7,"stxingkai":7,"华文隶书":8,"stliti":8,"arial":9,"times new roman":10,"tahoma":11,"verdana":12}

fontjson: {"微软雅黑":0,"microsoft yahei":0,"宋体":1,"simsun":1,"黑体":2,"simhei":2,"楷体":3,"kaiti":3,"仿宋":4,"fangsong":4,"新宋体":5,"nsimsun":5,"华文新魏":6,"stxinwei":6,"华文行楷":7,"stxingkai":7,"华文隶书":8,"stliti":8,"arial":9,"times new roman":10,"tahoma":11,"verdana":12},
rightclick: {
copy: '复制',
copyAs: '复制为',
paste: '粘贴',
insert: '插入',
delete: '删除',
deleteSelected: '删除选中',
hide: '隐藏',
hideSelected: '隐藏选中',
showHide: '显示隐藏',
to: '向',
left: '左',
right: '右',
top: '上',
bottom: '下',
add: '增加',
row: '行',
column: '列',
width: '宽',
height: '高',
number: '数字',
confirm: '确认',
orderAZ: 'A-Z顺序排列',
orderZA: 'Z-A降序排列',
clearContent: '清除内容',
matrix: '矩阵操作选区',
sortSelection: '排序选区',
filterSelection: '筛选选区',
chartGeneration: '图表生成',
firstLineTitle: '首行为标题',
untitled: '无标题',
array1: '一维数组',
array2: '二维数组',
array3: '多维数组',
diagonal: '对角线',
antiDiagonal: '反对角线',
diagonalOffset: '对角偏移',
offset: '偏移量',
boolean: '布尔值',
flip: '翻转',
upAndDown: '上下',
leftAndRight: '左右',
clockwise: '顺时针',
counterclockwise: '逆时针',
transpose: '转置',
matrixCalculation: '矩阵计算',
plus: '加',
minus: '减',
multiply: '乘',
divided: '除',
power: '次方',
root: '次方根',
log: 'log',
delete0: '删除两端0值',
removeDuplicate: '删除重复值',
byRow: '按行',
byCol: '按列',
generateNewMatrix: '生成新矩阵',
}
};

0 comments on commit 01f9521

Please sign in to comment.