| 1 |
<?php |
<?php |
| 2 |
// $Id: live_translation.module,v 1.5 2009/04/24 06:27:14 brmassa Exp $ |
// $Id: live_translation.module,v 1.6 2009/06/07 03:11:21 brmassa Exp $ |
| 3 |
/** |
/** |
| 4 |
* @author Bruno Massa |
* @author Bruno Massa |
| 5 |
* @file |
* @file |
| 61 |
} |
} |
| 62 |
|
|
| 63 |
/** |
/** |
|
* Implementation of hook_requirements(). |
|
|
*/ |
|
|
function live_translation_requirements($phase) { |
|
|
if ($phase == 'runtime') { |
|
|
module_load_include('inc', 'live_translation'); |
|
|
$requirements['live_translation']['title'] = t('Translation updates'); |
|
|
switch (_live_translation_status(TRUE)) { |
|
|
case LIVE_TRANSLATION_STATUS_OUTDATE: |
|
|
$requirements['live_translation']['value'] = t('New translations available'); |
|
|
$requirements['live_translation']['severity'] = REQUIREMENT_ERROR; |
|
|
$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'))); |
|
|
break; |
|
|
case LIVE_TRANSLATION_STATUS_UNKNOWN: |
|
|
$requirements['live_translation']['value'] = t('No update data available'); |
|
|
$requirements['live_translation']['severity'] = REQUIREMENT_WARNING; |
|
|
$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'))); |
|
|
break; |
|
|
default: |
|
|
$requirements['live_translation']['value'] = t('Up to date'); |
|
|
} |
|
|
return $requirements; |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
| 64 |
* Implementation of hook_theme(). |
* Implementation of hook_theme(). |
| 65 |
*/ |
*/ |
| 66 |
function live_translation_theme() { |
function live_translation_theme() { |