fix for CGI based translator

This commit is contained in:
Colin Kuskie 2005-04-22 01:56:39 +00:00
parent 6458873c02
commit ec7f7a7d9e
2 changed files with 42 additions and 38 deletions

View file

@ -0,0 +1,38 @@
package WebGUI::i18n::English::Automated_Information;
use WebGUI::Session;
use WebGUI::International;
##Get list of all macros by namespace/module name
my $dir = join $session{os}{slash}, $session{config}{webguiRoot},"lib","WebGUI","Macro";
opendir (DIR,$dir) or WebGUI::ErrorHandler::fatal("Can't open Macro directory: $dir!");
my @macros = map { s/Macro_//; s/\.pm//; $_; }
grep { /\.pm$/ }
readdir(DIR); ##list of namespaces
closedir(DIR);
##Build list of enabled macros, by namespace by reversing session hash:
my %macros = reverse %{ $session{config}{macros} };
$macro_table =
join "\n",
map { join '', '<tr><td>', $_, '</td><td>',
($macros{$_} ? ('&#94;', $macros{$_}, '();') : '&nbsp;'),
'</td></tr>' }
@macros;
$macro_table =
join("\n",
'<table border="1" cellpadding="3">',
'<tr><th>',WebGUI::International::get('macro name', 'Macros'),
'</th><th>',
WebGUI::International::get('macro shortcut', 'Macros'),
'</th></tr>',$macro_table,'</table>');
our $I18N = {
'macro table' => {
message => $macro_table,
lastUpdated => 1112466408,
}
};
1;