Changeset View
Changeset View
Standalone View
Standalone View
autotests/klocalizedstringtest.cpp
Show First 20 Lines • Show All 117 Lines • ▼ Show 20 Line(s) | 115 | if (process.exitCode() != 0) { | |||
---|---|---|---|---|---|
118 | return false; | 118 | return false; | ||
119 | } | 119 | } | ||
120 | } | 120 | } | ||
121 | return true; | 121 | return true; | ||
122 | } | 122 | } | ||
123 | 123 | | |||
124 | void KLocalizedStringTest::correctSubs() | 124 | void KLocalizedStringTest::correctSubs() | ||
125 | { | 125 | { | ||
126 | if (!m_hasFrench) { | ||||
127 | QSKIP("French test files not usable."); | ||||
128 | } | ||||
126 | // Warm up. | 129 | // Warm up. | ||
127 | QCOMPARE(i18n("Daisies, daisies"), | 130 | QCOMPARE(i18n("Daisies, daisies"), | ||
128 | QString("Daisies, daisies")); | 131 | QString("Daisies, daisies")); | ||
129 | 132 | | |||
130 | // Placeholder in the middle. | 133 | // Placeholder in the middle. | ||
131 | QCOMPARE(i18n("Fault in %1 unit", QString("AE35")), | 134 | QCOMPARE(i18n("Fault in %1 unit", QString("AE35")), | ||
132 | QString("Fault in AE35 unit")); | 135 | QString("Fault in AE35 unit")); | ||
133 | // Placeholder at the start. | 136 | // Placeholder at the start. | ||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | |||||
214 | // Number formatting. | 217 | // Number formatting. | ||
215 | QCOMPARE(ki18n("%1").subs(42).toString(), | 218 | QCOMPARE(ki18n("%1").subs(42).toString(), | ||
216 | QString("42")); | 219 | QString("42")); | ||
217 | QCOMPARE(ki18n("%1").subs(42, 5).toString(), | 220 | QCOMPARE(ki18n("%1").subs(42, 5).toString(), | ||
218 | QString(" 42")); | 221 | QString(" 42")); | ||
219 | QCOMPARE(ki18n("%1").subs(42, -5, 10, QChar('_')).toString(), | 222 | QCOMPARE(ki18n("%1").subs(42, -5, 10, QChar('_')).toString(), | ||
220 | QString("42___")); | 223 | QString("42___")); | ||
221 | QCOMPARE(ki18n("%1").subs(4.2, 5, 'f', 2).toString(), | 224 | QCOMPARE(ki18n("%1").subs(4.2, 5, 'f', 2).toString(), | ||
222 | QString(" 4.20")); | 225 | QString(" 4,20")); | ||
ilic: The French locale is already being set in line 45 using setlocale, for which the system has to… | |||||
223 | } | 226 | } | ||
224 | 227 | | |||
225 | void KLocalizedStringTest::wrongSubs() | 228 | void KLocalizedStringTest::wrongSubs() | ||
226 | { | 229 | { | ||
The tests work with French locale, there is no reason introduce English here only. It also clobbers the globaly set locale elements in initTestCase. ilic: The tests work with French locale, there is no reason introduce English here only. It also… | |||||
227 | #ifndef NDEBUG | 230 | #ifndef NDEBUG | ||
228 | // Too many arguments. | 231 | // Too many arguments. | ||
229 | QVERIFY(i18n("Europa", 1) | 232 | QVERIFY(i18n("Europa", 1) | ||
230 | != QString("Europa")); | 233 | != QString("Europa")); | ||
231 | 234 | | |||
232 | // Too few arguments. | 235 | // Too few arguments. | ||
233 | QVERIFY(i18n("%1, %2 and %3", QString("Hunter"), QString("Kimball")) | 236 | QVERIFY(i18n("%1, %2 and %3", QString("Hunter"), QString("Kimball")) | ||
234 | != QString("Hunter, Kimball and %3")); | 237 | != QString("Hunter, Kimball and %3")); | ||
▲ Show 20 Lines • Show All 353 Lines • Show Last 20 Lines |
The French locale is already being set in line 45 using setlocale, for which the system has to have fr_FR.utf8 glibc locale installed. Any further setting up of locale details, if needed, should happen in lines 70-76, which are currently commented out with "until locale system is ready" (and if not needed, this whole commented out part should be deleted).