Backport pull request #4005 from jellyfin/release-10.8.z

Fix locale with suffix

Original-merge: b14d76a3d40ca35ea5d8f68c8241c397e1792f50

Merged-by: Bill Thornton <thornbill@users.noreply.github.com>

Backported-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
Dmitry Lyzo 2022-10-06 17:06:49 -04:00 committed by Bill Thornton
parent 1ac326d40b
commit 899f61a51d
5 changed files with 16 additions and 9 deletions

View file

@ -4,7 +4,7 @@ import { Events } from 'jellyfin-apiclient';
import globalize from '../../../scripts/globalize';
import serverNotifications from '../../../scripts/serverNotifications';
import { formatDistance, formatDistanceToNow } from 'date-fns';
import { getLocale, localeWithSuffix } from '../../../scripts/dfnshelper';
import { getLocale, getLocaleWithSuffix } from '../../../scripts/dfnshelper';
import '../../../components/listview/listview.scss';
import '../../../elements/emby-button/emby-button';
@ -83,7 +83,7 @@ import '../../../elements/emby-button/emby-button';
if (task.LastExecutionResult) {
const endtime = Date.parse(task.LastExecutionResult.EndTimeUtc);
const starttime = Date.parse(task.LastExecutionResult.StartTimeUtc);
html += globalize.translate('LabelScheduledTaskLastRan', formatDistanceToNow(endtime, localeWithSuffix),
html += globalize.translate('LabelScheduledTaskLastRan', formatDistanceToNow(endtime, getLocaleWithSuffix()),
formatDistance(starttime, endtime, { locale: getLocale() }));
if (task.LastExecutionResult.Status === 'Failed') {
html += " <span style='color:#FF0000;'>(" + globalize.translate('LabelFailed') + ')</span>';