/[opental]/opental/PlacelessTranslationService/PlacelessTranslationService.py
ViewVC logotype

Diff of /opental/PlacelessTranslationService/PlacelessTranslationService.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.5 by magnusheino, Sat Jan 25 08:56:59 2003 UTC revision 1.6 by lalo, Sun Jan 26 22:59:30 2003 UTC
# Line 89  class PlacelessTranslationService(Simple Line 89  class PlacelessTranslationService(Simple
89    
90          if not msgid:          if not msgid:
91              # refuse to translate an empty msgid              # refuse to translate an empty msgid
92              return default or msgid              return default
93    
94            # ZPT passes the object as context.  That's wrong according to spec.
95            try:
96                context = context.REQUEST
97            except AttributeError:
98                pass
99                    
100          if target_language is None:          if target_language is None:
101              if context is None:              if context is None:
# Line 115  class PlacelessTranslationService(Simple Line 121  class PlacelessTranslationService(Simple
121                  # it's not in this catalog, try the next one                  # it's not in this catalog, try the next one
122                  pass                  pass
123          else:          else:
124              # Did the fallback fail?  Sigh, use the default              # Did the fallback fail?  Sigh, use the default.
125              if default is None:              # OpenTAL provides a default text.
126                  # OpenTAL provides a default text.              # TAL doesn't but will use the default
127                  # TAL doesn't but will use the default              # if None is returned
128                  # if None is returned              text = default
                 text = None  
             else:  
                 text = default  
129    
130          # Now we need to do the interpolation          # Now we need to do the interpolation
131          text = self.interpolate(text, mapping)          text = self.interpolate(text, mapping)

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26