[Zope3-checkins] CVS: Zope3/src/zope/app/browser/index/field - configure.zcml:1.5 control.pt:1.6 control.py:1.3

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


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

Modified Files:
	configure.zcml control.pt control.py 
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/index/field/configure.zcml 1.4 => 1.5 ===
--- Zope3/src/zope/app/browser/index/field/configure.zcml:1.4	Tue Aug  5 07:34:37 2003
+++ Zope3/src/zope/app/browser/index/field/configure.zcml	Thu Aug  7 13:40:38 2003
@@ -1,20 +1,15 @@
-<configure
-   xmlns='http://namespaces.zope.org/zope'
-   xmlns:browser='http://namespaces.zope.org/browser'
-   i18n_domain='zope'
-   >
+<configure xmlns="http://namespaces.zope.org/browser">
 
-  <browser:addform
+  <addform
     name="AddFieldIndex"
     menu="add_component" title="Field Index"
     schema="zope.app.interfaces.index.field.IUIFieldIndex"
     permission="zope.ManageServices"
     content_factory="zope.app.index.field.index.FieldIndex"
     arguments="field_name"
-    keyword_arguments="interface"
-    />
+    keyword_arguments="interface" />
 
-  <browser:page
+  <page
     for="zope.app.interfaces.index.field.IUIFieldIndex"
     name="index.html" 
     menu="zmi_views"
@@ -23,17 +18,11 @@
     class=".control.ControlView"
     template="control.pt" />
 
-  <browser:editform
+  <editform
     name="edit.html"
     schema="zope.app.interfaces.index.field.IUIFieldCatalogIndex"
     label="Edit Field Index"
     permission="zope.ManageContent"
-  />
-
-  <browser:menuItems menu="zmi_views"
-         for="zope.app.interfaces.index.field.IUIFieldCatalogIndex">
-    <menuItem title="Edit" action="edit.html"/>
-  </browser:menuItems>
-
+    menu="zmi_views" title="Edit" />
 
 </configure>


=== Zope3/src/zope/app/browser/index/field/control.pt 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/index/field/control.pt:1.5	Mon Jun 30 13:04:43 2003
+++ Zope3/src/zope/app/browser/index/field/control.pt	Thu Aug  7 13:40:38 2003
@@ -1,94 +1,116 @@
 <html metal:use-macro="views/standard_macros/page">
+<head>
+  <title metal:fill-slot="title" i18n:translate="">
+    FieldIndex Control Page
+  </title>
+</head>
+
+<body>
+<div metal:fill-slot="body">
+
+  <br />
+  <h1 i18n:translate="">FieldIndex</h1>
+
+  <p class="form-help" i18n:translate="">
+      This page lets you control a field index, which is used to
+      provide a single field searching facility.  The search box here is
+      only for debugging.  Subscription status: A "subscribed" index
+      will update itself whenever objects are added, deleted or
+      modified; an "unsubscribed" index will retain the indexing
+      information but not update itself further.
+  </p>
+
+  <!-- XXX: Too much logic for a template -->
+  <span tal:condition="request/callSubscribe|nothing" tal:omit-tag="">
+    <span tal:define="dummy context/subscribe" tal:omit-tag=""/>
+    <span i18n:translate="">Successfully subscribed.</span>
+  </span>
+
+  <span tal:condition="request/callUnsubscribe|nothing" tal:omit-tag="">
+    <span tal:define="dummy context/unsubscribe" tal:omit-tag=""/>
+    <span i18n:translate="">Successfully unsubscribed.</span>
+  </span>
+
+  <div tal:condition="context/interface" i18n:translate="">
+    Adapting objects to: 
+    <span tal:replace="view/interface_name" i18n:name="iface_name" />
+  </div>
 
-  <head>
-    <title>FieldIndex Control Page</title>
-  </head>
-
-  <body>
-
-  <div metal:fill-slot="body">
-
-    <h1><br />FieldIndex</h1>
-
-    <p class="form-help">
-        This page lets you control a field index, which is used to
-        provide a single field searching facility.  The search box here is
-        only for debugging.  Subscription status: A "subscribed" index
-        will update itself whenever objects are added, deleted or
-        modified; an "unsubscribed" index will retain the indexing
-        information but not update itself further.
-    </p>
-
-    <span tal:condition="request/callSubscribe|nothing" tal:omit-tag="">
-        <span tal:define="dummy context/subscribe" tal:omit-tag=""/>
-        Successfully subscribed.
-    </span>
-    <span tal:condition="request/callUnsubscribe|nothing" tal:omit-tag="">
-        <span tal:define="dummy context/unsubscribe" tal:omit-tag=""/>
-        Successfully unsubscribed.
-    </span>
-
-    <div tal:condition="context/interface">
-        Adapting objects to: <span tal:replace="view/interface_name" />
-    </div>
-    <div>
-        Indexing on attribute: <span tal:replace="context/field_name" />
-    </div>
+  <div i18n:translate="">
+    Indexing on attribute: 
+   <span tal:replace="context/field_name"  i18n:name="field_name"/>
+  </div>
 
-    <div>
-        Documents: <span tal:replace="context/documentCount" />
-    </div>
+  <div i18n:translate="">
+    Documents: 
+    <span tal:replace="context/documentCount" i18n:name="doc_count"/>
+  </div>
 
