Development

Changeset 8463

You must first sign up to be able to contribute.

Changeset 8463

Show
Ignore:
Timestamp:
04/15/08 01:40:45 (5 months ago)
Author:
fabien
Message:

fixed form translation when not using i18n with an object as a parameter

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.1/lib/widget/sfWidgetFormSchemaFormatter.class.php

    r8408 r8463  
    6767      return false;   
    6868    } 
    69      
     69 
    7070    if (is_null(self::$translationCallable)) 
    7171    { 
     72      // replace object with strings 
     73      foreach ($parameters as $key => $value) 
     74      { 
     75        if (is_object($value) && method_exists($value, '__toString')) 
     76        { 
     77          $parameters[$key] = $value->__toString(); 
     78        } 
     79      } 
     80 
    7281      return strtr($subject, $parameters); 
    7382    } 
    74      
     83 
    7584    if (self::$translationCallable instanceof sfCallable) 
    7685    { 
     
    8089    return call_user_func(self::$translationCallable, $subject, $parameters); 
    8190  } 
    82    
     91 
    8392  /** 
    8493   * Returns the current i18n callable