<div dir="ltr"><div><br><br>On Sat, Oct 31, 2015 at 11:40 AM, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>><br>> On Sat, Oct 31, 2015 at 3:39 PM, Vaclav Petras <<a href="mailto:wenzeslaus@gmail.com">wenzeslaus@gmail.com</a>> wrote:<br>> > On Sat, Oct 31, 2015 at 9:41 AM, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>> >><br>> >> Hi,<br>> >><br>> >> I have realized that gui/wxpython/xml/wxgui_items.xml is not properly<br>> >> updated with the current module descriptions.<br>> ><br>> > Do you mean description elements in wxgui_items.xml? Or do you mean other<br>> > XMLs as well?<br>><br>> For now I mean wxgui_items.xml. Since I am not familiar with the<br>> mechanism I didn't check the rest.<br><br></div><div>Thinking more about it I don't think the main issue is related to wxgui_items.xml, please see below.<br></div><div><br>> > In general, the label element in both wxgui_items.xml and toolboxes.xml is a<br>> > menu-specific string which is supposed to be very short (1-3 words) and<br>> > mostly in a form of command, possibly ending with three dots. There is<br>> > nothing like this in modules, although it would be a good idea to have it<br>> > there. (Note that label and description elements in the menus are something<br>> > else than label and description in modules; this should be fixed as well.)<br>><br>> Yeah, it is a bit confusing.<br>><br>> > The description element in toolboxes.xml is taken from label and<br>> > description. In wxgui_items.xml, content element and description element is<br>> > unique to this file, although there might be some overlaps. Is this what you<br>> > mean? Do you have some examples?<br>><br>> For an example, see<br>> <a href="https://trac.osgeo.org/grass/changeset/66687">https://trac.osgeo.org/grass/changeset/66687</a><br>><br>> This subtle "tuning" of strings is not a good idea.<br>><br>> grep "label\|description" wxgui_items.xml | wc -l<br>> 116<br>><br>> of almost identical strings. Almost means not identical which means<br>> that all of them have to be translated again. Rather a PITA for the<br>> translators.<br><br><br>I don't think there is 116 duplicated strings in wxgui_items.xml. The label element text is unique for XML files (see the "bit confusing" part). This cuts the number to half. Than there are wxGUI-only items such as New (OnWorkspaceNew) which have the string only here (approx 10 items). Than there are items with command element which is an actual command, so executable and parameters. These, in theory, have different description than the module itself, e.g. "g.manual -i" and "g.manual entry=wxGUI".<br><br></div>Finally, there are items with related-module element where there is some module for it, but the GUI starts a specialized wrapper instead or it is a g.gui module and the GUI starts integrated into the main one as opposed to starting a separate process. CommonFormatsImport (r.in.gdal) is an example of the former and GraphicalModeler (g.gui.gmodeler) of the latter.<br><div><br>All (or most) of these entries have keywords which are definitively duplicated and description which may or may not overlap with description from the module. For example, the g.gui.gmodeler labels says "Graphical Modeler" and description "Allows interactively creating, editing and managing models" while GraphicalModeler description says "Launch Graphical modeler". For CommonFormatsImport and r.in.gdal the overlap is there.<br><br></div><div>Even if all items with command element and all items with releated-module element had description element which content overlaps with module's description and/or label, it would be only 29 strings. The actual current number of string which are/should be the same is probably under 20. It would be ideal if it would be 0, but do you think this is what translators complain about?<br></div><div><br>> > Here is some documentation:<br>> ><br>> > <a href="https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/docs/wxgui_sphinx/src/wxgui_toolboxes.rst#L200">https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/docs/wxgui_sphinx/src/wxgui_toolboxes.rst#L200</a><br>> > <a href="https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/xml/toolboxes.dtd">https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/xml/toolboxes.dtd</a><br>> > <a href="https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/xml/wxgui_items.dtd">https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/xml/wxgui_items.dtd</a><br>><br>> I started to read the README but it is rather short :-)<br><br>wxgui_toolboxes.rst should be exhaustive documentation of the toolbox mechanism but regarding the translations, it is just using whatever was there before.<br><br>> >> This is an issue since we get duplication of almost identical strings<br>> >> which then drive mad our translators.<br>> >><br>> >> It is really a job for<br>> >> gui/wxpython/tools/update_menudata.py<br>> >> but this scripts seems to be also outdated while looking to be the<br>> >> perfect solution.<br>> ><br>> > I looks like there is no use for this script now. What I know is in the doc<br>> > which says that "Historically, menudata.xml file was in the source codes and<br>> > was partially maintained by the script<br>> > ``gui/wxpython/tools/update_menudata.py`` which updated the description and<br>> > keywords (based on module's label or description, and keywords)."<br>> ><br>> > I'm not sure if I was ever able to run the original workflow successfully<br>> > (before introducing the toolboxes) which is partially the reason why the<br>> > README still mentions update_metadata.py.<br>><br>> OK, it would be good to clean that up.<br>><br>> > <a href="https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/docs/wxgui_sphinx/src/wxgui_toolboxes.rst#L230">https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/docs/wxgui_sphinx/src/wxgui_toolboxes.rst#L230</a><br>> > <a href="https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/README#L64">https://trac.osgeo.org/grass/browser/grass/trunk/gui/wxpython/README#L64</a><br>> ><br>> > The main point is that all updates now happen automatically,<br>><br>> Indeed not completely since xml/wxgui_items.xml appears to be manually<br>> written (or outdated and based on older description lines?)<br><br></div><div>This is how it was designed. When it is something which is a module, it is in toolboxes.xml which are combined with generated module_item.xml. If it is some GUI thing (i.e. not the automatically generated GUI dialog), it is specified fully manually in wxgui_item.xml. The 29 cases mentioned above might be something in between which in the current design fall back to the GUI items category, thus manually managed. Design can be changed. Question is how.<br></div><div><br>> > so there is no<br>> > need for manual patching of menudata.xml or any other file as it was in the<br>> > past.<br>><br>> ... yes, which is good.<br>><br>> > The issue which the new system inherited from the old one is that the<br>> > description element in GUI XMLs is a combination of label and description<br>> > from a module's interface description as the documentation linked above<br>> > says.<br><br></div><div>Comparing to the max 29 strings above, this happen for every module with both label and description. Not all modules have it but if yes, it would be approx 530 strings in case my guess about how translation works* is right. It seemed to me so significant that I though I'm wrong about how it works because somebody would complain about that.<br></div><div><br></div><div>(*) What I think is that label+description are combined and put to the XML, then this string is extracted later from one of the generated XMLs and put to some file and extracted to po files. On runtime, somehow the strings from XML are linked to the translated ones.<br></div><div><br>> > I always wondered why this doesn't bother translators,<br>><br>> It does.<br><br></div><div>There is apparently a lot of people bothered with many other things but they are silent, but this is a discussion for some other time.<br></div><div><br>> > but since I don't understand the translation process,<br>><br>> In which sense? You take a po file and translate... a very lengthy<br>> job. And almost identical strings have to be translated several times<br>> which does not encourage anyone.<br><br></div><div>This I understand. The part I don't understand is how strings from XML and other parts appear in the po files (it is in the Makefiles and Python scrips, I don't know if there is some doc for that).<br></div><div><br>> It would be great to have a script which autoextracts the strings for<br>> gui/wxpython/xml/wxgui_items.xml as "dry" run (similar to how the old<br>> tools/update_menudata.py worked) in order to decide on a case by case<br>> base when to abbreviate or when not. Again, r66687 is an example where<br>> I reinstated the actual wording, a perfect computer job.<br><br></div><div>As the old system, this would depend on people running it. We must have something <br></div><div><br>> Hope you see now what I mean,<br><br></div><div>Yes, but now I want to know if the normal module entries in menu (for modules with both label and description) are the issue or not since if they are, it is far more significant.<br><br></div></div>