Browse Source

Merge pull request #1058 from luncheon/localize-hardcoded-texts

Localize hardcoded texts
master
mengshukeji 3 years ago
committed by GitHub
parent
commit
abbbebe16d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 39
      src/controllers/selection.js
  2. 11
      src/locale/en.js
  3. 5
      src/locale/es.js
  4. 5
      src/locale/zh.js
  5. 5
      src/locale/zh_tw.js

39
src/controllers/selection.js

@ -628,12 +628,16 @@ const selection = {
if(Store.allowEdit===false){ if(Store.allowEdit===false){
return; return;
} }
const _locale = locale()
const locale_paste = _locale.paste;
if(Store.luckysheet_select_save.length > 1){ if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){ if(isEditMode()){
alert("不能对多重选择区域执行此操作,请选择单个区域,然后再试"); alert(locale_paste.errorNotAllowMulti);
} }
else{ else{
tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对多重选择区域执行此操作,请选择单个区域,然后再试"); tooltip.info(`<i class="fa fa-exclamation-triangle"></i>${locale_paste.warning}`, locale_paste.errorNotAllowMulti);
} }
} }
@ -664,10 +668,10 @@ const selection = {
if(has_PartMC){ if(has_PartMC){
if(isEditMode()){ if(isEditMode()){
alert("不能对合并单元格做部分更改"); alert(locale_paste.errorNotAllowMerged);
} }
else{ else{
tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示', "不能对合并单元格做部分更改"); tooltip.info(`<i class="fa fa-exclamation-triangle"></i>${locale_paste.warning}`, locale_paste.errorNotAllowMerged);
} }
return; return;
@ -805,10 +809,10 @@ const selection = {
if(has_PartMC){ if(has_PartMC){
if(isEditMode()){ if(isEditMode()){
alert("不能对合并单元格做部分更改"); alert(locale_paste.errorNotAllowMerged);
} }
else{ else{
tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示',"不能对合并单元格做部分更改"); tooltip.info(`<i class="fa fa-exclamation-triangle"></i>${locale_paste.warning}`,locale_paste.errorNotAllowMerged);
} }
return; return;
} }
@ -882,6 +886,9 @@ const selection = {
return; return;
} }
const _locale = locale()
const locale_paste = _locale.paste;
let cfg = $.extend(true, {}, Store.config); let cfg = $.extend(true, {}, Store.config);
if(cfg["merge"] == null){ if(cfg["merge"] == null){
cfg["merge"] = {}; cfg["merge"] = {};
@ -914,10 +921,10 @@ const selection = {
if(has_PartMC){ if(has_PartMC){
if(isEditMode()){ if(isEditMode()){
alert("不能对合并单元格做部分更改"); alert(locale_paste.errorNotAllowMerged);
} }
else{ else{
tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示',"不能对合并单元格做部分更改"); tooltip.info(`<i class="fa fa-exclamation-triangle"></i>${locale_paste.warning}`,locale_paste.errorNotAllowMerged);
} }
return; return;
} }
@ -1308,6 +1315,10 @@ const selection = {
if(!checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex)){ if(!checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex)){
return; return;
} }
const _locale = locale()
const locale_paste = _locale.paste;
let cfg = $.extend(true, {}, Store.config); let cfg = $.extend(true, {}, Store.config);
if(cfg["merge"] == null){ if(cfg["merge"] == null){
cfg["merge"] = {}; cfg["merge"] = {};
@ -1392,10 +1403,10 @@ const selection = {
if(has_PartMC){ if(has_PartMC){
if(isEditMode()){ if(isEditMode()){
alert("不能对合并单元格做部分更改"); alert(locale_paste.errorNotAllowMerged);
} }
else{ else{
tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示',"不能对合并单元格做部分更改"); tooltip.info(`<i class="fa fa-exclamation-triangle"></i>${locale_paste.warning}`,locale_paste.errorNotAllowMerged);
} }
return; return;
} }
@ -1627,6 +1638,10 @@ const selection = {
if(!checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex)){ if(!checkProtectionLockedRangeList(Store.luckysheet_select_save, Store.currentSheetIndex)){
return; return;
} }
const _locale = locale()
const locale_paste = _locale.paste;
let cfg = $.extend(true, {}, Store.config); let cfg = $.extend(true, {}, Store.config);
if(cfg["merge"] == null){ if(cfg["merge"] == null){
cfg["merge"] = {}; cfg["merge"] = {};
@ -1660,10 +1675,10 @@ const selection = {
if(has_PartMC){ if(has_PartMC){
if(isEditMode()){ if(isEditMode()){
alert("不能对合并单元格做部分更改"); alert(locale_paste.errorNotAllowMerged);
} }
else{ else{
tooltip.info('<i class="fa fa-exclamation-triangle"></i>提示',"不能对合并单元格做部分更改"); tooltip.info(`<i class="fa fa-exclamation-triangle"></i>${locale_paste.warning}`,locale_paste.errorNotAllowMerged);
} }
return; return;
} }

11
src/locale/en.js

@ -9886,9 +9886,14 @@ export default {
notLessOne:"The number of rows and columns cannot be less than 1", notLessOne:"The number of rows and columns cannot be less than 1",
offsetColumnLessZero:"The offset column cannot be negative!", offsetColumnLessZero:"The offset column cannot be negative!",
pasteMustKeybordAlert:"在表格中进行复制粘贴: Ctrl + C 进行复制, Ctrl + V 进行粘贴, Ctrl + X 进行剪切", pasteMustKeybordAlert:"Copy and paste in the Sheet: Ctrl + C to copy, Ctrl + V to paste, Ctrl + X to cut",
pasteMustKeybordAlertHTMLTitle:"在表格中进行复制粘贴", pasteMustKeybordAlertHTMLTitle:"Copy and paste in the Sheet",
pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;进行复制<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;进行粘贴<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;进行剪切", pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;to copy<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;to paste<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;to cut",
},
paste: {
warning:"Warning",
errorNotAllowMulti:"Cannot perform this operation on multiple selection areas, please select a single range and try again",
errorNotAllowMerged:"Cannot make partial changes to merged cells",
}, },
pivotTable:{ pivotTable:{
title:"Pivot Table", title:"Pivot Table",

5
src/locale/es.js

@ -9859,6 +9859,11 @@ export default {
pasteMustKeybordAlertHTMLTitle:"在表格中进行复制粘贴", pasteMustKeybordAlertHTMLTitle:"在表格中进行复制粘贴",
pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;进行复制<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;进行粘贴<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;进行剪切", pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;进行复制<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;进行粘贴<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;进行剪切",
}, },
paste: {
warning:"Advertencia",
errorNotAllowMulti:"No se puede realizar esta operación en varias áreas de selección, selecciona un solo rango y vuelve a intentarlo",
errorNotAllowMerged: "No se pueden realizar cambios parciales en las celdas fusionadas",
},
pivotTable:{ pivotTable:{
title:"Tabla Dinámica", title:"Tabla Dinámica",
closePannel:"Cerrar", closePannel:"Cerrar",

5
src/locale/zh.js

@ -10119,6 +10119,11 @@ export default {
pasteMustKeybordAlertHTMLTitle:"Copy and paste in the Sheet", pasteMustKeybordAlertHTMLTitle:"Copy and paste in the Sheet",
pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;to copy<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;to paste<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;to cut", pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;to copy<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;to paste<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;to cut",
}, },
paste: {
warning:"提示",
errorNotAllowMulti:"不能对多重选择区域执行此操作,请选择单个区域,然后再试",
errorNotAllowMerged:"不能对合并单元格做部分更改",
},
pivotTable:{ pivotTable:{
title:"数据透视表", title:"数据透视表",
closePannel:"关闭", closePannel:"关闭",

5
src/locale/zh_tw.js

@ -10112,6 +10112,11 @@ export default {
pasteMustKeybordAlertHTMLTitle: "Copy and paste in the Sheet", pasteMustKeybordAlertHTMLTitle: "Copy and paste in the Sheet",
pasteMustKeybordAlertHTML : "<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;to copy<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;to paste<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;to cut", pasteMustKeybordAlertHTML : "<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;to copy<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;to paste<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;to cut",
}, },
paste: {
warning : "提示",
errorNotAllowMulti : "不能對多重選擇區域執行此操作,請選擇單個區域,然後再試",
errorNotAllowMerged: "不能对合并单元格做部分更改",
},
pivotTable: { pivotTable: {
title : "數據透視錶", title : "數據透視錶",
closePannel : "關閉", closePannel : "關閉",

Loading…
Cancel
Save