Commit c14b9755 authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

для локализации

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62367 954022d7-b5bf-4e40-9824-e11837661b57
parent 735cdfef
...@@ -1029,7 +1029,7 @@ function cBESSELY() { ...@@ -1029,7 +1029,7 @@ function cBESSELY() {
cBESSELY.prototype = Object.create( cBaseFunction.prototype ); cBESSELY.prototype = Object.create( cBaseFunction.prototype );
function cBIN2DEC() { function cBIN2DEC() {
cBaseFunction.call( this, "BIN2DEC", null, 1, 1 ); cBaseFunction.call( this, "BIN2DEC", 1, 1 );
} }
cBIN2DEC.prototype = Object.create( cBaseFunction.prototype ); cBIN2DEC.prototype = Object.create( cBaseFunction.prototype );
...@@ -1077,7 +1077,7 @@ cBIN2DEC.prototype.getInfo = function () { ...@@ -1077,7 +1077,7 @@ cBIN2DEC.prototype.getInfo = function () {
} }
function cBIN2HEX() { function cBIN2HEX() {
cBaseFunction.call( this, "BIN2HEX", null, 1, 2 ); cBaseFunction.call( this, "BIN2HEX", 1, 2 );
} }
cBIN2HEX.prototype = Object.create( cBaseFunction.prototype ); cBIN2HEX.prototype = Object.create( cBaseFunction.prototype );
...@@ -1139,7 +1139,7 @@ cBIN2HEX.prototype.getInfo = function () { ...@@ -1139,7 +1139,7 @@ cBIN2HEX.prototype.getInfo = function () {
} }
function cBIN2OCT() { function cBIN2OCT() {
cBaseFunction.call( this, "BIN2OCT", null, 1, 2 ); cBaseFunction.call( this, "BIN2OCT", 1, 2 );
} }
cBIN2OCT.prototype = Object.create( cBaseFunction.prototype ); cBIN2OCT.prototype = Object.create( cBaseFunction.prototype );
...@@ -1201,7 +1201,7 @@ cBIN2OCT.prototype.getInfo = function () { ...@@ -1201,7 +1201,7 @@ cBIN2OCT.prototype.getInfo = function () {
} }
function cCOMPLEX() { function cCOMPLEX() {
cBaseFunction.call( this, "COMPLEX", null, 2, 3 ); cBaseFunction.call( this, "COMPLEX", 2, 3 );
} }
cCOMPLEX.prototype = Object.create( cBaseFunction.prototype ); cCOMPLEX.prototype = Object.create( cBaseFunction.prototype );
...@@ -1325,7 +1325,7 @@ cDEC2BIN.prototype.getInfo = function () { ...@@ -1325,7 +1325,7 @@ cDEC2BIN.prototype.getInfo = function () {
} }
function cDEC2HEX() { function cDEC2HEX() {
cBaseFunction.call( this, "DEC2HEX", null, 1, 2 ); cBaseFunction.call( this, "DEC2HEX", 1, 2 );
} }
cDEC2HEX.prototype = Object.create( cBaseFunction.prototype ); cDEC2HEX.prototype = Object.create( cBaseFunction.prototype );
...@@ -1382,7 +1382,7 @@ cDEC2HEX.prototype.getInfo = function () { ...@@ -1382,7 +1382,7 @@ cDEC2HEX.prototype.getInfo = function () {
} }
function cDEC2OCT() { function cDEC2OCT() {
cBaseFunction.call( this, "DEC2OCT", null, 1, 2 ); cBaseFunction.call( this, "DEC2OCT", 1, 2 );
} }
cDEC2OCT.prototype = Object.create( cBaseFunction.prototype ); cDEC2OCT.prototype = Object.create( cBaseFunction.prototype );
...@@ -1439,7 +1439,7 @@ cDEC2OCT.prototype.getInfo = function () { ...@@ -1439,7 +1439,7 @@ cDEC2OCT.prototype.getInfo = function () {
} }
function cDELTA() { function cDELTA() {
cBaseFunction.call( this, "DELTA", null, 1, 2 ); cBaseFunction.call( this, "DELTA", 1, 2 );
} }
cDELTA.prototype = Object.create( cBaseFunction.prototype ); cDELTA.prototype = Object.create( cBaseFunction.prototype );
...@@ -1483,7 +1483,7 @@ cDELTA.prototype.getInfo = function () { ...@@ -1483,7 +1483,7 @@ cDELTA.prototype.getInfo = function () {
} }
function cERF() { function cERF() {
cBaseFunction.call( this, "ERF", null, 1, 2 ); cBaseFunction.call( this, "ERF", 1, 2 );
} }
cERF.prototype = Object.create( cBaseFunction.prototype ); cERF.prototype = Object.create( cBaseFunction.prototype );
...@@ -1537,7 +1537,7 @@ cERF.prototype.getInfo = function () { ...@@ -1537,7 +1537,7 @@ cERF.prototype.getInfo = function () {
} }
function cERFC() { function cERFC() {
cBaseFunction.call( this, "ERFC", null, 1, 1 ); cBaseFunction.call( this, "ERFC", 1, 1 );
} }
cERFC.prototype = Object.create( cBaseFunction.prototype ); cERFC.prototype = Object.create( cBaseFunction.prototype );
...@@ -1571,7 +1571,7 @@ cERFC.prototype.getInfo = function () { ...@@ -1571,7 +1571,7 @@ cERFC.prototype.getInfo = function () {
} }
function cGESTEP() { function cGESTEP() {
cBaseFunction.call( this, "GESTEP", null, 1, 2 ); cBaseFunction.call( this, "GESTEP", 1, 2 );
} }
cGESTEP.prototype = Object.create( cBaseFunction.prototype ); cGESTEP.prototype = Object.create( cBaseFunction.prototype );
...@@ -1615,7 +1615,7 @@ cGESTEP.prototype.getInfo = function () { ...@@ -1615,7 +1615,7 @@ cGESTEP.prototype.getInfo = function () {
} }
function cHEX2BIN() { function cHEX2BIN() {
cBaseFunction.call( this, "HEX2BIN", null, 1, 2 ); cBaseFunction.call( this, "HEX2BIN", 1, 2 );
} }
cHEX2BIN.prototype = Object.create( cBaseFunction.prototype ); cHEX2BIN.prototype = Object.create( cBaseFunction.prototype );
...@@ -1687,7 +1687,7 @@ cHEX2BIN.prototype.getInfo = function () { ...@@ -1687,7 +1687,7 @@ cHEX2BIN.prototype.getInfo = function () {
} }
function cHEX2DEC() { function cHEX2DEC() {
cBaseFunction.call( this, "HEX2DEC", null, 1, 1 ); cBaseFunction.call( this, "HEX2DEC", 1, 1 );
} }
cHEX2DEC.prototype = Object.create( cBaseFunction.prototype ); cHEX2DEC.prototype = Object.create( cBaseFunction.prototype );
...@@ -1733,7 +1733,7 @@ cHEX2DEC.prototype.getInfo = function () { ...@@ -1733,7 +1733,7 @@ cHEX2DEC.prototype.getInfo = function () {
} }
function cHEX2OCT() { function cHEX2OCT() {
cBaseFunction.call( this, "HEX2OCT", null, 1, 2 ); cBaseFunction.call( this, "HEX2OCT", 1, 2 );
} }
cHEX2OCT.prototype = Object.create( cBaseFunction.prototype ); cHEX2OCT.prototype = Object.create( cBaseFunction.prototype );
...@@ -1804,7 +1804,7 @@ cHEX2OCT.prototype.getInfo = function () { ...@@ -1804,7 +1804,7 @@ cHEX2OCT.prototype.getInfo = function () {
} }
function cIMABS() { function cIMABS() {
cBaseFunction.call( this, "IMABS", null, 1, 1 ); cBaseFunction.call( this, "IMABS", 1, 1 );
} }
cIMABS.prototype = Object.create( cBaseFunction.prototype ); cIMABS.prototype = Object.create( cBaseFunction.prototype );
...@@ -1842,7 +1842,7 @@ cIMABS.prototype.getInfo = function () { ...@@ -1842,7 +1842,7 @@ cIMABS.prototype.getInfo = function () {
} }
function cIMAGINARY() { function cIMAGINARY() {
cBaseFunction.call( this, "IMAGINARY", null, 1, 1 ); cBaseFunction.call( this, "IMAGINARY", 1, 1 );
} }
cIMAGINARY.prototype = Object.create( cBaseFunction.prototype ); cIMAGINARY.prototype = Object.create( cBaseFunction.prototype );
...@@ -1880,7 +1880,7 @@ cIMAGINARY.prototype.getInfo = function () { ...@@ -1880,7 +1880,7 @@ cIMAGINARY.prototype.getInfo = function () {
} }
function cIMARGUMENT() { function cIMARGUMENT() {
cBaseFunction.call( this, "IMARGUMENT", null, 1, 1 ); cBaseFunction.call( this, "IMARGUMENT", 1, 1 );
} }
cIMARGUMENT.prototype = Object.create( cBaseFunction.prototype ); cIMARGUMENT.prototype = Object.create( cBaseFunction.prototype );
...@@ -1918,7 +1918,7 @@ cIMARGUMENT.prototype.getInfo = function () { ...@@ -1918,7 +1918,7 @@ cIMARGUMENT.prototype.getInfo = function () {
} }
function cIMCONJUGATE() { function cIMCONJUGATE() {
cBaseFunction.call( this, "IMCONJUGATE", null, 1, 1 ); cBaseFunction.call( this, "IMCONJUGATE", 1, 1 );
} }
cIMCONJUGATE.prototype = Object.create( cBaseFunction.prototype ); cIMCONJUGATE.prototype = Object.create( cBaseFunction.prototype );
...@@ -1956,7 +1956,7 @@ cIMCONJUGATE.prototype.getInfo = function () { ...@@ -1956,7 +1956,7 @@ cIMCONJUGATE.prototype.getInfo = function () {
} }
function cIMCOS() { function cIMCOS() {
cBaseFunction.call( this, "IMCOS", null, 1, 1 ); cBaseFunction.call( this, "IMCOS", 1, 1 );
} }
cIMCOS.prototype = Object.create( cBaseFunction.prototype ); cIMCOS.prototype = Object.create( cBaseFunction.prototype );
...@@ -1996,7 +1996,7 @@ cIMCOS.prototype.getInfo = function () { ...@@ -1996,7 +1996,7 @@ cIMCOS.prototype.getInfo = function () {
} }
function cIMDIV() { function cIMDIV() {
cBaseFunction.call( this, "IMDIV", null, 2, 2); cBaseFunction.call( this, "IMDIV", 2, 2);
} }
cIMDIV.prototype = Object.create( cBaseFunction.prototype ); cIMDIV.prototype = Object.create( cBaseFunction.prototype );
...@@ -2047,7 +2047,7 @@ cIMDIV.prototype.getInfo = function () { ...@@ -2047,7 +2047,7 @@ cIMDIV.prototype.getInfo = function () {
} }
function cIMEXP() { function cIMEXP() {
cBaseFunction.call( this, "IMEXP", null, 1, 1 ); cBaseFunction.call( this, "IMEXP", 1, 1 );
} }
cIMEXP.prototype = Object.create( cBaseFunction.prototype ); cIMEXP.prototype = Object.create( cBaseFunction.prototype );
...@@ -2087,7 +2087,7 @@ cIMEXP.prototype.getInfo = function () { ...@@ -2087,7 +2087,7 @@ cIMEXP.prototype.getInfo = function () {
} }
function cIMLN() { function cIMLN() {
cBaseFunction.call( this, "IMLN", null, 1, 1 ); cBaseFunction.call( this, "IMLN", 1, 1 );
} }
cIMLN.prototype = Object.create( cBaseFunction.prototype ); cIMLN.prototype = Object.create( cBaseFunction.prototype );
...@@ -2131,7 +2131,7 @@ cIMLN.prototype.getInfo = function () { ...@@ -2131,7 +2131,7 @@ cIMLN.prototype.getInfo = function () {
} }
function cIMLOG10() { function cIMLOG10() {
cBaseFunction.call( this, "IMLOG10", null, 1, 1 ); cBaseFunction.call( this, "IMLOG10", 1, 1 );
} }
cIMLOG10.prototype = Object.create( cBaseFunction.prototype ); cIMLOG10.prototype = Object.create( cBaseFunction.prototype );
...@@ -2175,7 +2175,7 @@ cIMLOG10.prototype.getInfo = function () { ...@@ -2175,7 +2175,7 @@ cIMLOG10.prototype.getInfo = function () {
} }
function cIMLOG2() { function cIMLOG2() {
cBaseFunction.call( this, "IMLOG2", null, 1, 1 ); cBaseFunction.call( this, "IMLOG2", 1, 1 );
} }
cIMLOG2.prototype = Object.create( cBaseFunction.prototype ); cIMLOG2.prototype = Object.create( cBaseFunction.prototype );
...@@ -2219,7 +2219,7 @@ cIMLOG2.prototype.getInfo = function () { ...@@ -2219,7 +2219,7 @@ cIMLOG2.prototype.getInfo = function () {
} }
function cIMPOWER() { function cIMPOWER() {
cBaseFunction.call( this, "IMPOWER", null, 2, 2 ); cBaseFunction.call( this, "IMPOWER", 2, 2 );
} }
cIMPOWER.prototype = Object.create( cBaseFunction.prototype ); cIMPOWER.prototype = Object.create( cBaseFunction.prototype );
...@@ -2273,7 +2273,7 @@ cIMPOWER.prototype.getInfo = function () { ...@@ -2273,7 +2273,7 @@ cIMPOWER.prototype.getInfo = function () {
} }
function cIMPRODUCT() { function cIMPRODUCT() {
cBaseFunction.call( this, "IMPRODUCT", null, 1, 1 ); cBaseFunction.call( this, "IMPRODUCT", 1, 1 );
} }
cIMPRODUCT.prototype = Object.create( cBaseFunction.prototype ); cIMPRODUCT.prototype = Object.create( cBaseFunction.prototype );
...@@ -2359,7 +2359,7 @@ cIMPRODUCT.prototype.getInfo = function () { ...@@ -2359,7 +2359,7 @@ cIMPRODUCT.prototype.getInfo = function () {
} }
function cIMREAL() { function cIMREAL() {
cBaseFunction.call( this, "IMREAL", null, 1, 1 ); cBaseFunction.call( this, "IMREAL", 1, 1 );
} }
cIMREAL.prototype = Object.create( cBaseFunction.prototype ); cIMREAL.prototype = Object.create( cBaseFunction.prototype );
...@@ -2397,7 +2397,7 @@ cIMREAL.prototype.getInfo = function () { ...@@ -2397,7 +2397,7 @@ cIMREAL.prototype.getInfo = function () {
} }
function cIMSIN() { function cIMSIN() {
cBaseFunction.call( this, "IMSIN", null, 1, 1 ); cBaseFunction.call( this, "IMSIN", 1, 1 );
} }
cIMSIN.prototype = Object.create( cBaseFunction.prototype ); cIMSIN.prototype = Object.create( cBaseFunction.prototype );
...@@ -2437,7 +2437,7 @@ cIMSIN.prototype.getInfo = function () { ...@@ -2437,7 +2437,7 @@ cIMSIN.prototype.getInfo = function () {
} }
function cIMSQRT() { function cIMSQRT() {
cBaseFunction.call( this, "IMSQRT", null, 1, 1 ); cBaseFunction.call( this, "IMSQRT", 1, 1 );
} }
cIMSQRT.prototype = Object.create( cBaseFunction.prototype ); cIMSQRT.prototype = Object.create( cBaseFunction.prototype );
...@@ -2477,7 +2477,7 @@ cIMSQRT.prototype.getInfo = function () { ...@@ -2477,7 +2477,7 @@ cIMSQRT.prototype.getInfo = function () {
} }
function cIMSUB() { function cIMSUB() {
cBaseFunction.call( this, "IMSUB", null, 2, 2 ); cBaseFunction.call( this, "IMSUB", 2, 2 );
} }
cIMSUB.prototype = Object.create( cBaseFunction.prototype ); cIMSUB.prototype = Object.create( cBaseFunction.prototype );
...@@ -2528,7 +2528,7 @@ cIMSUB.prototype.getInfo = function () { ...@@ -2528,7 +2528,7 @@ cIMSUB.prototype.getInfo = function () {
} }
function cIMSUM() { function cIMSUM() {
cBaseFunction.call( this, "IMSUM", null, 1, 1 ); cBaseFunction.call( this, "IMSUM", 1, 1 );
} }
cIMSUM.prototype = Object.create( cBaseFunction.prototype ); cIMSUM.prototype = Object.create( cBaseFunction.prototype );
...@@ -2615,7 +2615,7 @@ cIMSUM.prototype.getInfo = function () { ...@@ -2615,7 +2615,7 @@ cIMSUM.prototype.getInfo = function () {
} }
function cOCT2BIN() { function cOCT2BIN() {
cBaseFunction.call( this, "OCT2BIN", null, 1, 2 ); cBaseFunction.call( this, "OCT2BIN", 1, 2 );
} }
cOCT2BIN.prototype = Object.create( cBaseFunction.prototype ); cOCT2BIN.prototype = Object.create( cBaseFunction.prototype );
...@@ -2687,7 +2687,7 @@ cOCT2BIN.prototype.getInfo = function () { ...@@ -2687,7 +2687,7 @@ cOCT2BIN.prototype.getInfo = function () {
} }
function cOCT2DEC() { function cOCT2DEC() {
cBaseFunction.call( this, "OCT2DEC", null, 1, 1 ); cBaseFunction.call( this, "OCT2DEC", 1, 1 );
} }
cOCT2DEC.prototype = Object.create( cBaseFunction.prototype ); cOCT2DEC.prototype = Object.create( cBaseFunction.prototype );
...@@ -2733,7 +2733,7 @@ cOCT2DEC.prototype.getInfo = function () { ...@@ -2733,7 +2733,7 @@ cOCT2DEC.prototype.getInfo = function () {
} }
function cOCT2HEX() { function cOCT2HEX() {
cBaseFunction.call( this, "OCT2HEX", null, 1, 2 ); cBaseFunction.call( this, "OCT2HEX", 1, 2 );
} }
cOCT2HEX.prototype = Object.create( cBaseFunction.prototype ); cOCT2HEX.prototype = Object.create( cBaseFunction.prototype );
......
...@@ -1545,9 +1545,8 @@ cBaseOperator.prototype = { ...@@ -1545,9 +1545,8 @@ cBaseOperator.prototype = {
}; };
/** @constructor */ /** @constructor */
function cBaseFunction( name, nameLocale, argMin, argMax ) { function cBaseFunction( name, argMin, argMax ) {
this.name = name; this.name = name;
this.nameLocale = nameLocale || this.name;
this.type = cElementType.func; this.type = cElementType.func;
this.value = null; this.value = null;
this.argumentsMin = argMin ? argMin : 0; this.argumentsMin = argMin ? argMin : 0;
...@@ -1605,7 +1604,7 @@ cBaseFunction.prototype = { ...@@ -1605,7 +1604,7 @@ cBaseFunction.prototype = {
}, },
Assemble2:function ( arg, start, count ) { Assemble2:function ( arg, start, count ) {
var str = "", c = start+count-1 var str = "", c = start+count-1;
for ( var i = start; i <= c; i++ ) { for ( var i = start; i <= c; i++ ) {
str += arg[i].toString(); str += arg[i].toString();
if ( i !== c ) { if ( i !== c ) {
...@@ -1613,35 +1612,17 @@ cBaseFunction.prototype = { ...@@ -1613,35 +1612,17 @@ cBaseFunction.prototype = {
} }
} }
return new cString( this.name + "(" + str + ")" ); return new cString( this.name + "(" + str + ")" );
/* var str = "";
if ( this.argumentsCurrent === 2 ){
str += arg[start + count - 1] + this.name + arg[start + count - 2];
}
else{
str += this.name + arg[start];
}
return new cString( str );*/
}, },
Assemble2Locale:function ( arg, start, count ) { Assemble2Locale:function ( arg, start, count, locale ) {
var str = "", c = start+count-1 var str = "", c = start + count - 1, localeName = locale(this.name) || this.name;
for ( var i = start; i <= c; i++ ) { for ( var i = start; i <= c; i++ ) {
str += arg[i].toString(); str += arg[i].toString();
if ( i !== c ) { if ( i !== c ) {
str += ","; str += ",";
} }
} }
return new cString( this.nameLocale + "(" + str + ")" ); return new cString( localeName + "(" + str + ")" );
/* var str = "";
if ( this.argumentsCurrent === 2 ){
str += arg[start + count - 1] + this.name + arg[start + count - 2];
}
else{
str += this.name + arg[start];
}
return new cString( str );*/
}, },
toString:function () { toString:function () {
return this.name; return this.name;
...@@ -3791,7 +3772,7 @@ parserFormula.prototype = { ...@@ -3791,7 +3772,7 @@ parserFormula.prototype = {
}, },
/* Сборка функции в инфиксную форму */ /* Сборка функции в инфиксную форму */
assembleLocale:function ( rFormula ) { assembleLocale:function ( locale ) {
/*if ( !rFormula && this.outStack.length == 1 && this.outStack[this.outStack.length - 1] instanceof cError ) { /*if ( !rFormula && this.outStack.length == 1 && this.outStack[this.outStack.length - 1] instanceof cError ) {
return this.Formula; return this.Formula;
}*/ }*/
...@@ -3804,7 +3785,7 @@ parserFormula.prototype = { ...@@ -3804,7 +3785,7 @@ parserFormula.prototype = {
if ( currentElement.type == cElementType.operator || currentElement.type == cElementType.func ) { if ( currentElement.type == cElementType.operator || currentElement.type == cElementType.func ) {
_count_arg = currentElement.getArguments(); _count_arg = currentElement.getArguments();
if( currentElement.type == cElementType.func ){ if( currentElement.type == cElementType.func ){
res = currentElement.Assemble2Locale( elemArr, j - _count_arg, _count_arg ); res = currentElement.Assemble2Locale( elemArr, j - _count_arg, _count_arg, locale);
} }
else{ else{
res = currentElement.Assemble2( elemArr, j - _count_arg, _count_arg ); res = currentElement.Assemble2( elemArr, j - _count_arg, _count_arg );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment