[Zope3-checkins] CVS: Zope3/src/zope/app/browser/rdb - configure.zcml:1.6 gadflyda.py:1.3 rdb.py:1.4 rdbadd.pt:1.4 rdbconnection.pt:1.5 rdbtestresults.pt:1.2 rdbtestsql.pt:1.2

Stephan Richter srichter at cosmos.phy.tufts.edu
Thu Aug 7 14:42:27 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app/browser/rdb
In directory cvs.zope.org:/tmp/cvs-serv26029/rdb

Modified Files:
	configure.zcml gadflyda.py rdb.py rdbadd.pt rdbconnection.pt 
	rdbtestresults.pt rdbtestsql.pt 
Log Message:
Internationalized the rest of zope/app/browser.

I also took the chance to clean up some old code and remove a lot of cruft.
(This is the reason I decided to do it instead of letting a less 
experienced developer do it.)

I now consider I18n of the Zope core done. What does this mean to you?

1. All code you check into the CVS must be internationalized. That means:

   (a) Python and PT code must be properly tagged.

   (b) zope.pot must be updated. This can be done with::

       [zope/app/translation_files]$ python extract.py

       Note: You do not need to merge the new POT file with the catalogs.

2. Any code snippet that has no I18n is considered a bug! Therefore, please
   take care and do the I18n and make code so when you see missing spots.

Finally I would like to mention that some forms might experience some 
hickups, as I changed and moved around a lot of templates and was not able
to verify them all by hand. Please let me know, if something that used to 
work is not working anymore.


=== Zope3/src/zope/app/browser/rdb/configure.zcml 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/rdb/configure.zcml:1.5	Sun Aug  3 13:49:19 2003
+++ Zope3/src/zope/app/browser/rdb/configure.zcml	Thu Aug  7 13:40:48 2003
@@ -1,27 +1,16 @@
-<configure
-    xmlns='http://namespaces.zope.org/browser'
-    i18n_domain='zope'
-    >
+<configure xmlns="http://namespaces.zope.org/browser">
 
 <!-- ZopeDatabaseAdapter default views -->
 
   <!-- XXX need an index.html that gives the source and is the def view -->
-  <defaultView for="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
-               name="editForm.html" />
-
-  <menuItems menu="zmi_views"
-         for="zope.app.interfaces.rdb.IZopeDatabaseAdapter">
-    <menuItem title="Edit" action="editForm.html"/>
-    <menuItem title="Test" action="testForm.html"/>
-  </menuItems>
 
   <pages
       for="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
       permission="zope.View"
       class=".rdb.Connection"
       >
-    <page name="editForm.html"
-        template="rdbconnection.pt" />
+    <page name="editForm.html" template="rdbconnection.pt" 
+          menu="zmi_views" title="Edit"/>
     <page name="edit.html" attribute="edit" />
     <page name="connect.html" attribute="connect" />
     <page name="disconnect.html" attribute="disconnect" />
@@ -31,13 +20,17 @@
   <pages
       for="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
       permission="zope.View"
-      class=".rdb.TestSQL"
-      >
-    <page name="testForm.html" template="rdbtestsql.pt" />
+      class=".rdb.TestSQL">
+    <page name="testForm.html" template="rdbtestsql.pt"
+          menu="zmi_views" title="Test"/>
     <page name="test.html" template="rdbtestresults.pt" />
 
   </pages>
 
+  <defaultView 
+      for="zope.app.interfaces.rdb.IZopeDatabaseAdapter"
+      name="editForm.html" />
+
 <!-- Gadfly DA -->
 
   <view
@@ -49,7 +42,7 @@
     <page name="+" attribute="add" />
     <page name="action.html" attribute="action" />
 
-    </view>
+  </view>
 
   <!-- Menu entry for "add component" menu -->
   <menuItem
@@ -57,8 +50,7 @@
       for="zope.app.interfaces.container.IAdding"
       title="Gadfly DA" 
       description="A DA for the built-in 100% Pure Python Gadfly Database"
-      action="zope.app.rdb.gadflyda.GadflyAdapter"
-      />
+      action="zope.app.rdb.gadflyda.GadflyAdapter" />
 
   <!-- Menu entry for "add connection" menu -->
   <menuItem
@@ -66,7 +58,6 @@
       for="zope.app.interfaces.container.IAdding"
       title="Gadfly DA" 
       description="A DA for the built-in 100% Pure Python Gadfly Database"
-      action="zope.app.rdb.gadflyda.GadflyAdapter"
-      />
+      action="zope.app.rdb.gadflyda.GadflyAdapter" />
 
 </configure>


=== Zope3/src/zope/app/browser/rdb/gadflyda.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/rdb/gadflyda.py:1.2	Wed Apr 30 19:37:53 2003
+++ Zope3/src/zope/app/browser/rdb/gadflyda.py	Thu Aug  7 13:40:48 2003
@@ -11,7 +11,8 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
-"""
+"""Gadfly DA View Classes
+
 $Id$
 """
 from zope.app.browser.rdb.rdb import AdapterAdd


=== Zope3/src/zope/app/browser/rdb/rdb.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/rdb/rdb.py:1.3	Wed May 28 11:46:01 2003
+++ Zope3/src/zope/app/browser/rdb/rdb.py	Thu Aug  7 13:40:48 2003
@@ -17,7 +17,6 @@
 """
 from zope.component import getFactory
 from zope.proxy import removeAllProxies
-from zope.publisher.browser import BrowserView
 
 from zope.app.interfaces.container import IAdding
 from zope.app.interfaces.rdb import IZopeDatabaseAdapter
@@ -25,7 +24,7 @@
 from zope.app.rdb import queryForResults
 
 
-class TestSQL(BrowserView):
+class TestSQL:
 
     __used_for__ = IZopeDatabaseAdapter
 
@@ -36,8 +35,7 @@
         return result
 
 
-class Connection(BrowserView):
-
+class Connection:
     __used_for__ = IZopeDatabaseAdapter
 
     def edit(self, dsn):
@@ -52,12 +50,11 @@
         self.context.disconnect()
         return self.request.response.redirect(self.request.URL[-1])
 
-class AdapterAdd(BrowserView):
+class AdapterAdd:
     """A base class for Zope database adapter adding views.
 
     Subclasses need to override _adapter_factory_id.
     """
-
     __used_for__ = IAdding
 
     # This needs to be overridden by the actual implementation


=== Zope3/src/zope/app/browser/rdb/rdbadd.pt 1.3 => 1.4 ===
--- Zope3/src/zope/app/browser/rdb/rdbadd.pt:1.3	Wed Jun 25 14:43:06 2003
+++ Zope3/src/zope/app/browser/rdb/rdbadd.pt	Thu Aug  7 13:40:48 2003
@@ -1,33 +1,36 @@
 <html metal:use-macro="context/@@standard_macros/dialog">
 <head>
-  <title>Add Relational Database Adapter</title>
+  <title metal:fill-slot="title" i18n:translate="">
+    Add Relational Database Adapter
+  </title>
 </head>
-<body>
-
-  <div metal:fill-slot="body">
-
-    <form action="action.html" method="post" enctype="multipart/form-data">
 
-      <table>
-        <tbody>
-
-          <tr>
-            <th>Connection URI:</th>
-            <td>
-              Template:
-              dbi://username:password@host:port/dbname;param1=value...<br />
-              <input type="text" name="dsn" size="40" value="dbi://dbname" />
-            </td>
-          </tr>
-
-        </tbody>
-      </table>
+<body>
+<div metal:fill-slot="body">
 
-      <input type="submit" name="add" value="Add" />
+  <form action="action.html" method="post" enctype="multipart/form-data">
 
-    </form>
+    <div class="row">
+      <div class="label" i18n:translate="">Connection URI:</div>
+      <div class="field">
+        <span i18n:translate="">
+          Template:
+          dbi://username:password@host:port/dbname;param1=value...
+        </span>
+        <br />
+        <input type="text" name="dsn" size="40" value="dbi://dbname" />
+      </div>
+    </div>
+
+    <div class="row">
+      <div class="controls">
+        <input type="submit" name="add" value="Add" 
+               i18n:attributes="value add-button"/>
+      </div>
+    </div>
 
-  </div>
+  </form>
 
+</div>
 </body>
 </html>


=== Zope3/src/zope/app/browser/rdb/rdbconnection.pt 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/rdb/rdbconnection.pt:1.4	Mon Jun 30 13:04:44 2003
+++ Zope3/src/zope/app/browser/rdb/rdbconnection.pt	Thu Aug  7 13:40:48 2003
@@ -1,38 +1,43 @@
 <html metal:use-macro="views/standard_macros/page">
 <head>
-  <title>Edit Relational Database Adapter</title>
+  <title metal:fill-slot="title" i18n:translate="">
+    Edit Relational Database Adapter
+  </title>
 </head>
+
 <body>
+<div metal:fill-slot="body">
 
-  <div metal:fill-slot="body">
+  <form action="." method="post" enctype="multipart/form-data">
+  
+    <div class="row">
+      <div class="label" i18n:translate="">Connection URI:</div>
+      <div class="field">
+        <span i18n:translate="">
+          Template:
+          dbi://username:password@host:port/dbname;param1=value...
+        </span>
+        <br />
+        <input type="text" name="dsn" size="40" value=""
+               tal:attributes="value context/getDSN" />
+      </div>
+    </div>
 
