Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 7871)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 7874)
@@ -38,4 +38,36 @@
     return True
 
+#: A list of phone prefixes (order num, country, prefix).
+#: Items with same order num will be sorted alphabetically.
+#: The lower the order num, the higher the precedence.
+INT_PHONE_PREFIXES = [
+    (99, _('Germany'), '49'),
+    ( 1, _('Nigeria'), '234'),
+    (99, _('U.S.'), '1'),
+    ]
+
+def sorted_phone_prefixes(data = INT_PHONE_PREFIXES, request=None):
+    """Sorted tuples of phone prefixes.
+
+    Ordered as shown above and formatted for use in select boxes.
+
+    If request is given, we'll try to translate all country names in
+    order to sort alphabetically correctly.
+
+    XXX: This is a function (and not a constant) as different
+    languages might give different orders. This is not tested yet.
+
+    XXX: If we really want to use alphabetic ordering here, we might
+    think about caching results of translations.
+    """
+    if request is not None:
+        data = [
+            (x, translate(y, context=request), z)
+            for x, y, z in data]
+    return tuple([
+        ('%s (+%s)' % (x[1],x[2]), '+%s' % x[2])
+        for x in sorted(data)
+        ])
+
 class KofaUtils(grok.GlobalUtility):
     """A collection of parameters and methods subject to customization.
@@ -57,9 +89,8 @@
         }
 
-    INT_PHONE_PREFIXES = {
-            _('Germany'): (2, '49'),
-            _('Nigeria'): (1, '234'),
-            _('U.S.'): (3, '1'),
-            }
+    #: A function to return
+    @classmethod
+    def sorted_phone_prefixes(cls, data=INT_PHONE_PREFIXES, request=None):
+        return sorted_phone_prefixes(data, request)
 
     EXAM_SUBJECTS_DICT = {
