From fcd8a4a873a7ef4f89036085e2009c76a79417f7 Mon Sep 17 00:00:00 2001 From: Stevie Robinson Date: Fri, 1 Sep 2023 02:49:38 +0200 Subject: [PATCH] Translate Frontend Store Fixed indexer copy translation (cherry picked from commit d31fcbb2dfe98a540a359b98b204d101d554cf03) (cherry picked from commit 276352dda478aaa7be7d0fc744548adddec6e6b6) Closes #9118 Closes #9121 --- .../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 cfc919c7d3..a5099030c8 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 35b3d41495..c1d9c122aa 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 d74898d3e1..850be1f242 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 4a175abea0..e7691c09f5 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 8de2a684b4..2e9c01f0c2 100644 --- a/frontend/src/Store/Actions/Settings/indexers.js +++ b/frontend/src/Store/Actions/Settings/indexers.js @@ -11,6 +11,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'; import createBulkEditItemHandler from '../Creators/createBulkEditItemHandler'; import createBulkRemoveItemHandler from '../Creators/createBulkRemoveItemHandler'; @@ -152,7 +153,7 @@ export default { // Set the name in pendingChanges newState.pendingChanges = { - name: `${item.name} - Copy` + name: translate('DefaultNameCopiedProfile', { 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 8e6036073d..49c4609424 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 1be966bf64..c0b5a9d6b8 100644 --- a/src/NzbDrone.Core/Localization/Core/en.json +++ b/src/NzbDrone.Core/Localization/Core/en.json @@ -223,6 +223,8 @@ "Default": "Default", "DefaultCase": "Default Case", "DefaultDelayProfile": "This is the default profile. It applies to all movies that don't have an explicit profile.", + "DefaultNameCopiedProfile": "{name} - Copy", + "DefaultNameCopiedSpecification": "{name} - Copy", "DelayProfile": "Delay Profile", "DelayProfiles": "Delay Profiles", "DelayingDownloadUntilInterp": "Delaying download until {0} at {1}",