Hello Federico,

Le 04/03/2019 à 05:58, Federico Miyara a écrit :

Dear all,

I'm trying to understand the way the localizing function gettext works. For instance,

setlanguage('es')     // Set Spanish as session language
gettext("%s: Wrong number of input arguments.\n")

produces the expected result:

%s: Número incorrecto de argumentos de entrada.\n

But

gettext("Wrong number of input arguments.")

returns the original English version

Wrong number of input arguments.

Are the elements %s and \n part of the indexed string?

Yes. The string provided to gettext() is an identifier. So changing any single character of it then refers to another message.

You might have already had a look at the gettext page: https://help.scilab.org/docs/6.0.2/en_US/gettext.html


How can I get a list of indexed strings?

The most frequent ones are newly listed in
--> help error_table

https://help.scilab.org/docs/6.0.2/en_US/error_table.html
For an exhaustive list, please

 * Download and unzip the source code :
   https://www.scilab.org/previous-scilab-versions
 * In your OS file browser, from the root directory of the source tree,
   select all *.pot files (roughtly 1 hundred of files)
 * Edit *.pot files. They are unformatted text files. Each one gathers
   all gettext messages identifiers for a native Scilab module.


Hope This Helps

Samuel


_______________________________________________
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users

Reply via email to