>From 2d4613244c0f2f860d5e8d3ba74139e2176aafa7 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Gon=C3=A9ri=20Le=20Bouder?= <goneri.lebouder@atosorigin.com>
Date: Wed, 19 Nov 2008 13:05:13 +0100
Subject: [PATCH] Translate OTRS_TICKET_* in mail notification

---
 Kernel/System/Ticket/Article.pm |   30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/Kernel/System/Ticket/Article.pm b/Kernel/System/Ticket/Article.pm
index bf6a6c8..dcf5a37 100644
--- a/Kernel/System/Ticket/Article.pm
+++ b/Kernel/System/Ticket/Article.pm
@@ -2063,6 +2063,16 @@ sub SendAgentNotification {
 
     # get current user data
     my %CurrentUser = $Self->{UserObject}->GetUserData( UserID => $Param{UserID} );
+
+    my $LanguageObject = Kernel::Language->new(
+        UserTimeZone => $Self->{UserTimeZone},
+        UserLanguage => $CurrentUser{UserLanguage},
+        LogObject    => $Self->{LogObject},
+        ConfigObject => $Self->{ConfigObject},
+        MainObject   => $Self->{MainObject},
+        Action       => $Self->{Action},
+    );
+
     for ( keys %CurrentUser ) {
         if ( $CurrentUser{$_} ) {
             $Notification{Body}    =~ s/<OTRS_CURRENT_$_>/$CurrentUser{$_}/gi;
@@ -2086,8 +2096,9 @@ sub SendAgentNotification {
     my %Ticket = $Self->TicketGet( TicketID => $Param{TicketID} );
     for ( keys %Ticket ) {
         if ( defined $Ticket{$_} ) {
-            $Notification{Body}    =~ s/<OTRS_TICKET_$_>/$Ticket{$_}/gi;
-            $Notification{Subject} =~ s/<OTRS_TICKET_$_>/$Ticket{$_}/gi;
+            my $TranslatedStrg = $LanguageObject->Get($Ticket{$_});
+            $Notification{Body}    =~ s/<OTRS_TICKET_$_>/$TranslatedStrg/gi;
+            $Notification{Subject} =~ s/<OTRS_TICKET_$_>/$TranslatedStrg/gi;
         }
     }
 
@@ -2299,6 +2310,16 @@ sub SendCustomerNotification {
         }
     }
 
+    my $LanguageObject = Kernel::Language->new(
+        UserTimeZone => $Self->{UserTimeZone},
+        UserLanguage => $Language,
+        LogObject    => $Self->{LogObject},
+        ConfigObject => $Self->{ConfigObject},
+        MainObject   => $Self->{MainObject},
+        Action       => $Self->{Action},
+    );
+
+
     # check recipients
     if ( !$Article{From} || $Article{From} !~ /@/ ) {
         return;
@@ -2351,8 +2372,9 @@ sub SendCustomerNotification {
     my %Ticket = $Self->TicketGet( TicketID => $Param{TicketID} );
     for ( keys %Ticket ) {
         if ( defined $Ticket{$_} ) {
-            $Notification{Body}    =~ s/<OTRS_TICKET_$_>/$Ticket{$_}/gi;
-            $Notification{Subject} =~ s/<OTRS_TICKET_$_>/$Ticket{$_}/gi;
+            my $TranslatedStrg = $LanguageObject->Get($Ticket{$_});
+            $Notification{Body}    =~ s/<OTRS_TICKET_$_>/$TranslatedStrg/gi;
+            $Notification{Subject} =~ s/<OTRS_TICKET_$_>/$TranslatedStrg/gi;
         }
     }
 
-- 
1.5.5.1

