We discovered that both 6.2 and 6.3 fail in DE locale when starting
for example g.region:
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
while executing
"winfo reqwidth $path.f$page"
(procedure "compute_size" line 9)
invoked from within
"compute_size $path"
(procedure "NoteBook::_realize" line 7)
invoked from within
"NoteBook::_realize .nb"
(command bound to event)
The related .po file contains:
general/g.region/cmd/main.c:136
msgid "Print;Shell Script"
msgstr "Gebe für Shell-Skript-Weiterverwendung aus."
Hi,
it comes from wrong regexp in gui.tcl file. Attached patch fixes problem.
Maris.
2007/10/17, Markus Neteler <neteler@itc.it>:
We discovered that both 6.2 and 6.3 fail in DE locale when starting
for example g.region:
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
while executing
"winfo reqwidth $path.f$page"
(procedure "compute_size" line 9)
invoked from within
"compute_size $path"
(procedure "NoteBook::_realize" line 7)
invoked from within
"NoteBook::_realize .nb"
(command bound to event)
The related .po file contains:
general/g.region/cmd/main.c:136
msgid "Print;Shell Script"
msgstr "Gebe für Shell-Skript-Weiterverwendung aus."
We discovered that both 6.2 and 6.3 fail in DE locale when starting
for example g.region:
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
while executing
"winfo reqwidth $path.f$page"
(procedure "compute_size" line 9)
invoked from within
"compute_size $path"
(procedure "NoteBook::_realize" line 7)
invoked from within
"NoteBook::_realize .nb"
(command bound to event)
The related .po file contains:
general/g.region/cmd/main.c:136
msgid "Print;Shell Script"
msgstr "Gebe für Shell-Skript-Weiterverwendung aus."
Questions:
- is it correct to apply _() gettext macros to >guisection?
I don't think so. If it's being used for Tk window names, it shouldn't
be localised. If it's also being used for tab titles, the titles
should be localised within the GUI code with G_msg.
Why the ';'? Is that trying to put the checkbox in two tabs at once???
I recall there was a Tcl quoting bug which meant that that the guisection names could not have a space in them. (I've no idea about tcl so "_" is used in a number of places) could that be part of the problem?
> and the source code:
>
> flag.gprint = G_define_flag();
> flag.gprint->key = 'g';
> flag.gprint->description = _("Print in shell script style");
> flag.gprint->guisection = _("Print;Shell Script");
>
> Questions:
> - is it correct to apply _() gettext macros to >guisection?
Glynn:
I don't think so. If it's being used for Tk window names, it shouldn't
be localised. If it's also being used for tab titles, the titles
should be localised within the GUI code with G_msg.
The opt->guisection setting selects the tab into which the option/flag will belong in the module's auto-generated GUI. If the parser code which generates the 'g.module --tcltk' code included G_msg(), what use would that be to the translators? ie how would they compile a list of phrases to be translated without running every module and parsing the --tcltk output?
> > and the source code:
> >
> > flag.gprint = G_define_flag();
> > flag.gprint->key = 'g';
> > flag.gprint->description = _("Print in shell script style");
> > flag.gprint->guisection = _("Print;Shell Script");
> >
> > Questions:
> > - is it correct to apply _() gettext macros to >guisection?
Glynn:
> I don't think so. If it's being used for Tk window names, it shouldn't
> be localised. If it's also being used for tab titles, the titles
> should be localised within the GUI code with G_msg.
The opt->guisection setting selects the tab into which the option/flag
will belong in the module's auto-generated GUI. If the parser code
which generates the 'g.module --tcltk' code included G_msg(), what use
would that be to the translators? ie how would they compile a list of
phrases to be translated without running every module and parsing the
--tcltk output?
In that case, the GUI needs to generate its own tab names.
thanks but I am afraid that the bug persists.
To test:
export LANG=de_DE
export LANGUAGE=de_DE
export LC_ALL=de_DE
g.region
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus"
Markus
Maris Nartiss-2 wrote:
Hi,
it comes from wrong regexp in gui.tcl file. Attached patch fixes problem.
Maris.
2007/10/17, Markus Neteler <neteler@itc.it>:
We discovered that both 6.2 and 6.3 fail in DE locale when starting
for example g.region:
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
bad window path name ".nb.fGebe_für_Shell-Skript-Weiterverwendung_aus."
while executing
"winfo reqwidth $path.f$page"
(procedure "compute_size" line 9)
invoked from within
"compute_size $path"
(procedure "NoteBook::_realize" line 7)
invoked from within
"NoteBook::_realize .nb"
(command bound to event)
The related .po file contains:
general/g.region/cmd/main.c:136
msgid "Print;Shell Script"
msgstr "Gebe für Shell-Skript-Weiterverwendung aus."
# Replace all non-ascii chars, spaces, $ and braces in path with
undescore
- set path [regsub -all {[{}\$\s\u0100-\uffff]} $path "_"]
+ set path [regsub -all
{[{}\$\s\u007a-\uffff\u0001-\u002d\u005b-\u0060]} $path "_"]
set root [expr {$path == "" ? "." : $path}]
set opt($dlg,path) $path
set opt($dlg,root) $root
Why the ';'? Is that trying to put the checkbox in two tabs at once???
No idea - was added by Cedric in 1.22 of main.c
Markus
HamishB wrote:
I recall there was a Tcl quoting bug which meant that that the guisection
names could not have a space in them. (I've no idea about tcl so "_" is
used in a number of places) could that be part of the problem?
what if you change
- flag.gprint->guisection = _("Print;Shell Script");
+ flag.gprint->guisection = _("Print");
this shows that is the only item that uses ';' in the guisection:
grass63$ grep -rI guisection * | grep ';.*;'
include/gis.h says:
/* GUI Layout guidance: ';' delimited heirarchical tree position */
looking at lib/gis/gui.tcl there is "proc normalize_guisection{}"
as that g.region flag is the only thing using the ';' delim, I assume there is
some bug in the delim splitting code, and only that flag ever tries to use it.
I still have no idea at all what the guisection='abc;def' or
normalize_guisection{} is meant to be doing.
Hamish
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
> Markus wrote:
>>> flag.gprint->guisection = _("Print;Shell Script");
> ..
>> thanks but I am afraid that the bug persists.
Hamish:
> what if you change
> - flag.gprint->guisection = _("Print;Shell Script");
> + flag.gprint->guisection = _("Print");
>
This looks good! So let's fix it like this (also in 6.2-CVS for 6.2.3).
I would still like to know what the ';' is trying to do. There is parsing code
to deal with it, better to document+fix that. Maybe it is some really
interesting feature that we throw away due to ignorance?
So I would lean to making the above change in 6.2-CVS now and trying to
understand/fix the root of the problem in gui.tcl for 6.3-CVS.
Hamish
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
> > Markus wrote:
> >>> flag.gprint->guisection = _("Print;Shell Script");
> > ..
> >> thanks but I am afraid that the bug persists.
Hamish:
> > what if you change
> > - flag.gprint->guisection = _("Print;Shell Script");
> > + flag.gprint->guisection = _("Print");
> >
>
> This looks good! So let's fix it like this (also in 6.2-CVS for 6.2.3).
I would still like to know what the ';' is trying to do. There is parsing code
to deal with it, better to document+fix that. Maybe it is some really
interesting feature that we throw away due to ignorance?
So I would lean to making the above change in 6.2-CVS now and trying to
understand/fix the root of the problem in gui.tcl for 6.3-CVS.
Sections are hierarchical. Each top-level section corresponds to a tab
in the dialog. Each subsection corresponds to a frame within the
parent section, so options within the same subsection will be grouped
together in the tab.
For a short-term "fix", the substitution should occur after
normalize_guisection, which parses the guisection string into a Tcl
list.
For the longer term: the idea of generating the Tk widget path for the
tab from the title won't work in locales which aren't based upon the
latin alphabet (Greek, Russian, Japanese etc). You'll end up with
names containing nothing but underscores. It would probably be
simplest just to allocate unique IDs using a counter.