-    <form method="POST">
-       <span tal:condition="context/isSubscribed" tal:omit-tag="">
-           Subscription state: ON
-           <input type="submit" value="Unsubscribe" name="callUnsubscribe" />
-       </span>
-       <span tal:condition="not:context/isSubscribed" tal:omit-tag="">
-           Subscription state: OFF
-           <input type="submit" value="Subscribe" name="callSubscribe" />
-       </span>
-       <input type="hidden" name="queryText" value=""
-              tal:attributes="value request/queryText|nothing" />
-    </form>
-
-    <form method="GET">
-        <input type="text" name="queryText" value=""
-               tal:attributes="value request/queryText|nothing" />
-        <input type="submit" value="Query" />
-    </form>
-
-    <div tal:condition="request/queryText|nothing" tal:omit-tag="">
-        <div tal:define="result view/query" tal:omit-tag="">
-            <div tal:condition="not:result/total">
-                No hits.  Please try another query.
-            </div>
-            <div tal:condition="result/total">
-                <div tal:content="
-                string:Hits ${result/first}-${result/last} of ${result/total}:"
-                />
-                <div tal:repeat="info result/results">
-                    title=<span tal:replace="info/title" />;
-                    url=<a href="location"
-                            tal:attributes="href info/location"
-                            tal:content="info/location">url</a>
-                </div>
-            </div>
-            <span tal:condition="exists:result/prev">
-                <a href="next"
-                   tal:attributes="href
-                       string:?queryText=${request/queryText}&start=${view/prevBatch}">&lt;-- PREVIOUS BATCH</a>
-            </span>
-            <span tal:condition="exists:result/next">
-                <a href="next"
-                   tal:attributes="href
-                       string:?queryText=${request/queryText}&start=${view/nextBatch}">NEXT BATCH --&gt;</a>
-            </span>
+  <form method="POST">
+    <span tal:condition="context/isSubscribed" tal:omit-tag="">
+      <span i18n:translate="">Subscription state: ON</span>
+      <input type="submit" value="Unsubscribe" name="callUnsubscribe" 
+             i18n:attributes="value unsubscribe-button"/>
+     </span>
+     <span tal:condition="not:context/isSubscribed" tal:omit-tag="">
+       <span i18n:translate="">Subscription state: OFF</span>
+       <input type="submit" value="Subscribe" name="callSubscribe"
+              i18n:attributes="value subscribe-button"/>
+     </span>
+     <input type="hidden" name="queryText" value=""
+            tal:attributes="value request/queryText|nothing" />
+  </form>
+
+  <form method="GET">
+    <input type="text" name="queryText" value=""
+           tal:attributes="value request/queryText|nothing" />
+    <input type="submit" value="Query" />
+  </form>
+
+  <div tal:condition="request/queryText|nothing" tal:omit-tag="">
+    <div tal:define="result view/query" tal:omit-tag="">
+
+      <div tal:condition="not:result/total" i18n:translate="">
+        No hits.  Please try another query.
+      </div>
+
+      <div tal:condition="result/total">
+        <div i18n:translate="">
+          Hits 
+          <span tal:omit-tag="" tal:content="result/first" i18n:name="first"/>
+          -
+          <span tal:omit-tag="" tal:content="result/last" i18n:name="last"/>
+          of
+          <span tal:omit-tag="" tal:content="result/total" i18n:name="total"/>:
         </div>
-    </div>
+        <div tal:repeat="info result/results" i18n:translate="">
+          title=<span tal:content="info/title" i18n:name="title"/>;
+          url=<a href="location"
+                 tal:attributes="href info/location"
+                 tal:content="info/location"
+                 i18n:name="title">url</a>
+        </div>
+      </div>
 
+      <span tal:condition="exists:result/prev">
+        <a href="next"
+            tal:attributes="href
+              string:?queryText=${request/queryText}&start=${view/prevBatch}"
+            i18n:translate="">
+          &lt;-- PREVIOUS BATCH
+        </a>
+      </span>
+      <span tal:condition="exists:result/next">
+        <a href="next"
+           tal:attributes="href
+             string:?queryText=${request/queryText}&start=${view/nextBatch}"
+           i18n:translate="">
+          NEXT BATCH --&gt;
+        </a>
+      </span>
+    </div>
   </div>
 
-  </body>
-
+</div>
+</body>
 </html>


=== Zope3/src/zope/app/browser/index/field/control.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/index/field/control.py:1.2	Mon Jun 23 12:44:38 2003
+++ Zope3/src/zope/app/browser/index/field/control.py	Thu Aug  7 13:40:38 2003
@@ -13,23 +13,19 @@
 ##############################################################################
 """Control view for the text index.
 
-XXX longer description goes here.
-
 $Id$
 """
-
 from __future__ import generators
 
-from zope.interface import implements
-from zope.component import getService, queryAdapter
+from zope.app.browser.component.interfacewidget import interfaceToName
+from zope.app.interfaces.dublincore import IZopeDublinCore
+from zope.app.interfaces.index.text import IQueryView
 from zope.app.services.servicenames import HubIds
+from zope.app.traversing import canonicalPath
+from zope.component import getService, queryAdapter
 from zope.exceptions import NotFoundError
+from zope.interface import implements
 from zope.publisher.browser import BrowserView
-
-from zope.app.traversing import canonicalPath
-from zope.app.interfaces.dublincore import IZopeDublinCore
-from zope.app.interfaces.index.text import IQueryView
-from zope.app.browser.component.interfacewidget import interfaceToName
 
 class ControlView(BrowserView):
 




More information about the Zope3-Checkins mailing list