diff options
author | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-11-11 12:13:50 +0000 |
commit | c582e92888b4a5553e1b4e5214cf35217e4a0cf0 (patch) | |
tree | 3fe7cd7bf22bd356b478f0de0dd8f0b140fcee23 /rt/lib/RT/CurrentUser.pm | |
parent | 289340780927b5bac2c7604d7317c3063c6dd8cc (diff) |
import rt 3.0.12
Diffstat (limited to 'rt/lib/RT/CurrentUser.pm')
-rwxr-xr-x | rt/lib/RT/CurrentUser.pm | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/rt/lib/RT/CurrentUser.pm b/rt/lib/RT/CurrentUser.pm index 7fcc65ce3..abaf87608 100755 --- a/rt/lib/RT/CurrentUser.pm +++ b/rt/lib/RT/CurrentUser.pm @@ -241,9 +241,9 @@ sub Load { $self->SUPER::LoadById($identifier); } - elsif (UNIVERSAL::isa($identifier,"RT::User")) { - # DWIM if they pass a user in - $self->SUPER::LoadById($identifier->Id); + elsif (UNIVERSAL::isa($identifier,"RT::User")) { + # DWIM if they pass a user in + $self->SUPER::LoadById($identifier->Id); } else { # This is a bit dangerous, we might get false authen if somebody @@ -330,19 +330,24 @@ ok ($cu->loc('Before') eq "Avant", "Localized TEST_STRING into Frenc"); sub LanguageHandle { my $self = shift; - if ((!defined $self->{'LangHandle'}) || - (!UNIVERSAL::can($self->{'LangHandle'}, 'maketext')) || - (@_)) { - if ( $self->Lang) { - push @_, $self->Lang; - } + if ( ( !defined $self->{'LangHandle'} ) + || ( !UNIVERSAL::can( $self->{'LangHandle'}, 'maketext' ) ) + || (@_) ) { + if ( (!$RT::SystemUser || $self->id == $RT::SystemUser->id() )) { + @_ = qw(en-US); + } + + elsif ( $self->Lang ) { + push @_, $self->Lang; + } $self->{'LangHandle'} = RT::I18N->get_handle(@_); } + # Fall back to english. - unless ($self->{'LangHandle'}) { + unless ( $self->{'LangHandle'} ) { die "We couldn't get a dictionary. Nye mogu naidti slovar. No puedo encontrar dictionario."; } - return ($self->{'LangHandle'}); + return ( $self->{'LangHandle'} ); } sub loc { |