/
Specifying the index of the tcl-formatted parameter
GiD - The personal pre and post processor
Specifying the index of the tcl-formatted parameter
When translating, sometimes the order of the words is rearranged.
For example, it may be syntactically desirable to rearrange the structure of a sentence in translation.
[_ "In %s there are %i inhabitants" $city $inhabitants]
It could be translated by a Spanish translator reordered like this, and become an error:
[_ "Hay %i habitantes en %s" $inhabitants $city]
In the translation only the string in quotes is modified, not the order of the parameters, and become an error. To control this, it is possible to add the index to which a format specification corresponds to the string:
For example:
[_ "In %1\$s there are %2\$i inhabitants" $city $inhabitants]
And the Spanish translator could provide this translation that have the arguments ok:
[_ "Hay %2\$i habitantes en %1\$s" $city $inhabitants]
Related content
Specifying the index of the C-formatted parameter
Specifying the index of the C-formatted parameter
More like this
Marking Tcl/Tk code
Marking Tcl/Tk code
More like this
Typical errors
Typical errors
More like this
Strings with variable parameters
Strings with variable parameters
More like this
Multi-line phrases in Tcl
Multi-line phrases in Tcl
More like this
Mark strings to be translated
Mark strings to be translated
More like this
COPYRIGHT © 2022 · GID · CIMNE