[SSE] Add translation for conditional formats

This commit is contained in:
Julia Radzhabova 2021-01-28 21:38:00 +03:00
parent 30ebb561e6
commit cb608f56f7
4 changed files with 231 additions and 167 deletions

View file

@ -496,4 +496,58 @@ define(function(){ 'use strict';
} }
} }
})(), Common.define.chartData || {}); })(), Common.define.chartData || {});
Common.define.conditionalData = _.extend( new(function() {
return {
textDate: 'Date',
textYesterday: 'Yesterday',
textToday: 'Today',
textTomorrow: 'Tomorrow',
textLast7days: 'In the last 7 days',
textLastWeek: 'Last week',
textThisWeek: 'This week',
textNextWeek: 'Next week',
textLastMonth: 'Last month',
textThisMonth: 'This month',
textNextMonth: 'Next month',
textText: 'Text',
textContains: 'Contains',
textNotContains: 'Does not contain',
textBegins: 'Begins with',
textEnds: 'Ends with',
textAverage: 'Average',
textAbove: 'Above',
textBelow: 'Below',
textEqAbove: 'Equal to or above',
textEqBelow: 'Equal to or below',
text1Above: '1 std dev above',
text1Below: '1 std dev below',
text2Above: '2 std dev above',
text2Below: '2 std dev below',
text3Above: '3 std dev above',
text3Below: '3 std dev below',
textGreater: 'Greater than',
textGreaterEq: 'Greater than or equal to',
textLess: 'Less than',
textLessEq: 'Less than or equal to',
textEqual: 'Equal to',
textNotEqual: 'Not equal to',
textBetween: 'Between',
textNotBetween: 'Not between',
textTop: 'Top',
textBottom: 'Bottom',
textBlank: 'Blank',
textError: 'Error',
textBlanks: 'Contains blanks',
textNotBlanks: 'Does not contain blanks',
textErrors: 'Contains errors',
textNotErrors: 'Does not contain errors',
textDuplicate: 'Duplicate',
textUnique: 'Unique',
textDataBar: 'Data bar',
textIconSets: 'Icon sets',
textFormula: 'Formula',
exampleText: 'AaBbCcYyZz'
}
})(), Common.define.conditionalData || {});
}); });

View file

