Translate Frontend Store

This commit is contained in:
Stevie Robinson 2023-09-01 02:49:38 +02:00 committed by GitHub
parent 467ce70291
commit d31fcbb2df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 14 additions and 6 deletions

View File

@ -10,6 +10,7 @@ import getProviderState from 'Utilities/State/getProviderState';
import getSectionState from 'Utilities/State/getSectionState'; import getSectionState from 'Utilities/State/getSectionState';
import selectProviderSchema from 'Utilities/State/selectProviderSchema'; import selectProviderSchema from 'Utilities/State/selectProviderSchema';
import updateSectionState from 'Utilities/State/updateSectionState'; import updateSectionState from 'Utilities/State/updateSectionState';
import translate from 'Utilities/String/translate';
import { removeItem, set, update, updateItem } from '../baseActions'; import { removeItem, set, update, updateItem } from '../baseActions';
// //
@ -176,7 +177,7 @@ export default {
const newItem = { const newItem = {
...item, ...item,
id: newId, id: newId,
name: `${item.name} - Copy` name: translate('DefaultNameCopiedSpecification', { name: item.name })
}; };
newState.items = [...items, newItem]; newState.items = [...items, newItem];
newState.itemMap[newId] = newState.items.length - 1; newState.itemMap[newId] = newState.items.length - 1;

View File

@ -7,6 +7,7 @@ import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/create
import { createThunk } from 'Store/thunks'; import { createThunk } from 'Store/thunks';
import getSectionState from 'Utilities/State/getSectionState'; import getSectionState from 'Utilities/State/getSectionState';
import updateSectionState from 'Utilities/State/updateSectionState'; import updateSectionState from 'Utilities/State/updateSectionState';
import translate from 'Utilities/String/translate';
// //
// Variables // Variables
@ -99,7 +100,7 @@ export default {
const pendingChanges = { ...item, id: 0 }; const pendingChanges = { ...item, id: 0 };
delete pendingChanges.id; delete pendingChanges.id;
pendingChanges.name = `${pendingChanges.name} - Copy`; pendingChanges.name = translate('DefaultNameCopiedProfile', { name: pendingChanges.name });
newState.pendingChanges = pendingChanges; newState.pendingChanges = pendingChanges;
return updateSectionState(state, section, newState); return updateSectionState(state, section, newState);

View File

@ -10,6 +10,7 @@ import getProviderState from 'Utilities/State/getProviderState';
import getSectionState from 'Utilities/State/getSectionState'; import getSectionState from 'Utilities/State/getSectionState';
import selectProviderSchema from 'Utilities/State/selectProviderSchema'; import selectProviderSchema from 'Utilities/State/selectProviderSchema';
import updateSectionState from 'Utilities/State/updateSectionState'; import updateSectionState from 'Utilities/State/updateSectionState';
import translate from 'Utilities/String/translate';
import { removeItem, set, update, updateItem } from '../baseActions'; import { removeItem, set, update, updateItem } from '../baseActions';
// //
@ -176,7 +177,7 @@ export default {
const newItem = { const newItem = {
...item, ...item,
id: newId, id: newId,
name: `${item.name} - Copy` name: translate('DefaultNameCopiedSpecification', { name: item.name })
}; };
newState.items = [...items, newItem]; newState.items = [...items, newItem];
newState.itemMap[newId] = newState.items.length - 1; newState.itemMap[newId] = newState.items.length - 1;

View File

@ -6,6 +6,7 @@ import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/create
import { createThunk } from 'Store/thunks'; import { createThunk } from 'Store/thunks';
import getSectionState from 'Utilities/State/getSectionState'; import getSectionState from 'Utilities/State/getSectionState';
import updateSectionState from 'Utilities/State/updateSectionState'; import updateSectionState from 'Utilities/State/updateSectionState';
import translate from 'Utilities/String/translate';
import { set } from '../baseActions'; import { set } from '../baseActions';
// //
@ -98,7 +99,7 @@ export default {
const pendingChanges = { ...item, id: 0 }; const pendingChanges = { ...item, id: 0 };
delete pendingChanges.id; delete pendingChanges.id;
pendingChanges.name = `${pendingChanges.name} - Copy`; pendingChanges.name = translate('DefaultNameCopiedProfile', { name: pendingChanges.name });
newState.pendingChanges = pendingChanges; newState.pendingChanges = pendingChanges;
return updateSectionState(state, section, newState); return updateSectionState(state, section, newState);

View File

@ -13,6 +13,7 @@ import { createThunk } from 'Store/thunks';
import getSectionState from 'Utilities/State/getSectionState'; import getSectionState from 'Utilities/State/getSectionState';
import selectProviderSchema from 'Utilities/State/selectProviderSchema'; import selectProviderSchema from 'Utilities/State/selectProviderSchema';
import updateSectionState from 'Utilities/State/updateSectionState'; import updateSectionState from 'Utilities/State/updateSectionState';
import translate from 'Utilities/String/translate';
// //
// Variables // Variables
@ -149,7 +150,7 @@ export default {
// Set the name in pendingChanges // Set the name in pendingChanges
newState.pendingChanges = { newState.pendingChanges = {
name: `${item.name} - Copy` name: translate('DefaultNameCopiedSpecification', { name: item.name })
}; };
return updateSectionState(state, section, newState); return updateSectionState(state, section, newState);

View File

@ -7,6 +7,7 @@ import createSetSettingValueReducer from 'Store/Actions/Creators/Reducers/create
import { createThunk } from 'Store/thunks'; import { createThunk } from 'Store/thunks';
import getSectionState from 'Utilities/State/getSectionState'; import getSectionState from 'Utilities/State/getSectionState';
import updateSectionState from 'Utilities/State/updateSectionState'; import updateSectionState from 'Utilities/State/updateSectionState';
import translate from 'Utilities/String/translate';
// //
// Variables // Variables
@ -87,7 +88,7 @@ export default {
const pendingChanges = { ...item, id: 0 }; const pendingChanges = { ...item, id: 0 };
delete pendingChanges.id; delete pendingChanges.id;
pendingChanges.name = `${pendingChanges.name} - Copy`; pendingChanges.name = translate('DefaultNameCopiedProfile', { name: pendingChanges.name });
newState.pendingChanges = pendingChanges; newState.pendingChanges = pendingChanges;
return updateSectionState(state, section, newState); return updateSectionState(state, section, newState);

View File

@ -261,6 +261,8 @@
"Default": "Default", "Default": "Default",
"DefaultCase": "Default Case", "DefaultCase": "Default Case",
"DefaultDelayProfile": "This is the default profile. It applies to all series that don't have an explicit profile.", "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.", "DefaultNotFoundMessage": "You must be lost, nothing to see here.",
"DelayMinutes": "{delay} Minutes", "DelayMinutes": "{delay} Minutes",
"DelayProfile": "Delay Profile", "DelayProfile": "Delay Profile",