summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/coder_6x.inc14
-rw-r--r--tests/coder_6x.inc15
2 files changed, 29 insertions, 0 deletions
diff --git a/includes/coder_6x.inc b/includes/coder_6x.inc
index 5e89f7f..cd084af 100644
--- a/includes/coder_6x.inc
+++ b/includes/coder_6x.inc
@@ -443,6 +443,13 @@ function coder_6x_reviews() {
'#value' => '\s+return\s+('. $argex .');',
'#warning_callback' => '_coder_6x_form_submit_warning',
),
+ array(
+ '#type' => 'regex',
+ '#function' => '_menu$',
+ '#source' => 'allphp',
+ '#value' => '\'title\'\s*=>\s*t\(|\'description\'\s*=>\s*t\(',
+ '#warning_callback' => '_coder_6x_menu_localization_warning',
+ ),
);
$review = array(
@@ -1217,3 +1224,10 @@ function _coder_6x_form_submit_warning() {
);
}
+
+function _coder_6x_menu_localization_warning() {
+ return array(
+ '#warning' => t('Menu item titles and descriptions should now no longer be wrapped in t() calls.'),
+ '#link' => 'http://drupal.org/node/140311',
+ );
+}
diff --git a/tests/coder_6x.inc b/tests/coder_6x.inc
index d8b1310..e0dd0e6 100644
--- a/tests/coder_6x.inc
+++ b/tests/coder_6x.inc
@@ -203,3 +203,18 @@ function mymodule_disable() {
function mymodule_access($op, $node) { // Not ok.
}
+
+function coder_6x_tests_menu() {
+ $items = array();
+
+ $items['test_good'] = array(
+ 'title' => 'My title', // Ok.
+ 'description' => 'My description', // Ok.
+ );
+
+ $items['test_bad'] = array(
+ 'title' => t('My title'), // Not Ok.
+ 'description' => t('My description'), // Not Ok.
+ );
+
+}