@ -223,104 +223,104 @@ define([
name: this.textValue, name: this.textValue,
type: Asc.c_oAscCFType.cellIs, type: Asc.c_oAscCFType.cellIs,
rules: [ rules: [
{ name: this.textGreater, subtype: Asc.c_oAscCFOperator.greaterThan}, { name: Common.define.conditionalData.textGreater, subtype: Asc.c_oAscCFOperator.greaterThan},
{ name: this.textGreaterEq, subtype: Asc.c_oAscCFOperator.greaterThanOrEqual}, { name: Common.define.conditionalData.textGreaterEq, subtype: Asc.c_oAscCFOperator.greaterThanOrEqual},
{ name: this.textLess, subtype: Asc.c_oAscCFOperator.lessThan}, { name: Common.define.conditionalData.textLess, subtype: Asc.c_oAscCFOperator.lessThan},
{ name: this.textLessEq, subtype: Asc.c_oAscCFOperator.lessThanOrEqual}, { name: Common.define.conditionalData.textLessEq, subtype: Asc.c_oAscCFOperator.lessThanOrEqual},
{ name: this.textEqual, subtype: Asc.c_oAscCFOperator.equal}, { name: Common.define.conditionalData.textEqual, subtype: Asc.c_oAscCFOperator.equal},
{ name: this.textNotEqual, subtype: Asc.c_oAscCFOperator.notEqual}, { name: Common.define.conditionalData.textNotEqual, subtype: Asc.c_oAscCFOperator.notEqual},
{ name: this.textBetween, subtype: Asc.c_oAscCFOperator.between}, { name: Common.define.conditionalData.textBetween, subtype: Asc.c_oAscCFOperator.between},
{ name: this.textNotBetween, subtype: Asc.c_oAscCFOperator.notBetween} { name: Common.define.conditionalData.textNotBetween, subtype: Asc.c_oAscCFOperator.notBetween}
] ]
}, },
{ {
name: this.textRanked, name: this.textRanked,
type: Asc.c_oAscCFType.top10, type: Asc.c_oAscCFType.top10,
rules: [ rules: [
{ name: this.textTop, subtype: 0}, { name: Common.define.conditionalData.textTop, subtype: 0},
{ name: this.textBottom, subtype: 1} { name: Common.define.conditionalData.textBottom, subtype: 1}
] ]
}, },
{ {
name: 'Average', name: Common.define.conditionalData.textAverage,
type: Asc.c_oAscCFType.aboveAverage, type: Asc.c_oAscCFType.aboveAverage,
rules: [ rules: [
{ name: 'Above', subtype: 0}, { name: Common.define.conditionalData.textAbove, subtype: 0},
{ name: 'Below', subtype: 1}, { name: Common.define.conditionalData.textBelow, subtype: 1},
{ name: 'Equal to or above', subtype: 2}, { name: Common.define.conditionalData.textEqAbove, subtype: 2},
{ name: 'Equal to or below', subtype: 3}, { name: Common.define.conditionalData.textEqBelow, subtype: 3},
{ name: '1 std dev above', subtype: 4}, { name: Common.define.conditionalData.text1Above, subtype: 4},
{ name: '1 std dev below', subtype: 5}, { name: Common.define.conditionalData.text1Below, subtype: 5},
{ name: '2 std dev above', subtype: 6}, { name: Common.define.conditionalData.text2Above, subtype: 6},
{ name: '2 std dev below', subtype: 7}, { name: Common.define.conditionalData.text2Below, subtype: 7},
{ name: '3 std dev above', subtype: 8}, { name: Common.define.conditionalData.text3Above, subtype: 8},
{ name: '3 std dev below', subtype: 9} { name: Common.define.conditionalData.text3Below, subtype: 9}
] ]
}, },
{ {
name: 'Text', name: Common.define.conditionalData.textText,
type: Asc.c_oAscCFType.containsText, type: Asc.c_oAscCFType.containsText,
rules: [ rules: [
{ name: 'Contains', type: Asc.c_oAscCFType.containsText }, { name: Common.define.conditionalData.textContains, type: Asc.c_oAscCFType.containsText },
{ name: 'Does not contain', type: Asc.c_oAscCFType.notContainsText }, { name: Common.define.conditionalData.textNotContains, type: Asc.c_oAscCFType.notContainsText },
{ name: 'Begins with', type: Asc.c_oAscCFType.beginsWith }, { name: Common.define.conditionalData.textBegins, type: Asc.c_oAscCFType.beginsWith },
{ name: 'Ends with', type: Asc.c_oAscCFType.endsWith } { name: Common.define.conditionalData.textEnds, type: Asc.c_oAscCFType.endsWith }
] ]
}, },
{ {
name: 'Date', name: Common.define.conditionalData.textDate,
type: Asc.c_oAscCFType.timePeriod, type: Asc.c_oAscCFType.timePeriod,
rules: [ rules: [
{ name: 'Yesterday', subtype: Asc.c_oAscTimePeriod.yesterday}, { name: Common.define.conditionalData.textYesterday, subtype: Asc.c_oAscTimePeriod.yesterday},
{ name: 'Today', subtype: Asc.c_oAscTimePeriod.today}, { name: Common.define.conditionalData.textToday, subtype: Asc.c_oAscTimePeriod.today},
{ name: 'Tomorrow', subtype: Asc.c_oAscTimePeriod.tomorrow}, { name: Common.define.conditionalData.textTomorrow, subtype: Asc.c_oAscTimePeriod.tomorrow},
{ name: 'In the last 7 days', subtype: Asc.c_oAscTimePeriod.last7Days}, { name: Common.define.conditionalData.textLast7days, subtype: Asc.c_oAscTimePeriod.last7Days},
{ name: 'Last week', subtype: Asc.c_oAscTimePeriod.lastWeek}, { name: Common.define.conditionalData.textLastWeek, subtype: Asc.c_oAscTimePeriod.lastWeek},
{ name: 'This week', subtype: Asc.c_oAscTimePeriod.thisWeek}, { name: Common.define.conditionalData.textThisWeek, subtype: Asc.c_oAscTimePeriod.thisWeek},
{ name: 'Next week', subtype: Asc.c_oAscTimePeriod.nextWeek}, { name: Common.define.conditionalData.textNextWeek, subtype: Asc.c_oAscTimePeriod.nextWeek},
{ name: 'Last month', subtype: Asc.c_oAscTimePeriod.lastMonth}, { name: Common.define.conditionalData.textLastMonth, subtype: Asc.c_oAscTimePeriod.lastMonth},
{ name: 'This month', subtype: Asc.c_oAscTimePeriod.thisMonth}, { name: Common.define.conditionalData.textThisMonth, subtype: Asc.c_oAscTimePeriod.thisMonth},
{ name: 'Next month', subtype: Asc.c_oAscTimePeriod.nextMonth} { name: Common.define.conditionalData.textNextMonth, subtype: Asc.c_oAscTimePeriod.nextMonth}
] ]
}, },
{ {
name: 'Blank/Error', name: Common.define.conditionalData.textBlank + '/' + Common.define.conditionalData.textError,
type: Asc.c_oAscCFType.containsBlanks, type: Asc.c_oAscCFType.containsBlanks,
rules: [ rules: [
{ name: 'Contains blanks', type: Asc.c_oAscCFType.containsBlanks }, { name: Common.define.conditionalData.textBlanks, type: Asc.c_oAscCFType.containsBlanks },
{ name: 'Does not contain blanks', type: Asc.c_oAscCFType.notContainsBlanks }, { name: Common.define.conditionalData.textNotBlanks, type: Asc.c_oAscCFType.notContainsBlanks },
{ name: 'Contains errors', type: Asc.c_oAscCFType.containsErrors }, { name: Common.define.conditionalData.textErrors, type: Asc.c_oAscCFType.containsErrors },
{ name: 'Does not contain errors', type: Asc.c_oAscCFType.notContainsErrors } { name: Common.define.conditionalData.textNotErrors, type: Asc.c_oAscCFType.notContainsErrors }
] ]
}, },
{ {
name: 'Duplicate/Unique', name: Common.define.conditionalData.textDuplicate + '/' + Common.define.conditionalData.textUnique,
type: Asc.c_oAscCFType.duplicateValues, type: Asc.c_oAscCFType.duplicateValues,
rules: [ rules: [
{ name: 'Duplicate', type: Asc.c_oAscCFType.duplicateValues }, { name: Common.define.conditionalData.textDuplicate, type: Asc.c_oAscCFType.duplicateValues },
{ name: 'Unique', type: Asc.c_oAscCFType.uniqueValues } { name: Common.define.conditionalData.textUnique, type: Asc.c_oAscCFType.uniqueValues }
] ]
}, },
{ {
name: '2 Color scale', name: this.text2Scales,
type: Asc.c_oAscCFType.colorScale, type: Asc.c_oAscCFType.colorScale,
num: 2 num: 2
}, },
{ {
name: '3 Color scale', name: this.text3Scales,
type: Asc.c_oAscCFType.colorScale, type: Asc.c_oAscCFType.colorScale,
num: 3 num: 3
}, },
{ {
name: 'Data bar', name: Common.define.conditionalData.textDataBar,
type: Asc.c_oAscCFType.dataBar type: Asc.c_oAscCFType.dataBar
}, },
{ {
name: 'Icon sets', name: Common.define.conditionalData.textIconSets,
type: Asc.c_oAscCFType.iconSet type: Asc.c_oAscCFType.iconSet
}, },
{ {
name: 'Formula', name: Common.define.conditionalData.textFormula,
type: Asc.c_oAscCFType.expression type: Asc.c_oAscCFType.expression
} }
]; ];
@ -773,10 +773,10 @@ define([
this.lblMidScale = this.$window.find('#format-rules-edit-lbl-scale-2'); this.lblMidScale = this.$window.find('#format-rules-edit-lbl-scale-2');
var data = [ var data = [
{value: Asc.c_oAscCfvoType.Number, displayValue: 'Number'}, {value: Asc.c_oAscCfvoType.Number, displayValue: this.txtNumber},
{value: Asc.c_oAscCfvoType.Percent, displayValue: 'Percentage'}, {value: Asc.c_oAscCfvoType.Percent, displayValue: this.textPercent},
{value: Asc.c_oAscCfvoType.Formula, displayValue: 'Formula'}, {value: Asc.c_oAscCfvoType.Formula, displayValue: this.textFormula},
{value: Asc.c_oAscCfvoType.Percentile, displayValue: 'Percentile'} {value: Asc.c_oAscCfvoType.Percentile, displayValue: this.textPercentile}
]; ];
for (var i=0; i<3; i++) { for (var i=0; i<3; i++) {
var arr = data; var arr = data;
@ -826,10 +826,10 @@ define([
var arr = data; var arr = data;
if (i==0) { if (i==0) {
arr = [{value: Asc.c_oAscCfvoType.Minimum, displayValue: this.textMinimum}].concat(arr); arr = [{value: Asc.c_oAscCfvoType.Minimum, displayValue: this.textMinimum}].concat(arr);
arr.push({value: Asc.c_oAscCfvoType.AutoMin, displayValue: 'Automatic'}); arr.push({value: Asc.c_oAscCfvoType.AutoMin, displayValue: this.textAutomatic});
} else { } else {
arr = [{value: Asc.c_oAscCfvoType.Maximum, displayValue: this.textMaximum}].concat(arr); arr = [{value: Asc.c_oAscCfvoType.Maximum, displayValue: this.textMaximum}].concat(arr);
arr.push({value: Asc.c_oAscCfvoType.AutoMax, displayValue: 'Automatic'}); arr.push({value: Asc.c_oAscCfvoType.AutoMax, displayValue: this.textAutomatic});
} }
var combo = new Common.UI.ComboBox({ var combo = new Common.UI.ComboBox({
el : $('#format-rules-edit-combo-bar-' + (i+1)), el : $('#format-rules-edit-combo-bar-' + (i+1)),
@ -867,8 +867,8 @@ define([
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{value: false, displayValue: 'Solid'}, {value: false, displayValue: this.textSolid},
{value: true, displayValue: 'Gradient'} {value: true, displayValue: this.textGradient}
] ]
}).on('selected', function(combo, record) { }).on('selected', function(combo, record) {
}); });
@ -904,8 +904,8 @@ define([
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{value: false, displayValue: 'Solid'}, {value: false, displayValue: this.textSolid},
{value: true, displayValue: 'None'} {value: true, displayValue: this.textNone}
] ]
}).on('selected', function(combo, record) { }).on('selected', function(combo, record) {
me.btnPosBorder.setDisabled(record.value); me.btnPosBorder.setDisabled(record.value);
@ -944,9 +944,9 @@ define([
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{value: Asc.c_oAscDataBarDirection.context, displayValue: 'Context'}, {value: Asc.c_oAscDataBarDirection.context, displayValue: this.textContext},
{value: Asc.c_oAscDataBarDirection.leftToRight, displayValue: 'Left to right'}, {value: Asc.c_oAscDataBarDirection.leftToRight, displayValue: this.textLeft2Right},
{value: Asc.c_oAscDataBarDirection.rightToLeft, displayValue: 'Right to left'} {value: Asc.c_oAscDataBarDirection.rightToLeft, displayValue: this.textRight2Left}
] ]
}).on('selected', function(combo, record) { }).on('selected', function(combo, record) {
}); });
@ -965,9 +965,9 @@ define([
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
data : [ data : [
{value: Asc.c_oAscDataBarAxisPosition.automatic, displayValue: 'Automatic'}, {value: Asc.c_oAscDataBarAxisPosition.automatic, displayValue: this.textAutomatic},
{value: Asc.c_oAscDataBarAxisPosition.middle, displayValue: 'Cell midpoint'}, {value: Asc.c_oAscDataBarAxisPosition.middle, displayValue: this.textCellMidpoint},
{value: Asc.c_oAscDataBarAxisPosition.none, displayValue: 'None'} {value: Asc.c_oAscDataBarAxisPosition.none, displayValue: this.textNone}
] ]
}).on('selected', function(combo, record) { }).on('selected', function(combo, record) {
me.btnAxisColor.setDisabled(record.value == Asc.c_oAscDataBarAxisPosition.none); me.btnAxisColor.setDisabled(record.value == Asc.c_oAscDataBarAxisPosition.none);
@ -1188,7 +1188,7 @@ define([
var val = xfs.asc_getNumFormatInfo(); var val = xfs.asc_getNumFormatInfo();
val && this.cmbNumberFormat.setValue(val.asc_getType(), this.textCustom); val && this.cmbNumberFormat.setValue(val.asc_getType(), this.textCustom);
} }
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
getSettings: function() { getSettings: function() {
@ -1366,21 +1366,21 @@ define([
onBoldClick: function() { onBoldClick: function() {
this.xfsFormat.asc_setFontBold(this.btnBold.isActive()); this.xfsFormat.asc_setFontBold(this.btnBold.isActive());
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
onItalicClick: function() { onItalicClick: function() {
this.xfsFormat.asc_setFontItalic(this.btnItalic.isActive()); this.xfsFormat.asc_setFontItalic(this.btnItalic.isActive());
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
onUnderlineClick: function() { onUnderlineClick: function() {
this.xfsFormat.asc_setFontUnderline(this.btnUnderline.isActive()); this.xfsFormat.asc_setFontUnderline(this.btnUnderline.isActive());
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
onStrikeoutClick: function() { onStrikeoutClick: function() {
this.xfsFormat.asc_setFontStrikeout(this.btnStrikeout.isActive()); this.xfsFormat.asc_setFontStrikeout(this.btnStrikeout.isActive());
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
onBordersWidth: function(menu, item, state) { onBordersWidth: function(menu, item, state) {
@ -1445,7 +1445,7 @@ define([
} }
this.xfsFormat.asc_setFontStrikeout(this.btnStrikeout.isActive()); this.xfsFormat.asc_setFontStrikeout(this.btnStrikeout.isActive());
this.xfsFormat.asc_setBorder(new_borders); this.xfsFormat.asc_setBorder(new_borders);
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
} }
}, },
@ -1456,7 +1456,7 @@ define([
picker.currentColor = color; picker.currentColor = color;
this.xfsFormat.asc_setFontColor(Common.Utils.ThemeColor.getRgbColor(this.mnuTextColorPicker.currentColor)); this.xfsFormat.asc_setFontColor(Common.Utils.ThemeColor.getRgbColor(this.mnuTextColorPicker.currentColor));
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
onFormatTextColor: function(btn, e) { onFormatTextColor: function(btn, e) {
@ -1470,7 +1470,7 @@ define([
picker.currentColor = color; picker.currentColor = color;
this.xfsFormat.asc_setFillColor(this.mnuFillColorPicker.currentColor == 'transparent' ? null : Common.Utils.ThemeColor.getRgbColor(this.mnuFillColorPicker.currentColor)); this.xfsFormat.asc_setFillColor(this.mnuFillColorPicker.currentColor == 'transparent' ? null : Common.Utils.ThemeColor.getRgbColor(this.mnuFillColorPicker.currentColor));
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
onFormatFillColor: function(picker, btn, e) { onFormatFillColor: function(picker, btn, e) {
@ -1479,7 +1479,7 @@ define([
onNumberFormatSelect: function(combo, record) { onNumberFormatSelect: function(combo, record) {
this.xfsFormat.asc_setNumFormatInfo(record.format); this.xfsFormat.asc_setNumFormatInfo(record.format);
this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, this.exampleText); this.api.asc_getPreviewCF('format-rules-edit-preview-format', this.xfsFormat, Common.define.conditionalData.exampleText);
}, },
updateThemeColors: function() { updateThemeColors: function() {
@ -1552,24 +1552,7 @@ define([
notcriticalErrorTitle: 'Warning', notcriticalErrorTitle: 'Warning',
textFormat: 'Format', textFormat: 'Format',
textValue: 'Value is', textValue: 'Value is',
textGreater: 'Greater than',
textGreaterEq: 'Greater than or equal to',
textLess: 'Less than',
textLessEq: 'Less than or equal to',
textEqual: 'Equal to',
textNotEqual: 'Not equal to',
textBetween: 'Between',
textNotBetween: 'Not between',
textRanked: 'Ranked', textRanked: 'Ranked',
textTop: 'Top',
textBottom: 'Bottom',
textText: 'Text',
textDate: 'Date',
textBlank: 'Blank',
textDuplicate: 'Duplicate',
textDataBars: 'Data Bars',
textColorScales: 'Color Scales',
textIconSets: 'Icon Sets',
textCustom: 'Custom', textCustom: 'Custom',
textBold: 'Bold', textBold: 'Bold',
textItalic: 'Italic', textItalic: 'Italic',
@ -1613,7 +1596,19 @@ define([
textNewColor: 'Add New Custom Color', textNewColor: 'Add New Custom Color',
tipNumFormat: 'Number Format', tipNumFormat: 'Number Format',
textPreview: 'Preview', textPreview: 'Preview',
exampleText: 'AaBbCcYyZz' text2Scales: '2 Color scale',
text3Scales: '3 Color scale',
textPercent: 'Percent',
textFormula: 'Formula',
textPercentile: 'Percentile',
textAutomatic: 'Automatic',
textContext: 'Context',
textLeft2Right: 'Left to right',
textRight2Left: 'Right to left',
textNone: 'None',
textSolid: 'Solid',
textCellMidpoint: 'Cell midpoint',
textGradient: 'Gradient'
}, SSE.Views.FormatRulesEditDlg || {})); }, SSE.Views.FormatRulesEditDlg || {}));
}); });

View file

@ -271,7 +271,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
var name = ''; var name = '';
switch (rule.asc_getType()) { switch (rule.asc_getType()) {
case Asc.c_oAscCFType.aboveAverage: case Asc.c_oAscCFType.aboveAverage:
name = 'Above average'; name = this.textAbove;
var above = rule.asc_getAboveAverage(), var above = rule.asc_getAboveAverage(),
eq = rule.asc_getEqualAverage(), eq = rule.asc_getEqualAverage(),
stddev = rule.asc_getStdDev(); stddev = rule.asc_getStdDev();
@ -283,42 +283,42 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
} }
switch (subtype) { switch (subtype) {
case 0: case 0:
name = 'Above average'; name = this.textAbove;
break; break;
case 1: case 1:
name = 'Below average'; name = this.textBelow;
break; break;
case 2: case 2:
name = 'Equal to or above average'; name = this.textEqAbove;
break; break;
case 3: case 3:
name = 'Equal to or below average'; name = this.textEqBelow;
break; break;
case 4: case 4:
name = '1 std dev above average'; name = this.text1Above;
break; break;
case 5: case 5:
name = '1 std dev below average'; name = this.text1Below;
break; break;
case 6: case 6:
name = '2 std dev above average'; name = this.text2Above;
break; break;
case 7: case 7:
name = '2 std dev below average'; name = this.text2Below;
break; break;
case 8: case 8:
name = '3 std dev above average'; name = this.text3Above;
break; break;
case 9: case 9:
name = '3 std dev below average'; name = this.text3Below;
break; break;
} }
break; break;
case Asc.c_oAscCFType.beginsWith: case Asc.c_oAscCFType.beginsWith:
name = 'Cell value begins with ' + (rule.asc_getContainsText() || ''); name = this.textBeginsWith + ' ' + (rule.asc_getContainsText() || '');
break; break;
case Asc.c_oAscCFType.cellIs: case Asc.c_oAscCFType.cellIs:
name = 'Cell value'; name = this.textCellValue;
var subtype = rule.asc_getOperator(), var subtype = rule.asc_getOperator(),
op; op;
switch (subtype) { switch (subtype) {
@ -347,90 +347,90 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
name = name + ' ' + op + ' ' + (rule.asc_getValue1() || ''); name = name + ' ' + op + ' ' + (rule.asc_getValue1() || '');
break; break;
case Asc.c_oAscCFOperator.between: case Asc.c_oAscCFOperator.between:
name = name + ' ' + Common.Utils.String.format('is between {0} and {1}', (rule.asc_getValue1() || ''), (rule.asc_getValue2() || '')); name = name + ' ' + Common.Utils.String.format(this.textBetween, (rule.asc_getValue1() || ''), (rule.asc_getValue2() || ''));
break; break;
case Asc.c_oAscCFOperator.notBetween: case Asc.c_oAscCFOperator.notBetween:
name = name + ' ' + Common.Utils.String.format('is not between {0} and {1}', (rule.asc_getValue1() || ''), (rule.asc_getValue2() || '')); name = name + ' ' + Common.Utils.String.format(this.textNotBetween, (rule.asc_getValue1() || ''), (rule.asc_getValue2() || ''));
break; break;
} }
break; break;
case Asc.c_oAscCFType.colorScale: case Asc.c_oAscCFType.colorScale:
name = 'Graded color scale'; name = this.textColorScale;
break; break;
case Asc.c_oAscCFType.containsBlanks: case Asc.c_oAscCFType.containsBlanks:
name = 'Cell contains a blank value'; name = this.textContainsBlank;
break; break;
case Asc.c_oAscCFType.containsErrors: case Asc.c_oAscCFType.containsErrors:
name = 'Cell contains an error'; name = this.textContainsError;
break; break;
case Asc.c_oAscCFType.containsText: case Asc.c_oAscCFType.containsText:
name = 'Cell value contains ' + (rule.asc_getContainsText() || ''); name = this.textContains + ' ' + (rule.asc_getContainsText() || '');
break; break;
case Asc.c_oAscCFType.dataBar: case Asc.c_oAscCFType.dataBar:
name = 'Column'; name = Common.define.conditionalData.textDataBar;
break; break;
case Asc.c_oAscCFType.duplicateValues: case Asc.c_oAscCFType.duplicateValues:
name = 'Duplicate values'; name = this.textDuplicate;
break; break;
case Asc.c_oAscCFType.expression: case Asc.c_oAscCFType.expression:
name = 'Formula: ' + (rule.asc_getValue1() || ''); name = Common.define.conditionalData.textFormula + ': ' + (rule.asc_getValue1() || '');
break; break;
case Asc.c_oAscCFType.iconSet: case Asc.c_oAscCFType.iconSet:
name = 'Icon set'; name = this.textIconSet;
break; break;
case Asc.c_oAscCFType.notContainsBlanks: case Asc.c_oAscCFType.notContainsBlanks:
name = 'Cell does not contain a blank value'; name = this.textNotContainsBlank;
break; break;
case Asc.c_oAscCFType.notContainsErrors: case Asc.c_oAscCFType.notContainsErrors:
name = 'Cell does not contain an error'; name = this.textNotContainsError;
break; break;
case Asc.c_oAscCFType.notContainsText: case Asc.c_oAscCFType.notContainsText:
name = 'Cell value does not contain ' + (rule.asc_getContainsText() || ''); name = this.textNotContains + ' ' + (rule.asc_getContainsText() || '');
break; break;
case Asc.c_oAscCFType.timePeriod: case Asc.c_oAscCFType.timePeriod:
var subtype = rule.asc_getTimePeriod(); var subtype = rule.asc_getTimePeriod();
switch (subtype) { switch (subtype) {
case Asc.c_oAscTimePeriod.yesterday: case Asc.c_oAscTimePeriod.yesterday:
name = 'Yesterday'; name = Common.define.conditionalData.textYesterday;
break; break;
case Asc.c_oAscTimePeriod.today: case Asc.c_oAscTimePeriod.today:
name = 'Today'; name = Common.define.conditionalData.textToday;
break; break;
case Asc.c_oAscTimePeriod.tomorrow: case Asc.c_oAscTimePeriod.tomorrow:
name = 'Tomorrow'; name = Common.define.conditionalData.textTomorrow;
break; break;
case Asc.c_oAscTimePeriod.last7Days: case Asc.c_oAscTimePeriod.last7Days:
name = 'In the last 7 days'; name = Common.define.conditionalData.textLast7days;
break; break;
case Asc.c_oAscTimePeriod.lastWeek: case Asc.c_oAscTimePeriod.lastWeek:
name = 'Last week'; name = Common.define.conditionalData.textLastWeek;
break; break;
case Asc.c_oAscTimePeriod.thisWeek: case Asc.c_oAscTimePeriod.thisWeek:
name = 'This week'; name = Common.define.conditionalData.textThisWeek;
break; break;
case Asc.c_oAscTimePeriod.nextWeek: case Asc.c_oAscTimePeriod.nextWeek:
name = 'Next week'; name = Common.define.conditionalData.textNextWeek;
break; break;
case Asc.c_oAscTimePeriod.lastMonth: case Asc.c_oAscTimePeriod.lastMonth:
name = 'Last month'; name = Common.define.conditionalData.textLastMonth;
break; break;
case Asc.c_oAscTimePeriod.thisMonth: case Asc.c_oAscTimePeriod.thisMonth:
name = 'This month'; name = Common.define.conditionalData.textThisMonth;
break; break;
case Asc.c_oAscTimePeriod.nextMonth: case Asc.c_oAscTimePeriod.nextMonth:
name = 'Next month'; name = Common.define.conditionalData.textNextMonth;
break; break;
} }
break; break;
case Asc.c_oAscCFType.top10: case Asc.c_oAscCFType.top10:
name = rule.asc_getBottom() ? 'Bottom' : 'Top'; name = rule.asc_getBottom() ? Common.define.conditionalData.textBottom : Common.define.conditionalData.textTop;
name = name + ' ' + (rule.asc_getRank()) + (rule.asc_getPercent() ? '%' : ''); name = name + ' ' + (rule.asc_getRank()) + (rule.asc_getPercent() ? '%' : '');
break; break;
case Asc.c_oAscCFType.uniqueValues: case Asc.c_oAscCFType.uniqueValues:
name = 'Unique values'; name = this.textUnique;
break; break;
case Asc.c_oAscCFType.endsWith: case Asc.c_oAscCFType.endsWith:
name = 'Cell value ends with ' + (rule.asc_getContainsText() || ''); name = this.textEnds + ' ' + (rule.asc_getContainsText() || '');
break; break;
} }
return name; return name;
@ -473,7 +473,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
if (type == Asc.c_oAscCFType.containsText || type == Asc.c_oAscCFType.notContainsText || type == Asc.c_oAscCFType.beginsWith || if (type == Asc.c_oAscCFType.containsText || type == Asc.c_oAscCFType.notContainsText || type == Asc.c_oAscCFType.beginsWith ||
type == Asc.c_oAscCFType.endsWith || type == Asc.c_oAscCFType.timePeriod || type == Asc.c_oAscCFType.aboveAverage || type == Asc.c_oAscCFType.endsWith || type == Asc.c_oAscCFType.timePeriod || type == Asc.c_oAscCFType.aboveAverage ||
type == Asc.c_oAscCFType.top10 || type == Asc.c_oAscCFType.cellIs || type == Asc.c_oAscCFType.expression) { type == Asc.c_oAscCFType.top10 || type == Asc.c_oAscCFType.cellIs || type == Asc.c_oAscCFType.expression) {
this.api.asc_getPreviewCF(this.rules[rule.get('ruleIndex')].previewDiv, props.asc_getDxf(), this.exampleText); this.api.asc_getPreviewCF(this.rules[rule.get('ruleIndex')].previewDiv, props.asc_getDxf(), Common.define.conditionalData.exampleText);
} }
}, },
@ -656,7 +656,31 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesManagerDlg.templa
textApply: 'Apply to', textApply: 'Apply to',
textFormat: 'Format', textFormat: 'Format',
textSelectData: 'Select data', textSelectData: 'Select data',
exampleText: 'AaBbCcYyZz' textAbove: 'Above average',
textBelow: 'Below average',
textEqAbove: 'Equal to or above average',
textEqBelow: 'Equal to or below average',
text1Above: '1 std dev above average',
text1Below: '1 std dev below average',
text2Above: '2 std dev above average',
text2Below: '2 std dev below average',
text3Above: '3 std dev above average',
text3Below: '3 std dev below average',
textBeginsWith: 'Cell value begins with',
textCellValue: 'Cell value',
textBetween: 'is between {0} and {1}',
textNotBetween: 'is not between {0} and {1}',
textColorScale: 'Graded color scale',
textContainsBlank: 'Cell contains a blank value',
textContainsError: 'Cell contains an error',
textContains: 'Cell value contains',
textNotContains: 'Cell value does not contain',
textNotContainsError: 'Cell does not contain an error',
textNotContainsBlank: 'Cell does not contain a blank value',
textEnds: 'Cell value ends with',
textIconSet: 'Icon set',
textDuplicate: 'Duplicate values',
textUnique: 'Unique values'
}, SSE.Views.FormatRulesManagerDlg || {})); }, SSE.Views.FormatRulesManagerDlg || {}));
}); });

View file

@ -1903,23 +1903,23 @@ define([
this.btnCondFormat.setMenu( new Common.UI.Menu({ this.btnCondFormat.setMenu( new Common.UI.Menu({
items: [ items: [
{ {
caption : this.textGreater, caption : Common.define.conditionalData.textGreater,
type : Asc.c_oAscCFType.cellIs, type : Asc.c_oAscCFType.cellIs,
value : Asc.c_oAscCFOperator.greaterThan value : Asc.c_oAscCFOperator.greaterThan
}, },
{ {
caption : this.textLess, caption : Common.define.conditionalData.textLess,
type : Asc.c_oAscCFType.cellIs, type : Asc.c_oAscCFType.cellIs,
value : Asc.c_oAscCFOperator.lessThan value : Asc.c_oAscCFOperator.lessThan
}, },
{ {
caption : this.textEqual, caption : Common.define.conditionalData.textEqual,
type : Asc.c_oAscCFType.cellIs, type : Asc.c_oAscCFType.cellIs,
value : Asc.c_oAscCFOperator.equal value : Asc.c_oAscCFOperator.equal
}, },
{caption: '--'}, {caption: '--'},
{ {
caption : this.textBetween, caption : Common.define.conditionalData.textBetween,
type : Asc.c_oAscCFType.cellIs, type : Asc.c_oAscCFType.cellIs,
value : Asc.c_oAscCFOperator.between value : Asc.c_oAscCFOperator.between
}, },
@ -1930,43 +1930,43 @@ define([
}, },
{caption: '--'}, {caption: '--'},
{ {
caption : this.textText, caption : Common.define.conditionalData.textText,
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
menuAlign : 'tl-tr', menuAlign : 'tl-tr',
items: [ items: [
{ caption: 'Contains', type: Asc.c_oAscCFType.containsText }, { caption: Common.define.conditionalData.textContains, type: Asc.c_oAscCFType.containsText },
{ caption: 'Does not contain', type: Asc.c_oAscCFType.notContainsText }, { caption: Common.define.conditionalData.textNotContains, type: Asc.c_oAscCFType.notContainsText },
{ caption: 'Begins with', type: Asc.c_oAscCFType.beginsWith }, { caption: Common.define.conditionalData.textBegins, type: Asc.c_oAscCFType.beginsWith },
{ caption: 'Ends with', type: Asc.c_oAscCFType.endsWith } { caption: Common.define.conditionalData.textEnds, type: Asc.c_oAscCFType.endsWith }
] ]
}) })
}, },
{caption: '--'}, {caption: '--'},
{ {
caption : this.textDate, caption : Common.define.conditionalData.textDate,
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
menuAlign : 'tl-tr', menuAlign : 'tl-tr',
items: [ items: [
{ caption: 'Yesterday', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.yesterday }, { caption: Common.define.conditionalData.textYesterday, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.yesterday },
{ caption: 'Today', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.today}, { caption: Common.define.conditionalData.textToday, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.today},
{ caption: 'Tomorrow', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.tomorrow}, { caption: Common.define.conditionalData.textTomorrow, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.tomorrow},
{ caption: 'In the last 7 days', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.last7Days}, { caption: Common.define.conditionalData.textLast7days, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.last7Days},
{ caption: 'Last week', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.lastWeek}, { caption: Common.define.conditionalData.textLastWeek, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.lastWeek},
{ caption: 'This week', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.thisWeek}, { caption: Common.define.conditionalData.textThisWeek, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.thisWeek},
{ caption: 'Next week', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.nextWeek}, { caption: Common.define.conditionalData.textNextWeek, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.nextWeek},
{ caption: 'Last month', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.lastMonth}, { caption: Common.define.conditionalData.textLastMonth, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.lastMonth},
{ caption: 'This month', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.thisMonth}, { caption: Common.define.conditionalData.textThisMonth, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.thisMonth},
{ caption: 'Next month', type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.nextMonth} { caption: Common.define.conditionalData.textNextMonth, type: Asc.c_oAscCFType.timePeriod, value: Asc.c_oAscTimePeriod.nextMonth}
] ]
}) })
}, },
{caption: '--'}, {caption: '--'},
{ {
caption : this.textBlank, caption : Common.define.conditionalData.textBlank,
type : Asc.c_oAscCFType.containsBlanks type : Asc.c_oAscCFType.containsBlanks
}, },
{ {
caption : this.textDuplicate, caption : Common.define.conditionalData.textDuplicate,
type : Asc.c_oAscCFType.duplicateValues type : Asc.c_oAscCFType.duplicateValues
}, },
{caption: '--'}, {caption: '--'},
@ -1987,7 +1987,7 @@ define([
}) })
}, },
{ {
caption : this.textIconSets, caption : Common.define.conditionalData.textIconSets,
type : Asc.c_oAscCFType.iconSet, type : Asc.c_oAscCFType.iconSet,
menu : new Common.UI.Menu({ menu : new Common.UI.Menu({
menuAlign : 'tl-tr', menuAlign : 'tl-tr',
@ -1996,7 +1996,7 @@ define([
}, },
{caption: '--'}, {caption: '--'},
{ {
caption : 'Formula', caption : Common.define.conditionalData.textFormula,
type : Asc.c_oAscCFType.expression type : Asc.c_oAscCFType.expression
}, },
{caption: '--'}, {caption: '--'},
@ -2558,18 +2558,9 @@ define([
tipPrintTitles: 'Print titles', tipPrintTitles: 'Print titles',
capBtnColorSchemas: 'Color Scheme', capBtnColorSchemas: 'Color Scheme',
tipCondFormat: 'Conditional formatting', tipCondFormat: 'Conditional formatting',
textGreater: 'Greater Than',
textLess: 'Less Than',
textEqual: 'Equal To',
textBetween: 'Between',
textTop10: 'Top 10', textTop10: 'Top 10',
textText: 'Text',
textDate: 'Date',
textBlank: 'Blank',
textDuplicate: 'Duplicate',
textDataBars: 'Data Bars', textDataBars: 'Data Bars',
textColorScales: 'Color Scales', textColorScales: 'Color Scales',
textIconSets: 'Icon Sets',
textNewRule: 'New Rule', textNewRule: 'New Rule',
textClearRule: 'Clear Rules', textClearRule: 'Clear Rules',
textSelection: 'From current selection', textSelection: 'From current selection',