1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: loc.tag,v 1.7 2007-03-30 23:40:57 pajamian Exp $
10 # [loc locale*] message [/loc]
12 # This tag is the equivalent of [L] ... [/L] localization, except
13 # it works with contained tags
15 UserTag loc Order locale
17 UserTag loc hasEndTag 1
18 UserTag loc Interpolate 1
19 UserTag loc Version $Revision: 1.7 $
20 UserTag loc Routine <<EOF
22 my ($locale, $message) = @_;
23 if($::Pragma->{no_locale_parse}) {
24 ## Need to do this but might have side-effects in PreFork mode
25 undef $Vend::Parse::myRefs{Alias}{l};
27 $begin .= " $locale" if $locale;
29 return $begin . $message . '[/L]';
31 return $message unless $Vend::Cfg->{Locale};
35 unless defined $Vend::Cfg->{Locale_repository}{$locale};
36 $ref = $Vend::Cfg->{Locale_repository}{$locale}
39 $ref = $Vend::Cfg->{Locale};
41 return defined $ref->{$message} ? $ref->{$message} : $message;