@@ -31,25 +31,6 @@ LocalComponents.Page {
31 id: plugin
31 id: plugin
34− Component.onCompleted: {
35− if (!modemManager.available) { // don't wait for the modem if it's not there
36− print("== Modem manager not available, init language manually")
43− onGotSimCardChanged: {
44− print("== Got a usable SIM card, init language page");
45−// print("SIM 1 languages:", simManager0.preferredLanguages);
46−// print("SIM 1 country:", LocalePlugin.mccToCountryCode(simManager0.mobileCountryCode));
47−// print("SIM 2 languages:", simManager1.preferredLanguages);
48−// print("SIM 2 country:", LocalePlugin.mccToCountryCode(simManager1.mobileCountryCode));
53 function init()
34 function init()
55 var detectedLang = "";
36 var detectedLang = "";
@@ -61,7 +42,7 @@ LocalComponents.Page {
61 detectedLang = simManager1.preferredLanguages[0] + "_" + LocalePlugin.mccToCountryCode(simManager1.mobileCountryCode);
42 detectedLang = simManager1.preferredLanguages[0] + "_" + LocalePlugin.mccToCountryCode(simManager1.mobileCountryCode);
62 print("SIM 1 detected lang:", detectedLang);
43 print("SIM 1 detected lang:", detectedLang);
63 } else if (plugin.currentLanguage != -1) {
44 } else if (plugin.currentLanguage != -1) {
64− detectedLang = plugin.languageCodes[plugin.currentLanguage];
45+ detectedLang = plugin.languageCodes[plugin.currentLanguage].split(".")[0]; // remove the encoding part, after dot (en_US.utf8 -> en_US)
65 print("Using current language", detectedLang, "as default");
46 print("Using current language", detectedLang, "as default");
67 print("No lang detected, falling back to default (en_US)");
48 print("No lang detected, falling back to default (en_US)");
@@ -109,6 +90,7 @@ LocalComponents.Page {
@@ -119,7 +101,6 @@ LocalComponents.Page {
119 id: languagesListView
101 id: languagesListView
120 boundsBehavior: Flickable.StopAtBounds
102 boundsBehavior: Flickable.StopAtBounds
121 clip: true
103 clip: true
122− currentIndex: plugin.currentLanguage
123 snapMode: ListView.SnapToItem
104 snapMode: ListView.SnapToItem
125 anchors {
106 anchors {