39 QString path = "z:/resource/qt/translations/"; |
39 QString path = "z:/resource/qt/translations/"; |
40 //Load common translator |
40 //Load common translator |
41 QTranslator commontranslator; |
41 QTranslator commontranslator; |
42 bool returncode = false; |
42 bool returncode = false; |
43 LOGS_QDEBUG("logs [UI] loading common strings translator"); |
43 LOGS_QDEBUG("logs [UI] loading common strings translator"); |
44 returncode = commontranslator.load( path + "common_" + lang + ".qm"); |
44 returncode = commontranslator.load( path + "common_" + lang); |
45 if (returncode==false) { |
45 if (returncode==false) { |
46 LOGS_QDEBUG("logs [UI] unable to open file: " + path + "common_" + lang + ".qm"); |
46 LOGS_QDEBUG("logs [UI] unable to open file: " + path + "common_" + lang); |
47 } else { |
47 } else { |
48 app.installTranslator(&commontranslator); |
48 app.installTranslator(&commontranslator); |
49 } |
49 } |
50 |
50 |
51 //Load application-specific translator |
51 //Load application-specific translator |
52 QTranslator translator; |
52 QTranslator translator; |
53 LOGS_QDEBUG("logs [UI] loading application strings translator"); |
53 LOGS_QDEBUG("logs [UI] loading application strings translator"); |
54 LOGS_QDEBUG("logs [UI] translation filename dialer_" + lang + ".qm"); |
54 LOGS_QDEBUG("logs [UI] translation filename dialer_" + lang); |
55 returncode = translator.load( path + "dialer_" + lang + ".qm"); |
55 returncode = translator.load( path + "dialer_" + lang); |
56 if (returncode==false) { |
56 if (returncode==false) { |
57 LOGS_QDEBUG("logs [UI] .qm file not found from "+path); |
57 LOGS_QDEBUG( "logs [UI] .qm file not found from " + path); |
58 path = ":/"; |
|
59 returncode = translator.load( path + "logs_default.qm"); |
|
60 LOGS_QDEBUG("logs [UI]: fallback to default language file logs_default.qm"); |
|
61 } |
|
62 |
|
63 if (returncode==false) { |
|
64 LOGS_QDEBUG( "logs [UI] .qm file not found from "+path); |
|
65 } else { |
58 } else { |
66 LOGS_QDEBUG( "logs [UI] .qm loaded successfully from "+path); |
59 LOGS_QDEBUG( "logs [UI] .qm loaded successfully from " + path); |
|
60 app.installTranslator(&translator); |
67 } |
61 } |
68 |
62 |
69 app.installTranslator(&translator); |
|
70 HbStyleLoader::registerFilePath(":/logslayouts"); |
63 HbStyleLoader::registerFilePath(":/logslayouts"); |
71 |
64 |
72 // Create service handler asap so that services are published fast. |
65 // Create service handler asap so that services are published fast. |
73 // Servicehandler cannot be created before HbApplication creation. |
66 // Servicehandler cannot be created before HbApplication creation. |
74 // This can cause problem of service request not coming through if |
67 // This can cause problem of service request not coming through if |