2 * Copyright (C) 2013 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 import Ubuntu.Components 1.3
19 import Ubuntu.Components.ListItems 1.3
20 import Ubuntu.SystemSettings.LanguagePlugin 1.0
22 import ".." as LocalComponents
24 LocalComponents.Page {
25 objectName: "languagePage"
28 forwardButtonSourceComponent: forwardButton
30 UbuntuLanguagePlugin {
41 anchors.left: parent.left
42 anchors.right: parent.right
44 text: i18n.tr("Welcome to your Ubuntu phone.")
49 anchors.left: parent.left
50 anchors.right: parent.right
52 text: i18n.tr("Let’s get started.")
57 width: units.gu(1) // needed else it will be ignored
62 objectName: "languageCombo"
63 anchors.left: parent.left
64 anchors.right: parent.right
65 text: listview.currentItem.text
66 onClicked: expanded = !expanded
67 expandedHeight: column.height - combo.y
70 model: plugin.languageNames
71 currentIndex: plugin.currentLanguage
73 objectName: "languageDelegate" + index
76 listview.currentIndex = index
77 combo.expanded = false
78 i18n.language = plugin.languageCodes[index]
87 LocalComponents.StackButton {
88 text: i18n.tr("Continue")
90 if (plugin.currentLanguage !== listview.currentIndex) {
91 plugin.currentLanguage = listview.currentIndex;
92 System.updateSessionLanguage(plugin.languageCodes[listview.currentIndex]);
93 i18n.language = i18n.language; // re-notify of change after above call (for qlocale change)