| 1 |
<?php |
<?php |
| 2 |
// $Id: live_translation.install,v 1.2 2009/04/19 02:35:51 brmassa Exp $ |
// $Id: live_translation.install,v 1.3 2009/04/20 02:48:32 brmassa Exp $ |
| 3 |
/** |
/** |
| 4 |
* @author Bruno Massa |
* @author Bruno Massa |
| 5 |
* @file |
* @file |
| 14 |
variable_del('live_translation_update_time'); |
variable_del('live_translation_update_time'); |
| 15 |
variable_del('live_translation_update_untranslated'); |
variable_del('live_translation_update_untranslated'); |
| 16 |
} |
} |
| 17 |
|
|
| 18 |
|
/** |
| 19 |
|
* Implementation of hook_requirements(). |
| 20 |
|
*/ |
| 21 |
|
function live_translation_requirements($phase) { |
| 22 |
|
if ($phase == 'runtime') { |
| 23 |
|
module_load_include('inc', 'live_translation'); |
| 24 |
|
$requirements['live_translation']['title'] = t('Translation updates'); |
| 25 |
|
switch (_live_translation_status(TRUE)) { |
| 26 |
|
case LIVE_TRANSLATION_STATUS_OUTDATE: |
| 27 |
|
$requirements['live_translation']['value'] = t('New translations available'); |
| 28 |
|
$requirements['live_translation']['severity'] = REQUIREMENT_ERROR; |
| 29 |
|
$requirements['live_translation']['description'] = t('There are new strings translated on the translation servers. Go to !translation_status_page.', array('!translation_status_page' => l('translation status page', 'admin/reports/live-translation'))); |
| 30 |
|
break; |
| 31 |
|
case LIVE_TRANSLATION_STATUS_UNKNOWN: |
| 32 |
|
$requirements['live_translation']['value'] = t('No update data available'); |
| 33 |
|
$requirements['live_translation']['severity'] = REQUIREMENT_WARNING; |
| 34 |
|
$requirements['live_translation']['description'] = t('There is a long time you do not check the translation status with the server. Configure cron or !check_it_now.', array('!check_it_now' => l('check it now', 'admin/reports/live-translation/update'))); |
| 35 |
|
break; |
| 36 |
|
default: |
| 37 |
|
$requirements['live_translation']['value'] = t('Up to date'); |
| 38 |
|
} |
| 39 |
|
return $requirements; |
| 40 |
|
} |
| 41 |
|
} |