<commit_before><?php

class sfSympalContentSlotRenderer
{
  protected
    $_contentSlot;

  public function __construct(sfSympalContentSlot $contentSlot)
  {
    $this->_contentSlot = $contentSlot;
    $this->_content = $contentSlot->getContentRenderedFor();
  }

  public function render()
  {
    // translate inline edit information
    if ('[Double click to enable inline edit mode.]' == $value = $this->getRenderedValue())
    {
      $value = __($value);
    }

    return $value;
  }

  public function getRawValue()
  {
    return $this->_contentSlot->getRawValue();
  }

  public function getRenderedValue()
  {
    if ($this->_contentSlot->render_function)
    {
      $renderFunction = $this->_contentSlot->render_function;
      if (method_exists($this->_content, $renderFunction))
      {
        return $this->_content->$renderFunction($this);
      }
      else if (method_exists($this->_contentSlot, $renderFunction))
      {
        return $this->_contentSlot->$renderFunction($this);
      }
      else
      {
        sfSympalToolkit::autoloadHelper($renderFunction);

        return $renderFunction($this->_content, $this->_contentSlot->name);
      }
    }
    else
    {
      return $this->getRawValue();
    }
  }

  public function __toString()
  {
    try
    {
      return (string) $this->render();
    }
    catch (Exception $e)
    {
      return sfSympalToolkit::renderException($e);
    }
  }
}<commit_msg>[1.4][sfSympalPlugin][1.0] Fixes inline edit message translation<commit_after><?php

class sfSympalContentSlotRenderer
{
  protected
    $_contentSlot;

  public function __construct(sfSympalContentSlot $contentSlot)
  {
    $this->_contentSlot = $contentSlot;
    $this->_content = $contentSlot->getContentRenderedFor();
  }

  public function render()
  {
    $value = $this->getRenderedValue();

    $this->translateInlineEditMessage($value);

    return $value;
  }

  public function getRawValue()
  {
    $value = $this->_contentSlot->getRawValue();

    $this->translateInlineEditMessage($value);

    return $value;
  }

  public function getRenderedValue()
  {
    if ($this->_contentSlot->render_function)
    {
      $renderFunction = $this->_contentSlot->render_function;
      if (method_exists($this->_content, $renderFunction))
      {
        return $this->_content->$renderFunction($this);
      }
      else if (method_exists($this->_contentSlot, $renderFunction))
      {
        return $this->_contentSlot->$renderFunction($this);
      }
      else
      {
        sfSympalToolkit::autoloadHelper($renderFunction);

        return $renderFunction($this->_content, $this->_contentSlot->name);
      }
    }
    else
    {
      return $this->getRawValue();
    }
  }

  public function __toString()
  {
    try
    {
      return (string) $this->render();
    }
    catch (Exception $e)
    {
      return sfSympalToolkit::renderException($e);
    }
  }

  protected function translateInlineEditMessage(&$value)
  {
    if ('[Double click to enable inline edit mode.]' == $value)
    {
      $value = __($value);
    }
  }
}
{'fraction_non_alphanumeric': 0.13432835820895522, 'fraction_numerical': 0.0012978585334198572, 'mean_word_length': 2.922391857506361, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '379754', 'n_tokens_mistral': 934, 'n_tokens_neox': 918, 'n_words': 163}