| 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 |
| 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 |
| 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 |
|
} |