add: i18n for more Gallery templates

add: International macro now takes sprintf arguments as third and subsequent parameters
add: Keywords are now processed and given to the photo template, along with a url to search the gallery for the keyword. 
add: Photos now track views
This commit is contained in:
Doug Bell 2008-02-12 00:55:06 +00:00
parent 6c72ee9a41
commit fa156af1a9
7 changed files with 265 additions and 5 deletions

View file

@ -21,7 +21,7 @@ Package WebGUI::Macro::International
Macro for displaying an internationalized label from WebGUI's internationalization system.
=head2 process ( label, namespace )
=head2 process ( label, namespace [, placeholder values] )
Note that a particular language cannot be specified. It uses either the
current User's setting or the default language for the site. English is
@ -35,14 +35,28 @@ The label to pull.
The namespace to pull the label from.
=head3 placeholder values
The values to be used in the field placeholders.
=cut
#-------------------------------------------------------------------
sub process {
my ($session, $key, $namespace) = @_;
my $session = shift;
my $key = shift;
my $namespace = shift;
my @args = @_;
my $i18n = WebGUI::International->new($session);
return $i18n->get($key, $namespace);
if (@args) {
return sprintf $i18n->get($key, $namespace), @args;
}
else {
return $i18n->get($key, $namespace);
}
}