From 468de187d0ad59613aa73384976b58b78200ae43 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Mon, 2 Jul 2018 18:39:11 +0530 Subject: support gettext --- js/Sources/CLKINV_f.js | 4 ++-- js/Sources/CLOCK_c.js | 4 ++-- js/Sources/CLOCK_f.js | 2 +- js/Sources/CONST_m.js | 6 +++--- js/Sources/Counter.js | 6 +++--- js/Sources/FROMWS_c.js | 2 +- js/Sources/GENSIN_f.js | 4 ++-- js/Sources/INIMPL_f.js | 4 ++-- js/Sources/Modulo_Count.js | 6 +++--- js/Sources/RAMP.js | 4 ++-- js/Sources/RAND_f.js | 2 +- js/Sources/RAND_m.js | 2 +- js/Sources/READAU_f.js | 12 ++++++------ js/Sources/READC_f.js | 30 +++++++++++++++--------------- js/Sources/RFILE_f.js | 22 +++++++++++----------- js/Sources/STEP.js | 4 ++-- js/Sources/SampleCLK.js | 2 +- js/Sources/TKSCALE.js | 2 +- 18 files changed, 59 insertions(+), 59 deletions(-) (limited to 'js/Sources') diff --git a/js/Sources/CLKINV_f.js b/js/Sources/CLKINV_f.js index 88b78d6e..7f113ea9 100644 --- a/js/Sources/CLKINV_f.js +++ b/js/Sources/CLKINV_f.js @@ -26,13 +26,13 @@ function CLKINV_f() { exprs = graphics.exprs; exprs = exprs[1-1]; while (true) { - [ok,this.prt,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLKINV_f")],[" "],[gettext("Event input port")],[" "]],"Port Number",list("vec",1),exprs); + [ok,this.prt,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CLKINV_f")],[" "],["Event input port"],[" "]],"Port Number",list("vec",1),exprs); this.prt = int(this.prt); if (!ok) { break; } if (this.prt<=0) { - block_parameter_error(msprintf(gettext("Wrong values for \'Port Number\' parameter: %d."),this.prt),gettext("Strictly positive integer expected.")); + block_parameter_error(msprintf("Wrong values for \'Port Number\' parameter: %d.",this.prt),"Strictly positive integer expected."); } else { model.ipar = this.prt; model.evtout = 1; diff --git a/js/Sources/CLOCK_c.js b/js/Sources/CLOCK_c.js index 5ca837b0..c38b27a3 100644 --- a/js/Sources/CLOCK_c.js +++ b/js/Sources/CLOCK_c.js @@ -63,12 +63,12 @@ function CLOCK_c() { dt_old = model.rpar[1-1]; model_n = model; while (true) { - [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CLOCK_c")],[" "],[gettext("Event clock generator")],[" "],[gettext("  Do not start if \'Initialisation Time\' is negative")],[" "]],[[gettext("Period")],[gettext("Initialisation Time")]],list("vec",1,"vec",1),exprs); + [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue([[msprintf("Set %s block parameters","CLOCK_c")],[" "],["Event clock generator"],[" "],["  Do not start if \'Initialisation Time\' is negative"],[" "]],["Period","Initialisation Time"],list("vec",1,"vec",1),exprs); if (!ok) { break; } if (this.dt<=0) { - block_parameter_error(msprintf(gettext("Wrong values for \'%s\' parameter: %5.1e."),gettext("Period"),this.dt),gettext("Strictly positive number expected.")); + block_parameter_error(msprintf("Wrong values for \'%s\' parameter: %5.1e.","Period",this.dt),"Strictly positive number expected."); ok = false; } if (ok) { diff --git a/js/Sources/CLOCK_f.js b/js/Sources/CLOCK_f.js index ca2d5bd3..b76fb219 100644 --- a/js/Sources/CLOCK_f.js +++ b/js/Sources/CLOCK_f.js @@ -63,7 +63,7 @@ function CLOCK_f() { dt_old = model.rpar; model_n = model; while (true) { - [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue("Set Clock block parameters",[["Period"],["Init time"]],list("vec",1,"vec",1),exprs); + [ok,this.dt,this.t0,this.exprs0] = scicos_getvalue("Set Clock block parameters",["Period","Init time"],list("vec",1,"vec",1),exprs); if (!ok) { break; } diff --git a/js/Sources/CONST_m.js b/js/Sources/CONST_m.js index 37110709..e64b22f4 100644 --- a/js/Sources/CONST_m.js +++ b/js/Sources/CONST_m.js @@ -28,13 +28,13 @@ function CONST_m() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,this.C,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"CONST_m")],[" "],[gettext("Constant value generator")],[" "]],gettext("Constant Value"),list("vec",-1),exprs); + [ok,this.C,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","CONST_m")],[" "],["Constant value generator"],[" "]],"Constant Value",list("vec",-1),exprs); if (!ok) { break; } nout = size(this.C); if (find(nout==0)!=[]) { - block_parameter_error(msprintf(gettext("Wrong size for \'%s\' parameter"),gettext("Constant Value")),gettext("Constant value must have at least one element.")); + block_parameter_error(msprintf("Wrong size for \'%s\' parameter","Constant Value"),"Constant value must have at least one element."); } else { model.sim = list("cstblk4_m",4); model.opar = list(this.C); @@ -57,7 +57,7 @@ function CONST_m() { } else if ((typeof(this.C)=="uint8")) { ot = 8; } else { - block_parameter_error(msprintf(gettext("Wrong type for \'%s\' parameter"),gettext("Constant Value")),gettext("Value type must be a numeric type (double, complex, int, int8, ...).")); + block_parameter_error(msprintf("Wrong type for \'%s\' parameter","Constant Value"),"Value type must be a numeric type (double, complex, int, int8, ...)."); ok = false; } if (ok) { diff --git a/js/Sources/Counter.js b/js/Sources/Counter.js index 88f6a593..0221ef97 100644 --- a/js/Sources/Counter.js +++ b/js/Sources/Counter.js @@ -29,16 +29,16 @@ function Counter() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,this.minim,this.maxim,this.rule,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"Counter")],[" "],[gettext("Integer counter generator")],[" "]],[[gettext("Minimum")],[gettext("Maximum")],[gettext("Rule (1:Increment, 2:Decrement)")]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.minim,this.maxim,this.rule,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","Counter")],[" "],["Integer counter generator"],[" "]],["Minimum","Maximum","Rule (1:Increment, 2:Decrement)"],list("vec",1,"vec",1,"vec",1),exprs); if (!ok) { break; } this.maxim = int(this.maxim); this.minim = int(this.minim); if (this.maxim1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Time Record Selection")),gettext("Must be a scalar or an empty matrix.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Time Record Selection"),"Must be a scalar or an empty matrix."); } else if (and(this.frmt1!=fmts)) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Input Format"),this.frmt1),gettext("Valid formats are: "+strcat(fmts,", "))); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Input Format",this.frmt1),"Valid formats are: "+strcat(fmts,", ")); } else if (this.alreadyran&&this.fname1!=fname) { - block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running"),gettext("Input File Name")),gettext("End current simulation first.")); + block_parameter_error(msprintf("You cannot modify \'%s\' when running","Input File Name"),"End current simulation first."); } else if (this.N!=ipar[6-1]&&this.alreadyran) { - block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Buffer Size")),gettext("End current simulation first")); + block_parameter_error(msprintf("You cannot modify \'%s\' when running.","Buffer Size"),"End current simulation first"); } else if (this.alreadyran&&size(this.tmask1)!=size(tmask)) { - block_parameter_error(msprintf(gettext("You cannot modify \'%s\' when running."),gettext("Time Record Selection")),gettext("End current simulation first.")); + block_parameter_error(msprintf("You cannot modify \'%s\' when running.","Time Record Selection"),"End current simulation first."); } else if (this.fname1=="") { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter."),gettext("Input File Name")),gettext("You must provide a file name.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter.","Input File Name"),"You must provide a file name."); } else if (this.M<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Record Size"),this.M),gettext("Strictly positive integer expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Record Size",this.M),"Strictly positive integer expected."); } else if (this.tmask1!=[]&&(this.tmask1<1||this.tmask1>this.M)) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Time Record Selection"),this.tmask1),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(this.M)+"]")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Time Record Selection",this.tmask1),msprintf("Must be in the interval %s.","[1, Record Size = "+string(this.M)+"]")); } else if (nout==0) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),gettext("Strictly positive integer expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Outputs Record Selection",nout),"Strictly positive integer expected."); } else if (nout>this.M) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(this.M)+"]")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Outputs Record Selection",nout),msprintf("Must be in the interval %s.","[1, Record Size = "+string(this.M)+"]")); } else if (max(this.outmask)>this.M||min(this.outmask)<1) { - block_parameter_error(msprintf(gettext("Wrong value for indexes in \'%s\' parameter: %s."),gettext("Outputs Record Selection"),strcat(string(this.outmask.slice())," ")),msprintf(gettext("Must be in the interval %s."),gettext("[1, Record Size = ")+string(this.M)+"]")); + block_parameter_error(msprintf("Wrong value for indexes in \'%s\' parameter: %s.","Outputs Record Selection",strcat(string(this.outmask.slice())," ")),msprintf("Must be in the interval %s.","[1, Record Size = "+string(this.M)+"]")); } else if (this.N<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),this.N),gettext("Strictly positive integer expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Buffer Size",this.N),"Strictly positive integer expected."); } else if (this.swap!=0&&this.swap!=1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Swap Mode"),this.swap),msprintf(gettext("Must be in the interval %s."),"[0, 1]")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Swap Mode",this.swap),msprintf("Must be in the interval %s.","[0, 1]")); } else if (this.offset<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Initial Record Index"),this.offset),gettext("Strictly positive integer expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Initial Record Index",this.offset),"Strictly positive integer expected."); } else { if (this.tmask1==[]) { ievt = 0; diff --git a/js/Sources/RFILE_f.js b/js/Sources/RFILE_f.js index 399eac41..8b39f51d 100644 --- a/js/Sources/RFILE_f.js +++ b/js/Sources/RFILE_f.js @@ -48,7 +48,7 @@ function RFILE_f() { exprs[6-1] = []; } while (true) { - [ok,this.tmask1,this.outmask,this.fname1,this.frmt1,this.N,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"RFILE_f")],[" "],[gettext("Read from an input file")],[" "],[gettext("Read is done on:")],[gettext("  - A binary file if no format given")],[gettext("  - A formatted text file if a format (fortran type) is given")]],[[gettext("Time Record Selection")],[gettext("Outputs Record Selection")],[gettext("Input File Name")],[gettext("Input Format")],[gettext("Buffer Size")]],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1),exprs); + [ok,this.tmask1,this.outmask,this.fname1,this.frmt1,this.N,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","RFILE_f")],[" "],["Read from an input file"],[" "],["Read is done on:"],["  - A binary file if no format given"],["  - A formatted text file if a format (fortran type) is given"]],["Time Record Selection","Outputs Record Selection","Input File Name","Input Format","Buffer Size"],list("vec",-1,"vec",-1,"str",1,"str",1,"vec",1),exprs); if (!ok) { break; } @@ -56,25 +56,25 @@ function RFILE_f() { this.frmt1 = stripblanks(this.frmt1); nout = size(this.outmask,"*"); if (prod(size(this.tmask1))>1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s."),gettext("Time Record Selection"),strcat(string(this.tmask1.slice())," ")),gettext("Empty matrix or scalar expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s.","Time Record Selection",strcat(string(this.tmask1.slice())," ")),"Empty matrix or scalar expected."); } else if (this.tmask1!=[]&&this.tmask1<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d"),gettext("Time Record Selection"),this.tmask1),gettext("Strictly positive integer expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d","Time Record Selection",this.tmask1),"Strictly positive integer expected."); } else if (lunit>0&&min(length(frmt),1)!=min(length(this.frmt1),1)) { - block_parameter_error([gettext("Simulation running !!! You cannot switch
between formatted and unformatted")],gettext("End current simulation first.")); + block_parameter_error(["Simulation running !!! You cannot switch
between formatted and unformatted"],"End current simulation first."); } else if (lunit>0&&this.fname1!=fname) { - block_parameter_error(gettext("Simulation running !!! You cannot modify \'Input File Name\'"),gettext("End current simulation first.")); + block_parameter_error("Simulation running !!! You cannot modify \'Input File Name\'","End current simulation first."); } else if (lunit>0&&size(this.tmask1)!=size(tmask)) { - block_parameter_error(gettext("Simulation running !!! You cannot modify \'Time Record Selection\'"),gettext("End current simulation first.")); + block_parameter_error("Simulation running !!! You cannot modify \'Time Record Selection\'","End current simulation first."); } else if (this.fname1=="") { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s"),gettext("Input File Name"),this.fname1),gettext("You must provide a filename.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s","Input File Name",this.fname1),"You must provide a filename."); } else if (this.frmt1!=""&&(part(this.frmt1,1)!="("||part(this.frmt1,length(this.frmt1))!=")")) { - block_parameter_error(msprintf(gettext("Wrong format for \'%s\' parameter: %s."),gettext("Input Format"),this.frmt1),gettext("You must enclose the format\'s string between parentheses.")); + block_parameter_error(msprintf("Wrong format for \'%s\' parameter: %s.","Input Format",this.frmt1),"You must enclose the format\'s string between parentheses."); } else if (this.N<2) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Buffer Size"),this.N),gettext("Buffer size must be at least 2.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Buffer Size",this.N),"Buffer size must be at least 2."); } else if (nout==0) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %d."),gettext("Outputs Record Selection"),nout),gettext("You must read at least one field in record.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %d.","Outputs Record Selection",nout),"You must read at least one field in record."); } else if (min(this.outmask)<1) { - block_parameter_error(msprintf(gettext("Wrong value for \'%s\' parameter: %s"),gettext("Outputs Record Selection"),strcat(string(this.outmask.slice())," ")),gettext("Strictly positive indexes expected.")); + block_parameter_error(msprintf("Wrong value for \'%s\' parameter: %s","Outputs Record Selection",strcat(string(this.outmask.slice())," ")),"Strictly positive indexes expected."); } else { if (this.tmask1==[]) { ievt = 0; diff --git a/js/Sources/STEP.js b/js/Sources/STEP.js index cb0252ce..8961de2e 100644 --- a/js/Sources/STEP.js +++ b/js/Sources/STEP.js @@ -29,7 +29,7 @@ function STEP() { exprs = graphics.exprs; model = arg1.model; while (true) { - [ok,this.temps,this.in1,this.fi,exprs] = scicos_getvalue([[msprintf(gettext("Set %s block parameters"),"STEP_FUNCTION")],[" "],[gettext("Step Function")],[" "]],[[gettext("Step Time")],[gettext("Initial Value")],[gettext("Final Value")]],list("vec",1,"vec",-1,"vec",-1),exprs); + [ok,this.temps,this.in1,this.fi,exprs] = scicos_getvalue([[msprintf("Set %s block parameters","STEP_FUNCTION")],[" "],["Step Function"],[" "]],["Step Time","Initial Value","Final Value"],list("vec",1,"vec",-1,"vec",-1),exprs); if (!ok) { break; } @@ -41,7 +41,7 @@ function STEP() { } else if (size(this.fi,"*")==1) { this.fi = this.fi*ones(this.in1); } else { - block_parameter_error(msprintf(gettext("\'Initial Value\' and \'Final Value\': incompatible sizes: %d and %d."),size(this.in1,"*"),size(this.fi,"*")),gettext("Same sizes expected.")); + block_parameter_error(msprintf("\'Initial Value\' and \'Final Value\': incompatible sizes: %d and %d.",size(this.in1,"*"),size(this.fi,"*")),"Same sizes expected."); ok = false; } } diff --git a/js/Sources/SampleCLK.js b/js/Sources/SampleCLK.js index 514c8bf2..e79d4191 100644 --- a/js/Sources/SampleCLK.js +++ b/js/Sources/SampleCLK.js @@ -23,7 +23,7 @@ function SampleCLK() { model = arg1.model; exprs = graphics.exprs; while (true) { - [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",[["Sample time"],["Offset"]],list("vec",1,"vec",1),exprs); + [ok,this.frequ,this.offset,exprs] = scicos_getvalue("Set block parameters",["Sample time","Offset"],list("vec",1,"vec",1),exprs); if (!ok) { break; } diff --git a/js/Sources/TKSCALE.js b/js/Sources/TKSCALE.js index ff0f2918..7581ef29 100644 --- a/js/Sources/TKSCALE.js +++ b/js/Sources/TKSCALE.js @@ -26,7 +26,7 @@ function TKSCALE() { graphics = arg1.graphics; exprs = graphics.exprs; model = arg1.model; - [ok,this.a,this.b,this.f,exprs] = scicos_getvalue("Set scale block parameters",[["Min value"],["Max value"],["Normalization"]],list("vec",1,"vec",1,"vec",1),exprs); + [ok,this.a,this.b,this.f,exprs] = scicos_getvalue("Set scale block parameters",["Min value","Max value","Normalization"],list("vec",1,"vec",1,"vec",1),exprs); if (ok) { graphics.exprs = exprs; model.rpar = [[this.a],[this.b],[this.f]]; -- cgit