[GRASS-SVN] r41860 - in grass/trunk/gui/wxpython: . gui_modules xml

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 14 10:03:57 EDT 2010


Author: martinl
Date: 2010-04-14 10:03:56 -0400 (Wed, 14 Apr 2010)
New Revision: 41860

Modified:
   grass/trunk/gui/wxpython/Makefile
   grass/trunk/gui/wxpython/gui_modules/menudata.py
   grass/trunk/gui/wxpython/xml/menudata_modeler.xml
Log:
wxGUI: enable i18n for modeler menu


Modified: grass/trunk/gui/wxpython/Makefile
===================================================================
--- grass/trunk/gui/wxpython/Makefile	2010-04-14 11:40:14 UTC (rev 41859)
+++ grass/trunk/gui/wxpython/Makefile	2010-04-14 14:03:56 UTC (rev 41860)
@@ -21,9 +21,11 @@
 $(ETCDIR)/%: % | $(DSTDIRS)
 	$(INSTALL_DATA) $< $@
 
-menustrings.py: gui_modules/menudata.py $(ETCDIR)/xml/menudata.xml
+menustrings.py: gui_modules/menudata.py $(ETCDIR)/xml/menudata.xml $(ETCDIR)/xml/menudata_modeler.xml 
 	GISBASE="$(GISBASE)" \
 	$(PYTHON) $< > $@
+	GISBASE="$(GISBASE)" \
+	$(PYTHON) $< "modeler" >> $@
 
 $(DSTDIRS): %: | $(ETCDIR)
 	$(MKDIR) $@

Modified: grass/trunk/gui/wxpython/gui_modules/menudata.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menudata.py	2010-04-14 11:40:14 UTC (rev 41859)
+++ grass/trunk/gui/wxpython/gui_modules/menudata.py	2010-04-14 14:03:56 UTC (rev 41860)
@@ -10,7 +10,7 @@
 
 Usage:
 @code
-python menudata.py action [file]
+python menudata.py [action] [manager|modeler]
 @endcode
 
 where <i>action</i>:
@@ -116,7 +116,8 @@
         """!Print menu strings to file (used for localization)
 
         @param fh file descriptor"""
-	fh.write('menustrings = [\n')
+        className = str(self.__class__).split('.', 1)[1]
+	fh.write('menustrings_%s = [\n' % className)
 	for node in self.tree.getiterator():
 	    if node.tag in ['label', 'help']:
 		fh.write('     _(%r),\n' % node.text)
@@ -236,18 +237,19 @@
     import gettext
     gettext.install('grasswxpy', os.path.join(os.getenv("GISBASE"), 'locale'), unicode=True)
 
-    file = None
-    if len(sys.argv) == 1:
-        action = 'strings'
-    elif len(sys.argv) > 1:
-        action = sys.argv[1]
-    if len(sys.argv) > 2:
-        file = sys.argv[2]
-
-    if file:
-        data = ManagerData(file)
+    action = 'strings'
+    menu   = 'manager'
+    
+    for arg in sys.argv:
+        if arg in ('strings', 'tree', 'commands', 'dump'):
+            action =  arg
+        elif arg in ('manager', 'modeler'):
+            menu = arg
+    
+    if menu == 'manager':
+        data = ManagerData()
     else:
-        data = ManagerData()
+        data = ModelerData()
     
     if action == 'strings':
         data.PrintStrings(sys.stdout)

Modified: grass/trunk/gui/wxpython/xml/menudata_modeler.xml
===================================================================
--- grass/trunk/gui/wxpython/xml/menudata_modeler.xml	2010-04-14 11:40:14 UTC (rev 41859)
+++ grass/trunk/gui/wxpython/xml/menudata_modeler.xml	2010-04-14 14:03:56 UTC (rev 41860)
@@ -39,7 +39,7 @@
 	</menuitem>
 	<separator />
 	<menuitem>
-	  <label>Close modeler</label>
+	  <label>Quit modeler</label>
 	  <help>Close modeler window</help>
 	  <handler>OnCloseWindow</handler>
 	  <shortcut>Ctrl+W</shortcut>



More information about the grass-commit mailing list