Closed (fixed)
Project:
Learning Registry
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2012 at 12:21 UTC
Updated:
8 Apr 2012 at 16:16 UTC
Looking at the code there are a couple places (in hook_requirements() and hook_install()) that call the st() function directly.
Since these hooks can sometimes run while Drupal is being installed and sometimes after it's already installed, they should actually use get_t() to automatically get the correct function, t() or st(), to use.
For example, instead of:
$requirements['phpdom'] = array(
'title' => st('PHP document object model'),
);
Do
$t = get_t(); // At the top of the function.
$requirements['phpdom'] = array(
'title' => $t('PHP document object model'),
);
While at it, I'm also wondering if the message in hook_install() should actually just be removed?
function learning_registry_install() {
drupal_set_message((st('Installing learning_registry.')));
Since most modules don't set such a message and Drupal already prints a standard message when modules are installed via the modules page, it seems like it might be a bit inconsistent and out of place.
Comments
Comment #1
jasonh commentedSounds good - implemented!