[Zope3-checkins] SVN: Zope3/trunk/src/zope/i18n/ Added an API for collating text and a fallback implementation.

Jim Fulton jim at zope.com
Tue Dec 6 19:50:05 EST 2005


Log message for revision 40616:
  Added an API for collating text and a fallback implementation.
  (Apps that really care will probably use an ICU-based adapter that
  we will provide soonish. Watch the zope.ucol project.)
  

Changed:
  U   Zope3/trunk/src/zope/i18n/interfaces/locales.py
  A   Zope3/trunk/src/zope/i18n/locales/fallbackcollator.py
  A   Zope3/trunk/src/zope/i18n/locales/fallbackcollator.txt
  A   Zope3/trunk/src/zope/i18n/locales/tests/test_fallbackcollator.py

-=-
Modified: Zope3/trunk/src/zope/i18n/interfaces/locales.py
===================================================================
--- Zope3/trunk/src/zope/i18n/interfaces/locales.py	2005-12-06 23:09:20 UTC (rev 40615)
+++ Zope3/trunk/src/zope/i18n/interfaces/locales.py	2005-12-07 00:50:04 UTC (rev 40616)
@@ -618,3 +618,22 @@
         If an key is not found or is None, the next higher up Locale
         object is consulted.
         """
+
+class ICollator(Interface):
+    """Provide support for collating text strings
+
+    This interface will typically be provided by adapting a locale.
+    """
+
+    def key(text):
+        """Return a collation key for the given text.
+        """
+
+    def cmp(text1, text2):
+        """Compare two text strings.
+
+        The return value is negative if text1 < text2, 0 is they are
+        equal, and positive if text1 > text2.
+        """
+    
+    

Copied: Zope3/trunk/src/zope/i18n/locales/fallbackcollator.py (from rev 40233, Zope3/branches/jim-i18n-dev/src/zope/i18n/locales/fallbackcollator.py)


Property changes on: Zope3/trunk/src/zope/i18n/locales/fallbackcollator.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native

Copied: Zope3/trunk/src/zope/i18n/locales/fallbackcollator.txt (from rev 40233, Zope3/branches/jim-i18n-dev/src/zope/i18n/locales/fallbackcollator.txt)


Property changes on: Zope3/trunk/src/zope/i18n/locales/fallbackcollator.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Copied: Zope3/trunk/src/zope/i18n/locales/tests/test_fallbackcollator.py (from rev 40233, Zope3/branches/jim-i18n-dev/src/zope/i18n/locales/tests/test_fallbackcollator.py)


Property changes on: Zope3/trunk/src/zope/i18n/locales/tests/test_fallbackcollator.py
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:eol-style
   + native



More information about the Zope3-Checkins mailing list