messagingapp/shareui/src/shareuiprivate.cpp
changeset 70 a15d9966050f
parent 52 12db4185673b
--- a/messagingapp/shareui/src/shareuiprivate.cpp	Thu Sep 02 20:23:03 2010 +0300
+++ b/messagingapp/shareui/src/shareuiprivate.cpp	Fri Sep 17 08:28:39 2010 +0300
@@ -23,6 +23,9 @@
 #include <QStringList>
 #include <QGraphicsLinearLayout>
 
+#include <QTranslator>
+#include <QLocale>
+#include <hbapplication.h>
 #include <HbAction>
 #include <HbDialog>
 #include <HbLabel>
@@ -39,20 +42,12 @@
 // USER INCLUDES
 #include "shareuiprivate.h"
 
-// Localized Constants
-//#define LOC_SEND_SELECTED_ITEM  hbTrId("txt_shareui_send_selected_item")
-//#define LOC_BUTTON_CANCEL       hbTrId("txt_shareui_button_cancel")
-//#define LOC_NO_SERVICES         hbTrId("txt_shareui_no_services")
-//#define LOC_NO_FILES            hbTrId("txt_shareui_no_files")
-//#define LOC_SERVICE_ERROR       hbTrId("txt_shareui_service_error")
-//#define LOC_PROTECTED_CONTENT   hbTrId("txt_shareui_protected_content")
-
-#define LOC_SEND_SELECTED_ITEM  hbTrId("Send selected item")
-#define LOC_BUTTON_CANCEL       hbTrId("Cancel")
-#define LOC_NO_SERVICES         hbTrId("No services found.")
-#define LOC_NO_FILES            hbTrId("No files found.")
-#define LOC_SERVICE_ERROR       hbTrId("Service error.")
-#define LOC_PROTECTED_CONTENT   hbTrId("Protected content.")
+#define LOC_TITLE_SHARING_METHODS  hbTrId("txt_share_title_sharing_methods")
+#define LOC_BUTTON_CANCEL       hbTrId("txt_common_button_cancel")
+#define LOC_NO_SERVICES         hbTrId("txt_shareui_no_services ")
+#define LOC_SERVICE_ERROR       hbTrId("txt_shareui_service_error")
+#define LOC_PROTECTED_CONTENT   hbTrId("txt_shareui_protected_content")
+#define LOC_NO_FILES            hbTrId("txt_shareui_no_files")
 
 const QString LIST_ITEM_TITLE("qtc_list_item_title_normal");
 
@@ -64,6 +59,18 @@
     mContentItemModel = 0;
     mContentListView = 0;
     mSharePopup = 0;
+    
+    QString locale = QLocale::system().name();
+    QString path = "z:/resource/qt/translations/";
+        
+    mTranslator = new QTranslator();
+    mTranslator_comm = new QTranslator();
+    
+    bool result = mTranslator->load(path + QString("share_") + locale);
+    result = mTranslator_comm->load(path + QString("common_") + locale);
+    qApp->installTranslator(mTranslator);
+    qApp->installTranslator(mTranslator_comm);
+    
     }
 
 /**
@@ -71,6 +78,8 @@
  */
 ShareUiPrivate::~ShareUiPrivate()
     {
+    delete mTranslator;
+    delete mTranslator_comm;
     }
 
 /**
@@ -205,7 +214,7 @@
     mSharePopup = new HbDialog();
     // make it delete itself on close
     mSharePopup->setAttribute( Qt::WA_DeleteOnClose, true );
-    HbTextItem* heading = new HbTextItem(LOC_SEND_SELECTED_ITEM, mSharePopup);
+    HbTextItem* heading = new HbTextItem(LOC_TITLE_SHARING_METHODS, mSharePopup);
     QColor color = HbColorScheme::color( LIST_ITEM_TITLE );
     heading->setTextColor( color );
     heading->setAlignment(Qt::AlignCenter);