diff --git a/src/components/imagedownloader/imagedownloader.js b/src/components/imagedownloader/imagedownloader.js index 3d08bf2da0..9df083aea2 100644 --- a/src/components/imagedownloader/imagedownloader.js +++ b/src/components/imagedownloader/imagedownloader.js @@ -109,7 +109,7 @@ define(['dom', 'loading', 'apphost', 'dialogHelper', 'connectionManager', 'image html += ''; var startAtDisplay = totalRecordCount ? startIndex + 1 : 0; - html += globalize.translate("ListPaging", startAtDisplay + '-' + recordsEnd, totalRecordCount); + html += globalize.translate("ListPaging", startAtDisplay, recordsEnd, totalRecordCount); html += ''; diff --git a/src/controllers/dashboard/dashboard.js b/src/controllers/dashboard/dashboard.js index 37e9a6155a..78f5cdca01 100644 --- a/src/controllers/dashboard/dashboard.js +++ b/src/controllers/dashboard/dashboard.js @@ -471,7 +471,7 @@ define(["datetime", "events", "itemHelper", "serverNotifications", "dom", "globa // how dates are returned by the server when the session is active and show something like 'Active now', instead of past/future sentences if (!nowPlayingItem) { return { - html: globalize.translate("LastSeen", datefns.formatDistanceToNow(Date.parse(session.LastActivityDate), { addSuffix: true, locale: dfnshelper.getLocale() })), + html: globalize.translate("LastSeen", datefns.formatDistanceToNow(Date.parse(session.LastActivityDate), dfnshelper.localeWithSuffix)), image: imgUrl }; } diff --git a/src/controllers/dashboard/scheduledtasks/scheduledtasks.js b/src/controllers/dashboard/scheduledtasks/scheduledtasks.js index f6616bad9d..b91158d8bf 100644 --- a/src/controllers/dashboard/scheduledtasks/scheduledtasks.js +++ b/src/controllers/dashboard/scheduledtasks/scheduledtasks.js @@ -66,8 +66,10 @@ define(["jQuery", "loading", "events", "globalize", "serverNotifications", "date var html = ""; if (task.State === "Idle") { if (task.LastExecutionResult) { - html += globalize.translate("LabelScheduledTaskLastRan", datefns.formatDistanceToNow(Date.parse(task.LastExecutionResult.EndTimeUtc), { addSuffix: true, locale: dfnshelper.getLocale() }), - datefns.formatDistance(Date.parse(task.LastExecutionResult.StartTimeUtc), Date.parse(task.LastExecutionResult.EndTimeUtc), { addSuffix: false, locale: dfnshelper.getLocale() })); + var endtime = Date.parse(task.LastExecutionResult.EndTimeUtc); + var starttime = Date.parse(task.LastExecutionResult.StartTimeUtc); + html += globalize.translate("LabelScheduledTaskLastRan", datefns.formatDistanceToNow(endtime, dfnshelper.localeWithSuffix), + datefns.formatDistance(starttime, endtime, dfnshelper.localeWithSuffix)); if (task.LastExecutionResult.Status === "Failed") { html += " (" + globalize.translate("LabelFailed") + ")"; } else if (task.LastExecutionResult.Status === "Cancelled") { diff --git a/src/controllers/devices.js b/src/controllers/devices.js index dccece404d..8dd665f7fa 100644 --- a/src/controllers/devices.js +++ b/src/controllers/devices.js @@ -103,7 +103,7 @@ define(["loading", "dom", "libraryMenu", "globalize", "scripts/imagehelper", "da if (device.LastUserName) { deviceHtml += device.LastUserName; - deviceHtml += ", " + datefns.formatDistanceToNow(Date.parse(device.DateLastActivity), { addSuffix: true, locale: dfnshelper.getLocale() }); + deviceHtml += ", " + datefns.formatDistanceToNow(Date.parse(device.DateLastActivity), dfnshelper.localeWithSuffix); } deviceHtml += " "; diff --git a/src/controllers/userprofilespage.js b/src/controllers/userprofilespage.js index 955b8de521..180d0e62ae 100644 --- a/src/controllers/userprofilespage.js +++ b/src/controllers/userprofilespage.js @@ -129,7 +129,7 @@ define(["loading", "dom", "globalize", "date-fns", "dfnshelper", "paper-icon-but // how dates are returned by the server when the session is active and show something like 'Active now', instead of past/future sentences function getLastSeenText(lastActivityDate) { if (lastActivityDate) { - return globalize.translate("LastSeen", datefns.formatDistanceToNow(Date.parse(lastActivityDate), { addSuffix: true, locale: dfnshelper.getLocale() })); + return globalize.translate("LastSeen", datefns.formatDistanceToNow(Date.parse(lastActivityDate), dfnshelper.localeWithSuffix)); } return ""; diff --git a/src/scripts/dfnshelper.js b/src/scripts/dfnshelper.js index 3730a01652..01d032f223 100644 --- a/src/scripts/dfnshelper.js +++ b/src/scripts/dfnshelper.js @@ -95,3 +95,4 @@ export function getLocale() { return enUS; } } +export const localeWithSuffix = { addSuffix: true, locale: getLocale() }; diff --git a/src/scripts/librarybrowser.js b/src/scripts/librarybrowser.js index 9106bdd389..bc8908fe6c 100644 --- a/src/scripts/librarybrowser.js +++ b/src/scripts/librarybrowser.js @@ -83,7 +83,7 @@ define(["userSettings"], function (userSettings) { if (html += '
', showControls) { html += ''; - html += Globalize.translate("ListPaging", (totalRecordCount ? startIndex + 1 : 0) + "-" + recordsEnd, totalRecordCount); + html += Globalize.translate("ListPaging", (totalRecordCount ? startIndex + 1 : 0), recordsEnd, totalRecordCount); html += ""; } diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 06eaf3d86a..a1b1bea63a 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -1483,7 +1483,7 @@ "Yesterday": "Yesterday", "PathNotFound": "The path could not be found. Please ensure the path is valid and try again.", "WriteAccessRequired": "Jellyfin Server requires write access to this folder. Please ensure write access and try again.", - "ListPaging": "{0} of {1}", + "ListPaging": "{0}-{1} of {2}", "PersonRole": "as {0}", "LastSeen": "Last seen {0}", "DailyAt": "Daily at {0}", diff --git a/src/strings/es.json b/src/strings/es.json index 35bde0b9b3..1870b255aa 100644 --- a/src/strings/es.json +++ b/src/strings/es.json @@ -1480,7 +1480,7 @@ "PreferEmbeddedEpisodeInfosOverFileNamesHelp": "Usar la información de episodio de los metadatos embebidos si está disponible.", "PathNotFound": "No se encontró la ruta especificada. Asegúrate de que existe e inténtalo de nuevo.", "WriteAccessRequired": "Jellyfin requiere de permisos de escritura en esta carpeta. Asegúrate de que existe este permiso e inténtalo de nuevo.", - "ListPaging": "{0} de {1}", + "ListPaging": "{0}-{1} de {2}", "PersonRole": "como {0}", "LastSeen": "Última vez {0}", "DailyAt": "Diariamente a las {0}",