summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/qml/qmlengine.cpp2
-rw-r--r--tests/auto/declarative/qmllanguage/data/I18n.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml5
-rw-r--r--tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml2
-rw-r--r--tests/auto/declarative/qmllanguage/data/i18nScript.qml8
-rw-r--r--tests/auto/declarative/qmllanguage/data/i18nStrings.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/data/i18nType.qml6
-rw-r--r--tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp26
9 files changed, 44 insertions, 23 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 245ddc0..ef0f975 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -1106,7 +1106,7 @@ public:
}
}
if (url_return) {
- *url_return = base.resolved(QUrl(QLatin1String(type + ".qml")));
+ *url_return = base.resolved(QUrl(QString::fromUtf8(type + ".qml")));
return true;
} else {
return false;
diff --git a/tests/auto/declarative/qmllanguage/data/I18n.qml b/tests/auto/declarative/qmllanguage/data/I18n.qml
index dbbd4bd..558c836 100644
--- a/tests/auto/declarative/qmllanguage/data/I18n.qml
+++ b/tests/auto/declarative/qmllanguage/data/I18n.qml
@@ -1,6 +1,6 @@
-import Qt 4.6
+import Test 1.0
-Text {
+MyTypeObject {
property int áâãäå: 10
- text: "Test áâãäå: " + áâãäå
+ stringProperty: "Test áâãäå: " + áâãäå
}
diff --git a/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml b/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml
index 6a841d1..42dbc69 100644
--- a/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml
+++ b/tests/auto/declarative/qmllanguage/data/I18nÁâãäå.qml
@@ -1,4 +1,5 @@
-import Qt 4.6
+import Test 1.0
-Text {
+MyTypeObject {
+ stringProperty: "Test áâãäå: 30"
}
diff --git a/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml
index dbbd4bd..558c836 100644
--- a/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml
+++ b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyNames.qml
@@ -1,6 +1,6 @@
-import Qt 4.6
+import Test 1.0
-Text {
+MyTypeObject {
property int áâãäå: 10
- text: "Test áâãäå: " + áâãäå
+ stringProperty: "Test áâãäå: " + áâãäå
}
diff --git a/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml
index 240d7c1..74918e2 100644
--- a/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml
+++ b/tests/auto/declarative/qmllanguage/data/i18nDeclaredPropertyUse.qml
@@ -1,5 +1,3 @@
-import Qt 4.6
-
I18n {
áâãäå: 15
}
diff --git a/tests/auto/declarative/qmllanguage/data/i18nScript.qml b/tests/auto/declarative/qmllanguage/data/i18nScript.qml
index 6d07b03..942ed90 100644
--- a/tests/auto/declarative/qmllanguage/data/i18nScript.qml
+++ b/tests/auto/declarative/qmllanguage/data/i18nScript.qml
@@ -1,12 +1,12 @@
-import Qt 4.6
+import Test 1.0
-Text {
+MyTypeObject {
Script {
function val() {
- var áâãäå = 10
+ var áâãäå = 20
return "Test áâãäå: " + áâãäå
}
}
- text: val()
+ stringProperty: val()
}
diff --git a/tests/auto/declarative/qmllanguage/data/i18nStrings.qml b/tests/auto/declarative/qmllanguage/data/i18nStrings.qml
index 062191f..764c926 100644
--- a/tests/auto/declarative/qmllanguage/data/i18nStrings.qml
+++ b/tests/auto/declarative/qmllanguage/data/i18nStrings.qml
@@ -1,5 +1,5 @@
-import Qt 4.6
+import Test 1.0
-Text {
- text: "Test áâãäå (5 accented 'a' letters)"
+MyTypeObject {
+ stringProperty: "Test áâãäå (5 accented 'a' letters)"
}
diff --git a/tests/auto/declarative/qmllanguage/data/i18nType.qml b/tests/auto/declarative/qmllanguage/data/i18nType.qml
index 1a73096..11ef895 100644
--- a/tests/auto/declarative/qmllanguage/data/i18nType.qml
+++ b/tests/auto/declarative/qmllanguage/data/i18nType.qml
@@ -1,5 +1 @@
-import Qt 4.6
-
-I18nÁâãäå {
- text: "TEST"
-}
+I18nÁâãäå { }
diff --git a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
index a991144..cf42792 100644
--- a/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
+++ b/tests/auto/declarative/qmllanguage/tst_qmllanguage.cpp
@@ -58,6 +58,8 @@ private slots:
void cppnamespace();
void aliasProperties();
void componentCompositeType();
+ void i18n();
+ void i18n_data();
void importsBuiltin_data();
void importsBuiltin();
@@ -679,6 +681,30 @@ public:
TestType2(QObject *p=0) : QObject(p) {}
};
+void tst_qmllanguage::i18n_data()
+{
+ QTest::addColumn<QString>("file");
+ QTest::addColumn<QString>("stringProperty");
+ QTest::newRow("i18nStrings") << "i18nStrings.qml" << QString::fromUtf8("Test áâãäå (5 accented 'a' letters)");
+ QTest::newRow("i18nDeclaredPropertyNames") << "i18nDeclaredPropertyNames.qml" << QString::fromUtf8("Test áâãäå: 10");
+ QTest::newRow("i18nDeclaredPropertyUse") << "i18nDeclaredPropertyUse.qml" << QString::fromUtf8("Test áâãäå: 15");
+ QTest::newRow("i18nScript") << "i18nScript.qml" << QString::fromUtf8("Test áâãäå: 20");
+ QTest::newRow("i18nType") << "i18nType.qml" << QString::fromUtf8("Test áâãäå: 30");
+}
+
+void tst_qmllanguage::i18n()
+{
+ QFETCH(QString, file);
+ QFETCH(QString, stringProperty);
+ QmlComponent component(&engine, TEST_FILE(file));
+ VERIFY_ERRORS(0);
+ MyTypeObject *object = qobject_cast<MyTypeObject *>(component.create());
+ QVERIFY(object != 0);
+ QCOMPARE(object->stringProperty(), stringProperty);
+
+ delete object;
+}
+
// Check that first child of qml is of given type. Empty type insists on error.
void tst_qmllanguage::testType(const QString& qml, const QString& type)
{