1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Delete Series confirmation and button text

This commit is contained in:
Nitzan Savion 2024-02-27 15:04:09 +02:00
parent 56e9691e65
commit 9754af5ef5
4 changed files with 50 additions and 16 deletions

View file

@ -11,6 +11,20 @@ import ServerConnections from './ServerConnections';
import toast from './toast/toast'; import toast from './toast/toast';
import * as userSettings from '../scripts/settings/userSettings'; import * as userSettings from '../scripts/settings/userSettings';
function getDeleteCommandName(type) {
switch (type) {
case 'Series':
return globalize.translate('DeleteSeries');
case 'Playlist':
case 'BoxSet':
return globalize.translate('Delete');
default:
return globalize.translate('DeleteMedia');
}
}
export function getCommands(options) { export function getCommands(options) {
const item = options.item; const item = options.item;
const user = options.user; const user = options.user;
@ -160,19 +174,11 @@ export function getCommands(options) {
} }
if (item.CanDelete && options.deleteItem !== false) { if (item.CanDelete && options.deleteItem !== false) {
if (item.Type === 'Playlist' || item.Type === 'BoxSet') { commands.push({
commands.push({ name: getDeleteCommandName(item.Type),
name: globalize.translate('Delete'), id: 'delete',
id: 'delete', icon: 'delete'
icon: 'delete' });
});
} else {
commands.push({
name: globalize.translate('DeleteMedia'),
id: 'delete',
icon: 'delete'
});
}
} }
// Books are promoted to major download Button and therefor excluded in the context menu // Books are promoted to major download Button and therefor excluded in the context menu

View file

@ -9,17 +9,37 @@ function alertText(options) {
return alert(options); return alert(options);
} }
function getDeleteText(item) {
if (item.Type === 'Series') {
const totalEpisodes = item.RecursiveItemCount;
return {
title: globalize.translate('HeaderDeleteSeries'),
text: globalize.translate('ConfirmDeleteSeries', totalEpisodes),
confirmText: globalize.translate('DeleteEntireSeries', totalEpisodes)
};
}
return {
title: globalize.translate('HeaderDeleteItem'),
text: globalize.translate('ConfirmDeleteItem'),
confirmText: globalize.translate('Delete')
};
}
export function deleteItem(options) { export function deleteItem(options) {
const item = options.item; const item = options.item;
const parentId = item.SeasonId || item.SeriesId || item.ParentId; const parentId = item.SeasonId || item.SeriesId || item.ParentId;
const { confirmText, text, title } = getDeleteText(item);
const apiClient = ServerConnections.getApiClient(item.ServerId); const apiClient = ServerConnections.getApiClient(item.ServerId);
return confirm({ return confirm({
title: globalize.translate('HeaderDeleteItem'), title,
text: globalize.translate('ConfirmDeleteItem'), text,
confirmText: globalize.translate('Delete'), confirmText,
primary: 'delete' primary: 'delete'
}).then(function () { }).then(function () {

View file

@ -151,6 +151,7 @@
"ConfigureDateAdded": "Set up how metadata for 'Date added' is determined in the Dashboard > Libraries > NFO Settings", "ConfigureDateAdded": "Set up how metadata for 'Date added' is determined in the Dashboard > Libraries > NFO Settings",
"ConfirmDeleteImage": "Delete image?", "ConfirmDeleteImage": "Delete image?",
"ConfirmDeleteItem": "Deleting this item will delete it from both the file system and your media library. Are you sure you wish to continue?", "ConfirmDeleteItem": "Deleting this item will delete it from both the file system and your media library. Are you sure you wish to continue?",
"ConfirmDeleteSeries": "Deleting this series will delete ALL {0} episodes from both the file system and your media library. Are you sure you wish to continue?",
"ConfirmDeleteItems": "Deleting these items will delete them from both the file system and your media library. Are you sure you wish to continue?", "ConfirmDeleteItems": "Deleting these items will delete them from both the file system and your media library. Are you sure you wish to continue?",
"ConfirmDeletion": "Confirm Deletion", "ConfirmDeletion": "Confirm Deletion",
"ConfirmEndPlayerSession": "Would you like to shutdown Jellyfin on {0}?", "ConfirmEndPlayerSession": "Would you like to shutdown Jellyfin on {0}?",
@ -176,12 +177,14 @@
"DefaultSubtitlesHelp": "Subtitles are loaded based on the default and forced flags in the embedded metadata. Language preferences are considered when multiple options are available.", "DefaultSubtitlesHelp": "Subtitles are loaded based on the default and forced flags in the embedded metadata. Language preferences are considered when multiple options are available.",
"DeinterlaceMethodHelp": "Select the deinterlacing method to use when software transcoding interlaced content. When hardware acceleration supporting hardware deinterlacing is enabled the hardware deinterlacer will be used instead of this setting.", "DeinterlaceMethodHelp": "Select the deinterlacing method to use when software transcoding interlaced content. When hardware acceleration supporting hardware deinterlacing is enabled the hardware deinterlacer will be used instead of this setting.",
"Delete": "Delete", "Delete": "Delete",
"DeleteEntireSeries": "Delete {0} Episodes",
"DeleteAll": "Delete All", "DeleteAll": "Delete All",
"DeleteDeviceConfirmation": "Are you sure you wish to delete this device? It will reappear the next time a user signs in with it.", "DeleteDeviceConfirmation": "Are you sure you wish to delete this device? It will reappear the next time a user signs in with it.",
"DeleteDevicesConfirmation": "Are you sure you wish to delete all devices? All other sessions will be logged out. Devices will reappear the next time a user signs in.", "DeleteDevicesConfirmation": "Are you sure you wish to delete all devices? All other sessions will be logged out. Devices will reappear the next time a user signs in.",
"DeleteImage": "Delete Image", "DeleteImage": "Delete Image",
"DeleteImageConfirmation": "Are you sure you wish to delete this image?", "DeleteImageConfirmation": "Are you sure you wish to delete this image?",
"DeleteMedia": "Delete media", "DeleteMedia": "Delete media",
"DeleteSeries": "Delete Series",
"DeleteUser": "Delete User", "DeleteUser": "Delete User",
"DeleteUserConfirmation": "Are you sure you wish to delete this user?", "DeleteUserConfirmation": "Are you sure you wish to delete this user?",
"Depressed": "Depressed", "Depressed": "Depressed",
@ -358,6 +361,7 @@
"HeaderDeleteDevice": "Delete Device", "HeaderDeleteDevice": "Delete Device",
"HeaderDeleteDevices": "Delete All Devices", "HeaderDeleteDevices": "Delete All Devices",
"HeaderDeleteItem": "Delete Item", "HeaderDeleteItem": "Delete Item",
"HeaderDeleteSeries": "Delete Series",
"HeaderDeleteItems": "Delete Items", "HeaderDeleteItems": "Delete Items",
"HeaderDeleteProvider": "Delete Provider", "HeaderDeleteProvider": "Delete Provider",
"HeaderDeleteTaskTrigger": "Delete Task Trigger", "HeaderDeleteTaskTrigger": "Delete Task Trigger",

View file

@ -36,15 +36,18 @@
"ConfigureDateAdded": "‫הגדר כיצד תאריך ההוספה נקבע בלוח המחוונים ב- Dashboard > Libraries > NFO Settings", "ConfigureDateAdded": "‫הגדר כיצד תאריך ההוספה נקבע בלוח המחוונים ב- Dashboard > Libraries > NFO Settings",
"ConfirmDeleteImage": "למחוק את התמונה?", "ConfirmDeleteImage": "למחוק את התמונה?",
"ConfirmDeleteItem": "מחיקת פריט זה תמחק אותו הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?", "ConfirmDeleteItem": "מחיקת פריט זה תמחק אותו הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?",
"ConfirmDeleteSeries": "מחיקת סדרה זו תמחק את כל {0} הפרקים הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?",
"ConfirmDeleteItems": "מחיקת פריטים אלה תמחק אותם הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?", "ConfirmDeleteItems": "מחיקת פריטים אלה תמחק אותם הן ממערכת הקבצים והן מספריית המדיה שלך. האם אתה בטוח שברצונך להמשיך?",
"ConfirmDeletion": "אשר מחיקה", "ConfirmDeletion": "אשר מחיקה",
"Continuing": "ממשיך", "Continuing": "ממשיך",
"CustomDlnaProfilesHelp": "צור פרופיל מותאם אישית למכשיר חדש או לעקיפת פרופיל מערכת.", "CustomDlnaProfilesHelp": "צור פרופיל מותאם אישית למכשיר חדש או לעקיפת פרופיל מערכת.",
"ErrorDefault": "אירעה שגיאה בעיבוד הבקשה. בבקשה נסה שוב מאוחר יותר.", "ErrorDefault": "אירעה שגיאה בעיבוד הבקשה. בבקשה נסה שוב מאוחר יותר.",
"Delete": "מחק", "Delete": "מחק",
"DeleteEntireSeries": "מחק {0} פרקים",
"DeleteImage": "מחק תמונה", "DeleteImage": "מחק תמונה",
"DeleteImageConfirmation": "האם אתה בטוח שברצונך למחוק תמונה זו?", "DeleteImageConfirmation": "האם אתה בטוח שברצונך למחוק תמונה זו?",
"DeleteMedia": "מחק מדיה", "DeleteMedia": "מחק מדיה",
"DeleteSeries": "מחק סדרה",
"DeleteUser": "מחק משתמש", "DeleteUser": "מחק משתמש",
"DoNotRecord": "אל תקליט", "DoNotRecord": "אל תקליט",
"Download": "הורדה", "Download": "הורדה",
@ -74,6 +77,7 @@
"HeaderConfirmPluginInstallation": "אשר התקנת תוסף", "HeaderConfirmPluginInstallation": "אשר התקנת תוסף",
"HeaderCustomDlnaProfiles": "פרופילים מותאמים אישית", "HeaderCustomDlnaProfiles": "פרופילים מותאמים אישית",
"HeaderDeleteItem": "מחק פריט", "HeaderDeleteItem": "מחק פריט",
"HeaderDeleteSeries": "מחק סדרה",
"HeaderDeleteItems": "מחיקת פריטים", "HeaderDeleteItems": "מחיקת פריטים",
"HeaderEasyPinCode": "קוד אישי קל", "HeaderEasyPinCode": "קוד אישי קל",
"HeaderEditImages": "ערוך תמונות", "HeaderEditImages": "ערוך תמונות",