From d31fcbb2dfe98a540a359b98b204d101d554cf03 Mon Sep 17 00:00:00 2001 From: Stevie Robinson Date: Fri, 1 Sep 2023 02:49:38 +0200 Subject: [PATCH] Translate Frontend Store --- .../src/Store/Actions/Settings/autoTaggingSpecifications.js | 3 ++- frontend/src/Store/Actions/Settings/autoTaggings.js | 3 ++- .../src/Store/Actions/Settings/customFormatSpecifications.js | 3 ++- frontend/src/Store/Actions/Settings/customFormats.js | 3 ++- frontend/src/Store/Actions/Settings/indexers.js | 3 ++- frontend/src/Store/Actions/Settings/qualityProfiles.js | 3 ++- src/NzbDrone.Core/Localization/Core/en.json | 2 ++ 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/frontend/src/Store/Actions/Settings/autoTaggingSpecifications.js b/frontend/src/Store/Actions/Settings/autoTaggingSpecifications.js index cfc919c7d..a5099030c 100644 --- a/frontend/src/Store/Actions/Settings/autoTaggingSpecifications.js +++ b/frontend/src/Store/Actions/Settings/autoTaggingSpecifications.js @@ -10,6 +10,7 @@ import getProviderState from 'Utilities/State/getProviderState'; import getSectionState from 'Utilities/State/getSectionState'; import selectProviderSchema from 'Utilities/State/selectProviderSchema'; import updateSectionState from 'Utilities/State/updateSectionState'; +import translate from 'Utilities/String/translate'; import { removeItem, set, update, updateItem } from '../baseActions'; // @@ -176,7 +177,7 @@ export default { const newItem = { ...item, id: newId, - name: `${item.name} - Copy` + name: translate('DefaultNameCopiedSpecification', { name: item.name }) }; newState.items = [...items, newItem]; newState.itemMap[newId] = newState.items.length - 1; diff --git a/frontend/src/Store/Actions/Settings/autoTaggings.js b/frontend/src/Store/Actions/Settings/autoTaggings.js index 35b3d4149..c1d9c122a 100644 --- a/frontend/src/Store/Actions/Settings/autoTaggings.js +++ b/frontend/src/Store/Actions/Settings/autoTaggings.js @@ -7,6 +7,7 @@ import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/create import { createThunk } from 'Store/thunks'; import getSectionState from 'Utilities/State/getSectionState'; import updateSectionState from 'Utilities/State/updateSectionState'; +import translate from 'Utilities/String/translate'; // // Variables @@ -99,7 +100,7 @@ export default { const pendingChanges = { ...item, id: 0 }; delete pendingChanges.id; - pendingChanges.name = `${pendingChanges.name} - Copy`; + pendingChanges.name = translate('DefaultNameCopiedProfile', { name: pendingChanges.name }); newState.pendingChanges = pendingChanges; return updateSectionState(state, section, newState); diff --git a/frontend/src/Store/Actions/Settings/customFormatSpecifications.js b/frontend/src/Store/Actions/Settings/customFormatSpecifications.js index d74898d3e..850be1f24 100644 --- a/frontend/src/Store/Actions/Settings/customFormatSpecifications.js +++ b/frontend/src/Store/Actions/Settings/customFormatSpecifications.js @@ -10,6 +10,7 @@ import getProviderState from 'Utilities/State/getProviderState'; import getSectionState from 'Utilities/State/getSectionState'; import selectProviderSchema from 'Utilities/State/selectProviderSchema'; import updateSectionState from 'Utilities/State/updateSectionState'; +import translate from 'Utilities/String/translate'; import { removeItem, set, update, updateItem } from '../baseActions'; // @@ -176,7 +177,7 @@ export default { const newItem = { ...item, id: newId, - name: `${item.name} - Copy` + name: translate('DefaultNameCopiedSpecification', { name: item.name }) }; newState.items = [...items, newItem]; newState.itemMap[newId] = newState.items.length - 1; diff --git a/frontend/src/Store/Actions/Settings/customFormats.js b/frontend/src/Store/Actions/Settings/customFormats.js index 4a175abea..e7691c09f 100644 --- a/frontend/src/Store/Actions/Settings/customFormats.js +++ b/frontend/src/Store/Actions/Settings/customFormats.js @@ -6,6 +6,7 @@ import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/create import { createThunk } from 'Store/thunks'; import getSectionState from 'Utilities/State/getSectionState'; import updateSectionState from 'Utilities/State/updateSectionState'; +import translate from 'Utilities/String/translate'; import { set } from '../baseActions'; // @@ -98,7 +99,7 @@ export default { const pendingChanges = { ...item, id: 0 }; delete pendingChanges.id; - pendingChanges.name = `${pendingChanges.name} - Copy`; + pendingChanges.name = translate('DefaultNameCopiedProfile', { name: pendingChanges.name }); newState.pendingChanges = pendingChanges; return updateSectionState(state, section, newState); diff --git a/frontend/src/Store/Actions/Settings/indexers.js b/frontend/src/Store/Actions/Settings/indexers.js index c76750cf2..9d6dca5c8 100644 --- a/frontend/src/Store/Actions/Settings/indexers.js +++ b/frontend/src/Store/Actions/Settings/indexers.js @@ -13,6 +13,7 @@ import { createThunk } from 'Store/thunks'; import getSectionState from 'Utilities/State/getSectionState'; import selectProviderSchema from 'Utilities/State/selectProviderSchema'; import updateSectionState from 'Utilities/State/updateSectionState'; +import translate from 'Utilities/String/translate'; // // Variables @@ -149,7 +150,7 @@ export default { // Set the name in pendingChanges newState.pendingChanges = { - name: `${item.name} - Copy` + name: translate('DefaultNameCopiedSpecification', { name: item.name }) }; return updateSectionState(state, section, newState); diff --git a/frontend/src/Store/Actions/Settings/qualityProfiles.js b/frontend/src/Store/Actions/Settings/qualityProfiles.js index 8e6036073..49c460942 100644 --- a/frontend/src/Store/Actions/Settings/qualityProfiles.js +++ b/frontend/src/Store/Actions/Settings/qualityProfiles.js @@ -7,6 +7,7 @@ import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/create import { createThunk } from 'Store/thunks'; import getSectionState from 'Utilities/State/getSectionState'; import updateSectionState from 'Utilities/State/updateSectionState'; +import translate from 'Utilities/String/translate'; // // Variables @@ -87,7 +88,7 @@ export default { const pendingChanges = { ...item, id: 0 }; delete pendingChanges.id; - pendingChanges.name = `${pendingChanges.name} - Copy`; + pendingChanges.name = translate('DefaultNameCopiedProfile', { name: pendingChanges.name }); newState.pendingChanges = pendingChanges; return updateSectionState(state, section, newState); diff --git a/src/NzbDrone.Core/Localization/Core/en.json b/src/NzbDrone.Core/Localization/Core/en.json index 59522ac37..aef7a46ed 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -261,6 +261,8 @@ "Default": "Default", "DefaultCase": "Default Case", "DefaultDelayProfile": "This is the default profile. It applies to all series that don't have an explicit profile.", + "DefaultNameCopiedProfile": "{name} - Copy", + "DefaultNameCopiedSpecification": "{name} - Copy", "DefaultNotFoundMessage": "You must be lost, nothing to see here.", "DelayMinutes": "{delay} Minutes", "DelayProfile": "Delay Profile",