@@ -31,25 +31,6 @@ LocalComponents.Page {
3131 id: plugin
3232 }
3333
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")
37− init();
38− }
39− }
40−
41− Connections {
42− target: modemManager
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));
49− init();
50− }
51− }
52−
5334 function init()
5435 {
5536 var detectedLang = "";
@@ -61,7 +42,7 @@ LocalComponents.Page {
6142 detectedLang = simManager1.preferredLanguages[0] + "_" + LocalePlugin.mccToCountryCode(simManager1.mobileCountryCode);
6243 print("SIM 1 detected lang:", detectedLang);
6344 } 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)
6546 print("Using current language", detectedLang, "as default");
6647 } else {
6748 print("No lang detected, falling back to default (en_US)");
@@ -109,6 +90,7 @@ LocalComponents.Page {
10990 from: 1
11091 to: 0
11192 }
93+ onStopped: init();
11294 }
11395
11496 Column {
@@ -119,7 +101,6 @@ LocalComponents.Page {
119101 id: languagesListView
120102 boundsBehavior: Flickable.StopAtBounds
121103 clip: true
122− currentIndex: plugin.currentLanguage
123104 snapMode: ListView.SnapToItem
124105
125106 anchors {