From ec7f7a7d9e44afcefcdaa7d3b5fed109fe24afe7 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 22 Apr 2005 01:56:39 +0000 Subject: [PATCH] fix for CGI based translator --- .../i18n/English/Automated_Information.pm | 38 +++++++++++++++++ lib/WebGUI/i18n/English/Macros.pm | 42 ++----------------- 2 files changed, 42 insertions(+), 38 deletions(-) create mode 100644 lib/WebGUI/i18n/English/Automated_Information.pm diff --git a/lib/WebGUI/i18n/English/Automated_Information.pm b/lib/WebGUI/i18n/English/Automated_Information.pm new file mode 100644 index 000000000..3fb42d475 --- /dev/null +++ b/lib/WebGUI/i18n/English/Automated_Information.pm @@ -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 '', '', $_, '', + ($macros{$_} ? ('^', $macros{$_}, '();') : ' '), + '' } + @macros; + +$macro_table = + join("\n", + '', + '',$macro_table,'
',WebGUI::International::get('macro name', 'Macros'), + '', + WebGUI::International::get('macro shortcut', 'Macros'), + '
'); + +our $I18N = { + 'macro table' => { + message => $macro_table, + lastUpdated => 1112466408, + } +}; +1; diff --git a/lib/WebGUI/i18n/English/Macros.pm b/lib/WebGUI/i18n/English/Macros.pm index 6dae1a662..2f4ff0631 100644 --- a/lib/WebGUI/i18n/English/Macros.pm +++ b/lib/WebGUI/i18n/English/Macros.pm @@ -1,8 +1,5 @@ package WebGUI::i18n::English::Macros; -use WebGUI::Session; -use WebGUI::International; - our $I18N = { 'macro name' => { @@ -15,48 +12,17 @@ our $I18N = { lastUpdated => 1112591289 }, -}; - -##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 '', '', $_, '', - ($macros{$_} ? ('^', $macros{$_}, '();') : ' '), - '' } - @macros; - -$macro_table = - join("\n", - '', - '',$macro_table,'
',WebGUI::International::get('macro name', 'Macros'), - '', - WebGUI::International::get('macro shortcut', 'Macros'), - '
'); - - -$I18N = { - - %{ $I18N }, - 'macros list title' => { message => q|Macros, List of Available|, lastUpdated => 1112395935, }, 'macros list body' => { - message => q|

The set of available Macros is defined in the WebGUI configuration file. These Macros are available for use on your site:

|.$macro_table, + message => q|

The set of available Macros is defined in the WebGUI configuration file. These Macros are available for use on your site:

+^International("macro table","Automated_Information"); +|, context => 'Content for dynamically generated macro list', - lastUpdated => 1112560683, + lastUpdated => 1114134745, }, 'macro enabled' => {