Title pretty much says it all. We should be using $t() and not t() directly since this executes during install.

Comments

dave reid’s picture

Status: Active » Needs review
StatusFileSize
new3.1 KB
bfroehle’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #1 catches all instances of t() in simpletest_requirements(). Some nice whitespace fixes as well.

dries’s picture

What about these?

deimos:drupal-cvs dries$ grep -r "\$requirements\[" * | grep "t(" | grep -v "\$t("
modules/color/color.install:        $requirements['color_gd']['description'] = t('The GD library for PHP is enabled, but was compiled without PNG support. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/ref.image.php'));
modules/color/color.install:    $requirements['color_gd']['title'] = t('GD library PNG support');
modules/image/image.install:        $requirements['image_gd']['description'] = t('The GD Library for PHP is enabled, but was compiled without support for functions used by the rotate and desaturate effects. It was probably compiled using the official GD libraries from http://www.libgd.org instead of the GD library bundled with PHP. You should recompile PHP --with-gd using the bundled GD library. See <a href="http://www.php.net/manual/book.image.php">the PHP manual</a>.');
modules/image/image.install:    $requirements['image_gd']['title'] = t('GD library rotate and desaturate effects');
modules/openid/openid.install:    $requirements['openid_math']['title'] = t('OpenID Math library');
modules/simpletest/simpletest.install:    $requirements['php_domdocument']['description'] =t('The testing framework requires the DOMDocument class to be available. Check the configure command at the <a href="@link-phpinfo">PHP info page</a>.', array('@link-phpinfo' => url('admin/reports/status/php')));
modules/simpletest/simpletest.install:    $requirements['php_open_basedir']['description'] = t('The testing framework requires the PHP <a href="@open_basedir-url">open_basedir</a> restriction to be disabled. Check your webserver configuration or contact your web host.', array('@open_basedir-url' => 'http://php.net/manual/en/ini.core.php#ini.open-basedir'));
modules/simpletest/simpletest.install:    $requirements['php_memory_limit']['description'] = t('The testing framework requires the PHP memory limit to be at least %memory_minimum_limit. The current value is %memory_limit. <a href="@url">Follow these steps to continue</a>.', array('%memory_limit' => $memory_limit, '%memory_minimum_limit' => SIMPLETEST_MINIMUM_PHP_MEMORY_LIMIT, '@url' => 'http://drupal.org/node/207036'));
modules/system/system.api.php:    $requirements['cron']['description'] .= ' ' . t('You can <a href="@cron">run cron manually</a>.', array('@cron' => url('admin/logs/status/run-cron')));
modules/update/update.install:      $requirements['update_core']['title'] = t('Drupal core update status');
modules/update/update.install:      $requirements['update_core']['value'] = t('No update data available');
bfroehle’s picture

With the exception of one instance of t() in system.api.php (which we should have be correct to set a good example), the remainder are all within if ($phase == 'runtime') blocks.

Is it worth converting those all to use $t?

dries’s picture

Status: Reviewed & tested by the community » Fixed

Ah, no, you're right. Thanks for checking all of those, Dave. Committed the patch in #1 to CVS HEAD.

bfroehle’s picture

Follow up issue for the occurrence of t() in hook_requirements() of simple.api.php in #1056416: Strings in hook_requirements() api example not using $t.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.