Set default launguage for display name of account
authorSoyoung Kim <sy037.kim@samsung.com>
Tue, 8 Oct 2013 12:04:56 +0000 (21:04 +0900)
committerSoo-Hyun Choi <sh9.choi@samsung.com>
Wed, 9 Oct 2013 07:27:31 +0000 (16:27 +0900)
[Issue#]   N_SE-54261
[Problem]  The default language in account menu is not showing in Settings.
[Cause]    The default language is not specified in the manifest file.
[Solution] - If there is "en-gb" in display name of account, installer set
             "en-gb" as default language.
           - If there is not "en-gb" in display name, installer set the first
             value from display name as defalt language.

[Verification] Install the attached widget.
https://bugs.tizendev.org/jira/secure/attachment/164604/Emptyui.zip

[SCMRequest] N/A

Change-Id: I438ec0cd6fb16da9fd182138853bbeef63ccbd30

src/jobs/widget_install/manifest.cpp

index 977f58e..1e02cfa 100644 (file)
@@ -22,6 +22,7 @@
 #include "libxml_utils.h"
 #include <widget_install/task_manifest_file.h>
 #include <dpl/foreach.h>
+#include <installer_log.h>
 
 namespace Jobs {
 namespace WidgetInstall {
@@ -471,12 +472,22 @@ void Account::serialize(xmlTextWriterPtr writer)
             writeText(writer, i->second);
             endElement(writer);
         }
+
+        bool setDefaultLang = false;
         FOREACH(n, this->provider.name)
         {
+            if (!setDefaultLang && n->getLang() == L"en-gb") {
+                writeElement(writer, "label", n->getString());
+                setDefaultLang = true;
+            }
             writeElementWithOneAttribute(writer, "label",
                     n->getString(), "xml:lang",
                     n->getLang(), n->hasLang());
         }
+        if (!setDefaultLang) {
+            writeElement(writer, "label", this->provider.name.begin()->getString());
+        }
+
         FOREACH(c, this->provider.capability)
         {
             startElement(writer, "capability");