diff options
author | ivan <ivan> | 2002-04-07 05:56:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2002-04-07 05:56:09 +0000 |
commit | 44e3eff0aa6e7bdb7f4ecd9ee1ddf141e1b68af3 (patch) | |
tree | 6a636ec1d2984f18a97515ef54969c4c9a641e8c /httemplate/edit/msgcat.cgi | |
parent | fca110eff969104793774ed717985e91c53f5318 (diff) |
working message catalogs (not used for enough yet)
- almost (but not quite) closes Bug#385 - still have to catalog the
backend things triggered by signup server.
Diffstat (limited to 'httemplate/edit/msgcat.cgi')
-rwxr-xr-x | httemplate/edit/msgcat.cgi | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/httemplate/edit/msgcat.cgi b/httemplate/edit/msgcat.cgi new file mode 100755 index 000000000..5d256c05b --- /dev/null +++ b/httemplate/edit/msgcat.cgi @@ -0,0 +1,57 @@ +<!-- mason kludge --> +<% + +print header("Message catalog", menubar( +# 'Main Menu' => $p, +)), '<BR>'; + +print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !. $cgi->param('error') + if $cgi->param('error'); + +my $widget = new HTML::Widgets::SelectLayers( + 'selected_layer' => 'en_US', + 'options' => { 'en_US'=>'en_US' }, + 'form_action' => 'process/msgcat.cgi', + 'layer_callback' => sub { + my $layer = shift; + my $html = qq!<INPUT TYPE="hidden" NAME="locale" VALUE="$layer">!. + "<BR>Messages for locale $layer<BR>". table(). + "<TR><TH COLSPAN=2>Code</TH>". + "<TH>Message</TH>"; + $html .= "<TH>en_US Message</TH>" unless $layer eq 'en_US'; + $html .= '</TR>'; + + #foreach my $msgcat ( sort { $a->msgcode cmp $b->msgcode } + # qsearch('msgcat', { 'locale' => $layer } ) ) { + foreach my $msgcat ( qsearch('msgcat', { 'locale' => $layer } ) ) { + $html .= + '<TR><TD>'. $msgcat->msgnum. '</TD><TD>'. $msgcat->msgcode. '</TD>'. + '<TD><INPUT TYPE="text" SIZE=32 '. + qq! NAME="!. $msgcat->msgnum. '" '. + qq!VALUE="!. $msgcat->msg. qq!"></TD>!; + unless ( $layer eq 'en_US' ) { + my $en_msgcat = qsearchs('msgcat', { + 'locale' => 'en_US', + 'msgcode' => $msgcat->msgcode, + } ); + $html .= '<TD>'. $en_msgcat->msg. '</TD>'; + } + $html .= '</TR>'; + } + + $html .= '</TABLE><BR><INPUT TYPE="submit" VALUE="Apply changes">'; + + $html; + }, + +); + +print $widget->html; + +print <<END; + </TABLE> + </BODY> +</HTML> +END + +%> |