opental-checkins
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[OpenTAL-checkins] opental/PlacelessTranslationService PlacelessTr...


From: Magnus Heino
Subject: [OpenTAL-checkins] opental/PlacelessTranslationService PlacelessTr...
Date: Sat, 25 Jan 2003 03:56:59 -0500

CVSROOT:        /cvsroot/opental
Module name:    opental
Changes by:     Magnus Heino <address@hidden>   03/01/25 03:56:59

Modified files:
        PlacelessTranslationService: PlacelessTranslationService.py 

Log message:
        make zpt use the default text if no translation is found

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/opental/opental/PlacelessTranslationService/PlacelessTranslationService.py.diff?tr1=1.4&tr2=1.5&r1=text&r2=text

Patches:
Index: opental/PlacelessTranslationService/PlacelessTranslationService.py
diff -u opental/PlacelessTranslationService/PlacelessTranslationService.py:1.4 
opental/PlacelessTranslationService/PlacelessTranslationService.py:1.5
--- opental/PlacelessTranslationService/PlacelessTranslationService.py:1.4      
Mon Jan 20 18:40:47 2003
+++ opental/PlacelessTranslationService/PlacelessTranslationService.py  Sat Jan 
25 03:56:59 2003
@@ -17,7 +17,7 @@
 #    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307, USA
 """Placeless Translation Service for providing I18n to file-based code.
 
-$Id: PlacelessTranslationService.py,v 1.4 2003/01/20 23:40:47 lalo Exp $
+$Id: PlacelessTranslationService.py,v 1.5 2003/01/25 08:56:59 magnusheino Exp $
 """
 
 from Negotiator import negotiator
@@ -98,7 +98,6 @@
                 langs = [m[0] for m in self._catalogs.keys() if m[1] == domain]
                 target_language = negotiator.getLanguage(langs, context)
 
-
         # Get the translation. Use the specified fallbacks if this fails
         catalog_names = self._catalogs.get((target_language, domain), ())
         if not catalog_names:
@@ -116,9 +115,12 @@
                 # it's not in this catalog, try the next one
                 pass
         else:
-            # Did the fallback fail?  Sigh, use the default or msgid
+            # Did the fallback fail?  Sigh, use the default
             if default is None:
-                text = msgid
+                # OpenTAL provides a default text.
+                # TAL doesn't but will use the default
+                # if None is returned
+                text = None
             else:
                 text = default
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]