diff --git a/autotests/propertyinfotest.cpp b/autotests/propertyinfotest.cpp --- a/autotests/propertyinfotest.cpp +++ b/autotests/propertyinfotest.cpp @@ -56,9 +56,9 @@ PropertyInfo title(Property::Title); QCOMPARE(title.formatAsDisplayString(QVariant(QStringLiteral("Title"))), QStringLiteral("Title")); - QStringList artistList = {QStringLiteral("Artist1"), QStringLiteral("Artist2")}; + QStringList artistList = {QStringLiteral("Artist1"), QStringLiteral("Artist2"), QStringLiteral("Artist3")}; PropertyInfo artist(Property::Artist); - QCOMPARE(artist.formatAsDisplayString(QVariant(artistList)), QStringLiteral("Artist1, Artist2")); + QCOMPARE(artist.formatAsDisplayString(QVariant(artistList)), QStringLiteral("Artist1, Artist2, and Artist3")); QStringList authorList = {QStringLiteral("Author1")}; PropertyInfo author(Property::Author); diff --git a/src/formatstrings.cpp b/src/formatstrings.cpp --- a/src/formatstrings.cpp +++ b/src/formatstrings.cpp @@ -42,7 +42,7 @@ QString FormatStrings::joinStringListFunction(const QVariant& value) { - return value.toStringList().join(i18nc("Separation between multiple entries in a list", ", ")); + return QLocale().createSeparatedList(value.toStringList()); } QString FormatStrings::formatDate(const QVariant& value)