Repository navigation
Conversation
echoix
force-pushed
the
claude/brave-noether-cgh2c0
branch
from
October 11, 2026 12:26
f3c71cc to
0996679
Compare
echoix
force-pushed
the
claude/brave-noether-cgh2c0
branch
from
October 11, 2026 12:29
0996679 to
638b1cc
Compare
echoix
force-pushed
the
claude/brave-noether-cgh2c0
branch
3 times, most recently
from
October 11, 2026 12:43
c36d351 to
d612d60
Compare
The main menu labels of the wxGUI were missing from the translation template, because the generated menustrings.py they came from could be left empty when core/menutree.py failed, and 'make pot' only checked that the file exists. Extract the labels, help texts and descriptions of the wxGUI menu definitions directly from the committed XML files with xgettext and an ITS rules file instead. The template then points to the XML files and line numbers in the repository, and no build step has to succeed before 'make pot'. Add translator comments in a key=value form, with the kind of string as "type" (menu-title, menu-item-label, menu-item-help) and its paired help text, label or tool name, built from the XML, so translators can tell, for example, a verb from a noun. Remove the menustrings.py generation from the Autotools and CMake builds accordingly. Translations of module descriptions used as menu items come from the grassmods domain, which is a fallback of the gettext function. Mark the console help text as translatable. Parts of this change were prepared with AI assistance.
echoix
force-pushed
the
claude/brave-noether-cgh2c0
branch
from
October 11, 2026 12:46
d612d60 to
b11e738
Compare
The action printed the menu strings as _() calls for the generated menustrings.py, which is no longer generated since the strings are extracted from the XML files with an ITS definition. Make the tree action the default one. Parts of this change were prepared with AI assistance.
Removing the menustrings.py rules also removed what made the builds generate and install the menudata.xml and module_tree_menudata.xml files: the CMake build_menustrings target was the only one run by default, and the Autotools rule had the installed copies as prerequisites. Make the CMake build_module_tree_menudata target part of the default build, and copy the generated files into the distribution from the Autotools default target. Add a description of how the wxGUI menus are defined, built and translated. Parts of this change were prepared with AI assistance.
…note Fix the generator of the menu data and the paths of the XML files in the README files and the toolboxes page, add the files that were missing there, drop the recommendation of the broken update_menudata.py script and link the description of the menu build and translation. Parts of this change were prepared with AI assistance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Extract the wxGUI menu strings directly from the committed menu XML files with
xgettextand an ITS rules file (locale/its/), instead of through the generatedgui/wxpython/menustrings.py:toolboxes.xml,wxgui_items.xmlandmenudata_{modeler,psmap,pyedit}.xmlare extracted. Agt:escapeRulekeeps the&of keyboard accelerators.type=...; key=valueform, built from the XML: for exampletype=menu-item-label (text of a menu entry); tool=r.mask. A label gets its help text and a help text gets its label.menustrings.pygeneration is removed from the Autotools and CMake builds, as well as thestringsaction ofcore/menutree.py(treeis now its default). The generation ofmenudata.xmlandmodule_tree_menudata.xmland their installation stay in the default build of both build systems.gui_core/goutput.pyis wrapped in_().doc/development/wxgui_menus.mddescribes how the menus are defined, built and translated.Motivation and context
The main menu labels (
&Raster,&Vector, ...) were missing fromlocale/templates/grasswxpy.pot, so they could not be translated on Weblate.menustrings.pywas left empty whencore/menutree.pyfailed, andmake potonly checked that the file exists.About 50 tool descriptions shown as menu help (label and description joined) are in no template, as before.
How has this been tested?
./configure,make, then the wxGUI under a virtual display. The generated menu XML is installed after a singlemakeand the menus load.ninjaregenerates the menu XML.potrecipe oflocale/Makefilegives agrasswxpy.potwith&Raster,3D r&asterand the console help text, no&, and a comment on each of the 759 strings from the XML files.make verifypasses.Screenshots (if appropriate)
Types of changes
functionality to not work as before)
Checklist
pre-defined prefixes
of this project.
Parts of this change were prepared with AI assistance.