[Zope3-checkins] CVS: Zope3/src/zope/app/browser/index/text - configure.zcml:1.11 control.pt:1.6 control.py:1.14

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


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

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/text/configure.zcml 1.10 => 1.11 ===
--- Zope3/src/zope/app/browser/index/text/configure.zcml:1.10	Tue Aug  5 07:34:44 2003
+++ Zope3/src/zope/app/browser/index/text/configure.zcml	Thu Aug  7 13:40:45 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="AddTextIndex"
     menu="add_component" title="Text Index"
     schema="zope.app.interfaces.index.text.IUITextIndex"
     permission="zope.ManageServices"
     content_factory="zope.app.index.text.index.TextIndex"
     arguments="field_name"
-    keyword_arguments="interface"
-    />
+    keyword_arguments="interface" />
 
-  <browser:page
+  <page
     for="zope.app.interfaces.index.text.IUITextIndex"
     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.text.IUITextCatalogIndex"
     label="Edit Text Index"
     permission="zope.ManageContent"
-  />
-
-  <browser:menuItems menu="zmi_views"
-         for="zope.app.interfaces.index.text.IUITextCatalogIndex">
-    <menuItem title="Edit" action="edit.html"/>
-  </browser:menuItems>
-
+    menu="zmi_views" title="Edit" />
 
 </configure>


=== Zope3/src/zope/app/browser/index/text/control.pt 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/index/text/control.pt:1.5	Mon Jun 30 13:04:43 2003
+++ Zope3/src/zope/app/browser/index/text/control.pt	Thu Aug  7 13:40:45 2003
@@ -1,16 +1,17 @@
 <html metal:use-macro="views/standard_macros/page">
+<head>
+  <title metal:fill-slot="title" i18n:translate="">
+    TextIndex Control Page
+  </title>
+</head>
 
-  <head>
-    <title>TextIndex Control Page</title>
-  </head>
+<body>
+<div metal:fill-slot="body">
 
-  <body>
+  <br />
+  <h1 i18n:translate="">TextIndex</h1>
 
-  <div metal:fill-slot="body">
-
-    <h1><br />TextIndex</h1>
-
-    <p class="form-help">
+    <p class="form-help" i18n:translate="">
         This page lets you control a text index, which is used to
         provide a full-text searching facility.  The search box here is
         only for debugging.  Subscription status: A "subscribed" index
@@ -19,74 +20,95 @@
         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>
+  <!-- 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 i18n:translate="">
+    Documents: 
+    <span tal:replace="context/documentCount" i18n:name="doc_count"/>
+  </div>
 
-    <div>
-        Documents: <span tal:replace="context/documentCount" />
-    </div>
+  <div i18n:translate="">
+    Words: 
+    <span tal:replace="context/wordCount" i18n:name="word_count"/>
+  </div>
 
-    <div>
-        Words: <span tal:replace="context/wordCount" />
-    </div>
+  <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>
 
-    <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>;
-                    score=<span tal:replace="info/scoreLabel" />
-                </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>
+        <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="url">url</a>;
+          score=<span tal:content="info/scoreLabel" i18n:name="score"/>
         </div>
-    </div>
+      </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>
 
-  </body>
+    </div>
+  </div>
 
+</div>
+</body>
 </html>


=== Zope3/src/zope/app/browser/index/text/control.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/browser/index/text/control.py:1.13	Sun Jun 22 12:09:46 2003
+++ Zope3/src/zope/app/browser/index/text/control.py	Thu Aug  7 13:40:45 2003
@@ -13,11 +13,8 @@
 ##############################################################################
 """Control view for the text index.
 
-XXX longer description goes here.
-
 $Id$
 """
-
 from __future__ import generators
 
 from zope.interface import implements




More information about the Zope3-Checkins mailing list