From 910c403d841ab46b0ec7b68c4bbb76445d340484 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 17 Oct 2023 18:44:55 +0300 Subject: [PATCH] Add translations to history and queue custom filters --- .../HistoryEventTypeFilterBuilderRowValue.tsx | 25 ++++++++++++++----- frontend/src/Store/Actions/historyActions.js | 8 +++--- frontend/src/Store/Actions/queueActions.js | 8 +++--- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/frontend/src/Components/Filter/Builder/HistoryEventTypeFilterBuilderRowValue.tsx b/frontend/src/Components/Filter/Builder/HistoryEventTypeFilterBuilderRowValue.tsx index c5f41ebc3..4ecddf646 100644 --- a/frontend/src/Components/Filter/Builder/HistoryEventTypeFilterBuilderRowValue.tsx +++ b/frontend/src/Components/Filter/Builder/HistoryEventTypeFilterBuilderRowValue.tsx @@ -1,31 +1,44 @@ import React from 'react'; +import translate from 'Utilities/String/translate'; import FilterBuilderRowValue from './FilterBuilderRowValue'; import FilterBuilderRowValueProps from './FilterBuilderRowValueProps'; const EVENT_TYPE_OPTIONS = [ { id: 1, - name: 'Grabbed', + get name() { + return translate('Grabbed'); + }, }, { id: 3, - name: 'Imported', + get name() { + return translate('Imported'); + }, }, { id: 4, - name: 'Failed', + get name() { + return translate('Failed'); + }, }, { id: 5, - name: 'Deleted', + get name() { + return translate('Deleted'); + }, }, { id: 6, - name: 'Renamed', + get name() { + return translate('Renamed'); + }, }, { id: 7, - name: 'Ignored', + get name() { + return translate('Ignored'); + }, }, ]; diff --git a/frontend/src/Store/Actions/historyActions.js b/frontend/src/Store/Actions/historyActions.js index 01d0fe66b..3e773eca8 100644 --- a/frontend/src/Store/Actions/historyActions.js +++ b/frontend/src/Store/Actions/historyActions.js @@ -190,25 +190,25 @@ export const defaultState = { filterBuilderProps: [ { name: 'eventType', - label: 'Event Type', + label: () => translate('EventType'), type: filterBuilderTypes.EQUAL, valueType: filterBuilderValueTypes.HISTORY_EVENT_TYPE }, { name: 'seriesIds', - label: 'Series', + label: () => translate('Series'), type: filterBuilderTypes.EQUAL, valueType: filterBuilderValueTypes.SERIES }, { name: 'quality', - label: 'Quality', + label: () => translate('Quality'), type: filterBuilderTypes.EQUAL, valueType: filterBuilderValueTypes.QUALITY }, { name: 'languages', - label: 'Languages', + label: () => translate('Languages'), type: filterBuilderTypes.CONTAINS, valueType: filterBuilderValueTypes.LANGUAGE } diff --git a/frontend/src/Store/Actions/queueActions.js b/frontend/src/Store/Actions/queueActions.js index 15ea35561..150c1ac00 100644 --- a/frontend/src/Store/Actions/queueActions.js +++ b/frontend/src/Store/Actions/queueActions.js @@ -185,25 +185,25 @@ export const defaultState = { filterBuilderProps: [ { name: 'seriesIds', - label: 'Series', + label: () => translate('Series'), type: filterBuilderTypes.EQUAL, valueType: filterBuilderValueTypes.SERIES }, { name: 'quality', - label: 'Quality', + label: () => translate('Quality'), type: filterBuilderTypes.EQUAL, valueType: filterBuilderValueTypes.QUALITY }, { name: 'languages', - label: 'Languages', + label: () => translate('Languages'), type: filterBuilderTypes.CONTAINS, valueType: filterBuilderValueTypes.LANGUAGE }, { name: 'protocol', - label: 'Protocol', + label: () => translate('Protocol'), type: filterBuilderTypes.EQUAL, valueType: filterBuilderValueTypes.PROTOCOL }