/[drupal]/contributions/modules/coder/coder_review/includes/coder_review_7x.inc
ViewVC logotype

Diff of /contributions/modules/coder/coder_review/includes/coder_review_7x.inc

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

revision 1.44, Sun Oct 18 22:11:03 2009 UTC revision 1.45, Sun Oct 18 23:05:45 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: coder_review_7x.inc,v 1.43 2009/10/18 21:28:23 snpower Exp $  // $Id: coder_review_7x.inc,v 1.44 2009/10/18 22:11:03 snpower Exp $
3    
4  /**  /**
5   * @file   * @file
# Line 797  function coder_review_7x_reviews() { Line 797  function coder_review_7x_reviews() {
797    
798      // Multilingual      // Multilingual
799        // http://drupal.org/node/224333#locale_context --- Added string context support to t() and format_plural(), changed parameters        // http://drupal.org/node/224333#locale_context --- Added string context support to t() and format_plural(), changed parameters
800          array(
801            '#type' => 'regex',
802            '#value' => '[\s\(]t\s*\(\s*(.*?\s*,\s*){2,}([\'"].*?[\'"])\s*\)',
803            '#value' => '[\s\(]t\s*\(\s*(' . $argex . '\s*,\s*){2,}([\'"].*?[\'"])\s*\)',
804            '#warning_callback' => '_coder_review_7x_t_signature_warning',
805          ),
806    
807          array(
808            '#type' => 'regex',
809            '#value' => '[\s\(]format_plural\s*\(\s*(' . $argex . '\s*,\s*){4,}([\'"].*?[\'"])\s*\)',
810            '#warning_callback' => '_coder_review_7x_format_plural_signature_warning',
811          ),
812    
813    
814      // Misc      // Misc
# Line 1976  function _coder_rewview_7x_hook_profile_ Line 1988  function _coder_rewview_7x_hook_profile_
1988      )),      )),
1989    );    );
1990  }  }
1991    
1992    function _coder_review_7x_t_signature_warning() {
1993      return array(
1994        '#warning' => t('Context has been added to !t() as the third parameter, locale has to be an element in the array. Example: array("context" => "frontpage", "locale" => "de").',
1995          array(
1996            '!t()' => theme('drupalapi', 't', 7),
1997          )),
1998        '#link' => 'http://drupal.org/node/224333#locale_context',
1999      );
2000    }
2001    
2002    function _coder_review_7x_format_plural_signature_warning() {
2003      return array(
2004        '#warning' => t('Context has been added to !format_plural() as the fifth parameter, locale has to be an element in the array. Example: array("context" => "frontpage", "locale" => "de").',
2005          array(
2006            '!format_plural()' => theme('drupalapi', 'format_plural', 7),
2007          )),
2008        '#link' => 'http://drupal.org/node/224333#locale_context',
2009      );
2010    }

Legend:
Removed from v.1.44  
changed lines
  Added in v.1.45

  ViewVC Help
Powered by ViewVC 1.1.2