[Zope3-checkins] SVN: Zope3/trunk/src/zope/i18n/ Merged from jin-i18n-branch:

Jim Fulton jim at zope.com
Tue Jan 3 14:38:43 EST 2006


Log message for revision 41114:
  Merged from jin-i18n-branch:
  
  r40233 | jim | 2005-11-18 14:31:10 -0500 (Fri, 18 Nov 2005) | 4 lines
  
  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.)
  

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	2006-01-03 19:38:32 UTC (rev 41113)
+++ Zope3/trunk/src/zope/i18n/interfaces/locales.py	2006-01-03 19:38:42 UTC (rev 41114)
@@ -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)

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

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)



More information about the Zope3-Checkins mailing list