From a7043964bbd6ecd6bf2ee8c0081c61b4ed0de910 Mon Sep 17 00:00:00 2001
From: Hadi Nategh <hn@stylite.de>
Date: Wed, 3 Jun 2015 13:24:51 +0000
Subject: [PATCH] Fix translation and appIcon issue in mail integration

---
 mail/inc/class.mail_integration.inc.php | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/mail/inc/class.mail_integration.inc.php b/mail/inc/class.mail_integration.inc.php
index c843fda877..269d644668 100644
--- a/mail/inc/class.mail_integration.inc.php
+++ b/mail/inc/class.mail_integration.inc.php
@@ -76,15 +76,14 @@ class mail_integration {
 			$time = time();
 			$_date = egw_time::server2user($time->now,'ts');
 		}
-
+		$GLOBALS['egw_info']['flags']['currentapp'] = $app;
+		
 		// Integrate not yet saved mail
 		if (empty($_GET['rowid']) && $_to_emailAddress && $app)
 		{
 			$sessionLocation = 'mail';
 			$mailbox = base64_decode($_GET['mailbox']);
 
-			$GLOBALS['egw_info']['flags']['currentapp'] = $app;
-
 			if (!($GLOBALS['egw_info']['user']['preferences'][$sessionLocation]['saveAsOptions']==='text_only')&&is_array($_attachments))
 			{
 				// initialize mail open connection requirements
@@ -283,7 +282,11 @@ class mail_integration {
 		
 		// Get the registered hook method of requested app for integration
 		$hook = $GLOBALS['egw']->hooks->single(array('location' => 'mail_import'),$app);
-
+		
+		// Load translation for the app since the original URL
+		// is from mail integration and only loads mail translation
+		translation::add_app($app);
+		
 		// Execute import mail with provided content
 		ExecMethod($hook['menuaction'],array (
 			'addresses' => $data_addresses,