- break;
- case 1:
- basicActionsMenuText =
- i18nc("@action:inmenu menu with actions like copy, paste, rename. %1 is the name of the singular selected file/folder.",
- "Actions for \"%1\"", selection.first().name());
- break;
- case 2:
- basicActionsMenuText =
- i18nc("@action:inmenu menu with actions like copy, paste, rename. %1 and %2 are names of files/folders.",
- "Actions for \"%1\" and \"%2\"", selection.first().name(), selection.last().name());
- break;
- case 3:
- basicActionsMenuText =
- i18nc("@action:inmenu menu with actions like copy, paste, rename. %1, %2 and %3 are names of files/folders.",
- "Actions for \"%1\", \"%2\" and \"%3\"",
- selection.first().name(), selection.at(1).name(), selection.last().name());
- break;
- default:
- basicActionsMenuText = QString();
- break;
+ } else {
+ QFontMetrics fontMetrics = QMenu().fontMetrics();
+ // i18n: @action:inmenu menu with actions like copy, paste, rename.
+ // %1 is a textual representation of the currently selected files or folders. This can be the name of
+ // the file/files like "file1" or "file1, file2 and file3" or an aggregate like "8 Selected Folders".
+ // If this sort of word puzzle can not be correctly translated in your language, translate it as "NULL" (without the quotes)
+ // and a fallback will be used.
+ basicActionsMenuText = i18n("Actions for %1", fileItemListToString(selection, fontMetrics.averageCharWidth() * 40, fontMetrics, ItemsState::Selected));