From 7262d11f4710bac339005c2da20cee499caff659 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Tue, 2 Apr 2024 09:50:20 +0200 Subject: [PATCH] invalid item name warning: use file or folder when appropriate Signed-off-by: Matthieu Gallien --- src/libsync/discovery.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 964b0ee74154d..26ba91adb7d72 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -355,12 +355,13 @@ bool ProcessDirectoryJob::handleExcluded(const QString &path, const Entries &ent break; } } + const auto itemTypeName = (isDirectory ? tr("Folder", "name of folder entity to use when warning about invalid name") : tr("File", "name of folder entity to use when warning about invalid name")); if (invalid) { - item->_errorString = tr("File names containing the character \"%1\" are not supported on this file system.").arg(QLatin1Char(invalid)); + item->_errorString = tr("%1 name containing the character \"%2\" is not supported on this file system.", "folder or file impossible to sync due to an invalid name, placeholders will be file or folder and the invalid character").arg(itemTypeName, QChar(invalid)); } else if (isInvalidPattern) { - item->_errorString = tr("File name contains at least one invalid character"); + item->_errorString = tr("%1 name contains at least one invalid character").arg(itemTypeName); } else { - item->_errorString = tr("The file name is a reserved name on this file system."); + item->_errorString = tr("%1 name is a reserved name on this file system.").arg(itemTypeName); } } item->_status = SyncFileItem::FileNameInvalid;