-    <form action="." method="post" enctype="multipart/form-data">
-    
-      <table>      
-            <tbody>   
-            
-              <tr>
-                <th>Connection URI:</th>
-                <td>
-              Template: 
-              dbi://username:password@host:port/dbname;param1=value...<br />
-              <input type="text" name="dsn" size="40" value=""
-                  tal:attributes="value context/getDSN" />
-            </td>
-              </tr>
-                        
-            </tbody>     
-      </table>
-    
-      <input type="submit" name="edit.html:method" value="Save Changes" />
-      <input type="submit" name="connect.html:method" value="Connect"
-          tal:condition="python: not context.isConnected()" />
-      <input type="submit" name="disconnect.html:method" value="Disconnect"
-          tal:condition="python: context.isConnected()" />
-    
-    </form> 
+    <div class="row">
+      <div class="controls">
+        <input type="submit" name="edit.html:method" value="Save Changes"
+               i18n:attributes="value save-changes-button"/>
+        <input type="submit" name="connect.html:method" value="Connect"
+               tal:condition="python: not context.isConnected()"
+               i18n:attributes="value connect-button"/>
+        <input type="submit" name="disconnect.html:method" value="Disconnect"
+               tal:condition="python: context.isConnected()"
+               i18n:attributes="value disconnect-button"/>
+      </div>
+    </div>
 
-  </div>
+  </form> 
 
+</div>
 </body>
 </html>


=== Zope3/src/zope/app/browser/rdb/rdbtestresults.pt 1.1 => 1.2 ===
--- Zope3/src/zope/app/browser/rdb/rdbtestresults.pt:1.1	Fri Feb  7 10:48:39 2003
+++ Zope3/src/zope/app/browser/rdb/rdbtestresults.pt	Thu Aug  7 13:40:48 2003
@@ -1,32 +1,34 @@
 <html metal:use-macro="views/standard_macros/page">
 <head>
-  <title>Database Adapter - Test Connection</title>
+  <title metal:fill-slot="title" i18n:translate="">
+    Database Adapter - Test Connection
+  </title>
 </head>
-<body>
-
-  <div metal:fill-slot="body">
-
-    <pre tal:content="request/form/sql" />
 
-    <table border="1"
-        tal:define="result view/getTestResults"
-        tal:condition="result">
-      <tbody>
-
-        <tr>
-          <th tal:repeat="field result/columns"
-              tal:content="field">Field Name</th>
-        </tr>
+<body>
+<div metal:fill-slot="body">
 
-        <tr tal:repeat="row result">
-          <td tal:repeat="field result/columns"
-              tal:content="python: getattr(row, field)">Value</td>
-        </tr>
+  <div i18n:translate="">Executed Query:</div>
+  <pre tal:content="request/form/sql" />
 
-      </tbody>
-    </table>
+  <table border="1"
+      tal:define="result view/getTestResults"
+      tal:condition="result">
+    <tbody>
+
+      <tr>
+        <th tal:repeat="field result/columns"
+            tal:content="field">Field Name</th>
+      </tr>
+
+      <tr tal:repeat="row result">
+        <td tal:repeat="field result/columns"
+            tal:content="python: getattr(row, field)">Value</td>
+      </tr>
 
-  </div>
+    </tbody>
+  </table>
 
+</div>
 </body>
 </html>


=== Zope3/src/zope/app/browser/rdb/rdbtestsql.pt 1.1 => 1.2 ===
--- Zope3/src/zope/app/browser/rdb/rdbtestsql.pt:1.1	Fri Feb  7 10:48:39 2003
+++ Zope3/src/zope/app/browser/rdb/rdbtestsql.pt	Thu Aug  7 13:40:48 2003
@@ -1,35 +1,36 @@
 <html metal:use-macro="views/standard_macros/page">
 <head>
-  <title>Database Adapter - Test Connection</title>
+  <title metal:fill-slot="title" i18n:translate="">
+    Database Adapter - Test Connection
+  </title>
 </head>
-<body>
 
-  <div metal:fill-slot="body">
+<body>
+<div metal:fill-slot="body">
 
-    <form action="." method="post" enctype="multipart/form-data">
+  <form action="." method="post" enctype="multipart/form-data">
 
-      <p>Here you can enter an SQL statement, so you can test the
+    <p i18n:translate="">
+      Here you can enter an SQL statement, so you can test the
       connection.</p>
 
-      <table>
-        <tbody>
-
-          <tr>
-            <th>Query</th>
-            <td>
-              <textarea name="sql" cols="60" rows="10"
-                >SELECT * FROM Table</textarea>
-            </td>
-          </tr>
-
-        </tbody>
-      </table>
-
-      <input type="submit" name="test.html:method" value="Execute" />
-
-    </form>
+    <div class="row">
+      <div class="label" i18n:translate="">Query</div>
+      <div class="field">
+        <textarea name="sql" cols="60" rows="10"
+          >SELECT * FROM Table</textarea>
+      </div>
+    </div>
+
+    <div class="row">
+      <div class="controls">
+        <input type="submit" name="test.html:method" value="Execute" 
+               i18n:attributes="value execute-button"/>
+      </div>
+    </div>
 
-  </div>
+  </form>
 
+</div>
 </body>
 </html>




More information about the Zope3-Checkins mailing list