* Add enclair_db option to UserDB.pm. Allows logging of enclair password
[interchange.git] / code / UI_Tag / mm_locale.coretag
1 # Copyright 2002-2007 Interchange Development Group and others
2
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.
7
8 # $Id: mm_locale.coretag,v 1.5 2007-03-30 23:40:54 pajamian Exp $
9
10 UserTag mm_locale Version $Revision: 1.5 $
11 UserTag mm_locale Routine <<EOR
12 sub {
13         my $locale = $Values->{ui_locale} || $Tag->var('UI_LOCALE', 2);
14         my $lref;
15
16         # tell Shadow database to return the unmangled database records
17         $Tag->tmp('mv_shadowpass', 1);
18
19         # first delete locale settings from catalog
20         $Vend::Cfg->{Locale_repository} = {};
21
22         if ($locale && exists $Global::Locale_repository->{$locale}) {
23                 $lref = $Vend::Cfg->{Locale_repository}{"$locale"} 
24                         = $Global::Locale_repository->{$locale};
25                 $Tag->setlocale("$locale");
26                 $Tag->tmp('mv_locale', $locale);
27                 if ($lref->{MV_LANG_DIRECTION}) {
28                         $Tag->tmp('ui_language_direction', qq{ dir="$lref->{MV_LANG_DIRECTION}"});
29                 }
30         }       
31         1;
32 }
33 EOR