The locale.module complains in the following manner (I was shorted the messages and gave them [references] to some recommendations to fix).
# The first parameter to t() should be a literal string. There should be no variables, concatenation, constants or other non-literal strings there:
At t($reason->reason) in abuse.admin.inc on line 175. [1]
At t('Reason edit '.$values['arid'].' saved') in abuse.admin.inc on line 304. [2]
At t($message,array('@name'=>$account->name)) in abuse.admin.inc on line 456. [3]
At t(variable_get('abuse_warn_body','')) in abuse.admin.inc on line 589. [4]
At t($title,array('!num'=>_abuse_get_tallied_count($type))) in abuse.module on line 523. [5]
At t($title,array('!assigned'=>$assigned,'!remaining'=>$remaining)) in abuse.module on line 529. [5]
At t($reason->reason) in abuse.module on line 606. [1]
# abuse_perm() should have an array of literal string permission names. In abuse.module. [6]
[1]
see: http://api.drupal.org/api/function/t/6
you may rewrite:
[2]
t('Reason edit '.$values['arid'].' saved') to t('Reason edit !reason saved', array('!reason' => $values['arid']))
[3]
abuse_admin_ban_user:
t($message,array('@name'=>$account->name)) to just: $message
but:
$message = t("User @name could not be banned.", array('@name' => $account->name));
$message = t("The user @name has been banned.", array('@name' => $account->name));
[4]
for t(variable_get('abuse_warn_body','')) I am not sure have a look at:
http://groups.drupal.org/node/15177
[5]
see: http://api.drupal.org/api/function/hook_menu/6 ... "title arguments": Arguments to send to t() or your custom callback.
try this:
'title arguments' => array(t('Pending Items'), array(ABUSE_PENDING)),
and instead of t($title,array('!num'=>_abuse_get_tallied_count($type))):
you will write $title .' ('. _abuse_get_tallied_count($type) .')';
I'm not sure, is there a need to translate numbers?
[6]
see:
http://api.drupal.org/api/function/hook_perm/6
I haven't checked yet, but you may improve your code by the use of the coder module (http://drupal.org/project/coder)
Anyway, thank you very much for this module.
Comments
Comment #1
Ingumsky commentedDuplicate?
http://drupal.org/node/391440
Comment #2
osopolaryes it is a duplicate of #391440: Error messages while installing the module - I was installing the module with drush so I haven't got these messages in the installation progress.
Comment #3
Ingumsky commentedThank you for the helpful info!