Convert transformation descriptions to gettext.

This commit is contained in:
Michal Čihař
2010-05-24 12:04:20 +02:00
parent 31010806f7
commit e0b32c7aaa
17 changed files with 106 additions and 15 deletions

View File

@@ -53,11 +53,19 @@ foreach ($types['mimetype'] as $key => $mimetype) {
$odd_row = true;
foreach ($types['transformation'] as $key => $transform) {
$func = strtolower(str_ireplace('.inc.php', '', $types['transformation_file'][$key]));
$desc = 'strTransformation_' . $func;
require './libraries/transformations/' . $types['transformation_file'][$key];
$funcname = 'PMA_transformation_' . $func . '_info';
$desc = '<i>' . sprintf(__('No description is available for this transformation.<br />Please ask the author what %s does.'), 'PMA_transformation_' . $func . '()') . '</i>';
if (function_exists($funcname)) {
$desc_arr = $funcname();
if (isset($desc_arr['info'])) {
$desc = $desc_arr['info'];
}
}
?>
<tr class="<?php echo $odd_row ? 'odd' : 'even'; ?>">
<td><?php echo $transform; ?></td>
<td><?php echo (isset($$desc) ? $$desc : '<i>' . sprintf(__('No description is available for this transformation.<br />Please ask the author what %s does.'), 'PMA_transformation_' . $func . '()') . '</i>'); ?></td>
<td><?php echo $desc; ?></td>
</tr>
<?php
$odd_row = !$odd_row;