Skip to content

Commit c959e95

Browse files
authored
Merge pull request #102 from joker-x/master
Add spanish translation
2 parents c285429 + 4e2820f commit c959e95

File tree

9 files changed

+105
-30
lines changed

9 files changed

+105
-30
lines changed

admin/src/components/ActionButtons/index.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { isEmpty } from 'lodash';
55
import { Button } from '@strapi/design-system';
66
import { Map } from 'immutable';
77
import { useNotification } from '@strapi/helper-plugin';
8+
import { useIntl } from 'react-intl';
89

910
import ConfirmModal from '../ConfirmModal';
1011
import { exportAllConfig, importAllConfig } from '../../state/actions/Config';
@@ -15,6 +16,7 @@ const ActionButtons = () => {
1516
const [modalIsOpen, setModalIsOpen] = useState(false);
1617
const [actionType, setActionType] = useState('');
1718
const partialDiff = useSelector((state) => state.getIn(['config', 'partialDiff'], Map({}))).toJS();
19+
const { formatMessage } = useIntl();
1820

1921
const closeModal = () => {
2022
setActionType('');
@@ -28,8 +30,12 @@ const ActionButtons = () => {
2830

2931
return (
3032
<ActionButtonsStyling>
31-
<Button disabled={isEmpty(partialDiff)} onClick={() => openModal('import')}>Import</Button>
32-
<Button disabled={isEmpty(partialDiff)} onClick={() => openModal('export')}>Export</Button>
33+
<Button disabled={isEmpty(partialDiff)} onClick={() => openModal('import')}>
34+
{formatMessage({ id: 'config-sync.Buttons.Import' })}
35+
</Button>
36+
<Button disabled={isEmpty(partialDiff)} onClick={() => openModal('export')}>
37+
{formatMessage({ id: 'config-sync.Buttons.Export' })}
38+
</Button>
3339
{!isEmpty(partialDiff) && (
3440
<h4 style={{ display: 'inline' }}>{Object.keys(partialDiff).length} {Object.keys(partialDiff).length === 1 ? "config change" : "config changes"}</h4>
3541
)}

admin/src/components/ConfigDiff/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from 'react';
22
import ReactDiffViewer, { DiffMethod } from 'react-diff-viewer-continued';
3+
import { useIntl } from 'react-intl';
34

45
import {
56
ModalLayout,
@@ -11,9 +12,8 @@ import {
1112
} from '@strapi/design-system';
1213

1314
const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => {
14-
if (!isOpen) {
15-
return null;
16-
}
15+
const { formatMessage } = useIntl();
16+
if (!isOpen) return null;
1717

1818
return (
1919
<ModalLayout
@@ -22,16 +22,16 @@ const ConfigDiff = ({ isOpen, onClose, oldValue, newValue, configName }) => {
2222
>
2323
<ModalHeader>
2424
<Typography variant="omega" fontWeight="bold" textColor="neutral800">
25-
Config changes for {configName}
25+
{formatMessage({ id: 'config-sync.ConfigDiff.Title' })} {configName}
2626
</Typography>
2727
</ModalHeader>
2828
<ModalBody>
2929
<Grid paddingBottom={4} style={{ textAlign: 'center' }}>
3030
<GridItem col={6}>
31-
<Typography variant="delta">Sync directory</Typography>
31+
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.SyncDirectory' })}</Typography>
3232
</GridItem>
3333
<GridItem col={6}>
34-
<Typography variant="delta">Database</Typography>
34+
<Typography variant="delta">{formatMessage({ id: 'config-sync.ConfigDiff.Database' })}</Typography>
3535
</GridItem>
3636
</Grid>
3737
<ReactDiffViewer

admin/src/components/ConfigList/index.js

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useState, useEffect } from 'react';
2+
import { useIntl } from 'react-intl';
23
import { isEmpty } from 'lodash';
34
import { useDispatch } from 'react-redux';
45

@@ -19,6 +20,7 @@ import NoChanges from '../NoChanges';
1920
import ConfigListRow from './ConfigListRow';
2021
import { setConfigPartialDiffInState } from '../../state/actions/Config';
2122

23+
2224
const ConfigList = ({ diff, isLoading }) => {
2325
const [openModal, setOpenModal] = useState(false);
2426
const [originalConfig, setOriginalConfig] = useState({});
@@ -27,23 +29,24 @@ const ConfigList = ({ diff, isLoading }) => {
2729
const [rows, setRows] = useState([]);
2830
const [checkedItems, setCheckedItems] = useState([]);
2931
const dispatch = useDispatch();
32+
const { formatMessage } = useIntl();
3033

3134
const getConfigState = (configName) => {
3235
if (
3336
diff.fileConfig[configName]
3437
&& diff.databaseConfig[configName]
3538
) {
36-
return 'Different';
39+
return formatMessage({ id: 'config-sync.ConfigList.Different' });
3740
} else if (
3841
diff.fileConfig[configName]
3942
&& !diff.databaseConfig[configName]
4043
) {
41-
return 'Only in sync dir';
44+
return formatMessage({ id: 'config-sync.ConfigList.OnlyDir' });
4245
} else if (
4346
!diff.fileConfig[configName]
4447
&& diff.databaseConfig[configName]
4548
) {
46-
return 'Only in DB';
49+
return formatMessage({ id: 'config-sync.ConfigList.OnlyDB' });
4750
}
4851
};
4952

@@ -96,7 +99,7 @@ const ConfigList = ({ diff, isLoading }) => {
9699
if (isLoading) {
97100
return (
98101
<div style={{ textAlign: 'center', marginTop: 40 }}>
99-
<Loader>Loading content...</Loader>
102+
<Loader>{formatMessage({ id: 'config-sync.ConfigList.Loading' })}</Loader>
100103
</div>
101104
);
102105
}
@@ -126,20 +129,20 @@ const ConfigList = ({ diff, isLoading }) => {
126129
<Tr>
127130
<Th>
128131
<BaseCheckbox
129-
aria-label="Select all entries"
132+
aria-label={formatMessage({ id: 'config-sync.ConfigList.SelectAll' })}
130133
indeterminate={isIndeterminate}
131134
onValueChange={(value) => setCheckedItems(checkedItems.map(() => value))}
132135
value={allChecked}
133136
/>
134137
</Th>
135138
<Th>
136-
<Typography variant="sigma">Config name</Typography>
139+
<Typography variant="sigma">{formatMessage({ id: 'config-sync.ConfigList.ConfigName' })}</Typography>
137140
</Th>
138141
<Th>
139-
<Typography variant="sigma">Config type</Typography>
142+
<Typography variant="sigma">{formatMessage({ id: 'config-sync.ConfigList.ConfigType' })}</Typography>
140143
</Th>
141144
<Th>
142-
<Typography variant="sigma">State</Typography>
145+
<Typography variant="sigma">{formatMessage({ id: 'config-sync.ConfigList.State' })}</Typography>
143146
</Th>
144147
</Tr>
145148
</Thead>

admin/src/components/ConfirmModal/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const ConfirmModal = ({ isOpen, onClose, onSubmit, type }) => {
2626
return (
2727
<Dialog
2828
onClose={onClose}
29-
title="Confirmation"
29+
title={formatMessage({ id: "config-sync.popUpWarning.Confirmation" })}
3030
isOpen={isOpen}
3131
>
3232
<DialogBody icon={<ExclamationMarkCircle />}>

admin/src/components/FirstExport/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { useState } from 'react';
2+
import { useIntl } from 'react-intl';
23
import { useDispatch } from 'react-redux';
34
import { NoContent, useNotification } from '@strapi/helper-plugin';
45
import { Button } from '@strapi/design-system';
@@ -10,6 +11,7 @@ const FirstExport = () => {
1011
const toggleNotification = useNotification();
1112
const dispatch = useDispatch();
1213
const [modalIsOpen, setModalIsOpen] = useState(false);
14+
const { formatMessage } = useIntl();
1315

1416
return (
1517
<div>
@@ -23,9 +25,9 @@ const FirstExport = () => {
2325
content={{
2426
id: 'emptyState',
2527
defaultMessage:
26-
'Looks like this is your first time using config-sync for this project.',
28+
formatMessage({ id: 'config-sync.FirstExport.Message' }),
2729
}}
28-
action={<Button onClick={() => setModalIsOpen(true)}>Make the initial export</Button>}
30+
action={<Button onClick={() => setModalIsOpen(true)}>{formatMessage({ id: 'config-sync.FirstExport.Button' })}</Button>}
2931
/>
3032
</div>
3133
);
Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
import React from 'react';
22
import { NoContent } from '@strapi/helper-plugin';
3+
import { useIntl } from 'react-intl';
34

4-
const NoChanges = () => (
5-
<NoContent
6-
content={{
7-
id: 'emptyState',
8-
defaultMessage:
9-
'No differences between DB and sync directory. You are up-to-date!',
10-
}}
11-
/>
12-
);
5+
const NoChanges = () => {
6+
const { formatMessage } = useIntl();
7+
return (
8+
<NoContent
9+
content={{
10+
id: 'emptyState',
11+
defaultMessage:
12+
formatMessage({ id: 'config-sync.NoChanges.Message' }),
13+
}}
14+
/>
15+
);
16+
};
1317

1418
export default NoChanges;

admin/src/translations/en.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,32 @@
77
"popUpWarning.button.export": "Yes, export",
88
"popUpWarning.button.cancel": "Cancel",
99
"popUpWarning.force": "Force",
10+
"popUpWarning.Confirmation": "Confirmation",
1011

1112
"Header.Title": "Config Sync",
1213
"Header.Description": "Manage your database config across environments.",
1314

15+
"ConfigList.Loading": "Loading content...",
16+
"ConfigList.SelectAll": "Select all entries",
17+
"ConfigList.ConfigName": "Config name",
18+
"ConfigList.ConfigType": "Config type",
19+
"ConfigList.State": "State",
20+
"ConfigList.Different": "Different",
21+
"ConfigList.OnlyDir": "Only in sync dir",
22+
"ConfigList.OnlyDB": "Only in DB",
23+
24+
"NoChanges.Message": "No differences between DB and sync directory. You are up-to-date!",
25+
26+
"ConfigDiff.Title": "Config changes for",
27+
"ConfigDiff.SyncDirectory": "Sync directory",
28+
"ConfigDiff.Database": "Database",
29+
30+
"Buttons.Export": "Export",
31+
"Buttons.Import": "Import",
32+
33+
"FirstExport.Message": "Looks like this is your first time using config-sync for this project.",
34+
"FirstExport.Button": "Make the initial export",
35+
1436
"Settings.Tool.Title": "Interface",
1537

1638
"plugin.name": "Config Sync"

admin/src/translations/es.json

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,39 @@
1-
{}
1+
{
2+
"popUpWarning.warning.import_1": "Si continuas todos tus ficheros de configuración locales",
3+
"popUpWarning.warning.import_2": "se importarán a la base de datos.",
4+
"popUpWarning.warning.export_1": "Si continuas las configuraciones de tu base de datos",
5+
"popUpWarning.warning.export_2": "se escribirán en ficheros de configuración locales.",
6+
"popUpWarning.button.import": "Sí, importar",
7+
"popUpWarning.button.export": "Sí, exportar",
8+
"popUpWarning.button.cancel": "Cancelar",
9+
"popUpWarning.force": "Forzar",
10+
"popUpWarning.Confirmation": "Confirmación",
11+
12+
"Header.Title": "Config Sync",
13+
"Header.Description": "Gestiona las configuraciones de tu base de datos entre diferentes entornos o instancias.",
14+
15+
"ConfigList.Loading": "Cargando contenido...",
16+
"ConfigList.SelectAll": "Seleccionar todas las entradas",
17+
"ConfigList.ConfigName": "Nombre",
18+
"ConfigList.ConfigType": "Tipo",
19+
"ConfigList.State": "Estado",
20+
"ConfigList.Different": "Diferentes",
21+
"ConfigList.OnlyDir": "Sólo en directorio de sincronización",
22+
"ConfigList.OnlyDB": "Sólo en la base de datos",
23+
24+
"NoChanges.Message": "No hay diferencia entre la base de datos y el directorio de sincronización. ¡Estás actualizado!",
25+
26+
"ConfigDiff.Title": "Cambios en la configuración para",
27+
"ConfigDiff.SyncDirectory": "Directorio de sincronización",
28+
"ConfigDiff.Database": "Base de datos",
29+
30+
"Buttons.Import": "Importar",
31+
"Buttons.Export": "Exportar",
32+
33+
"FirstExport.Message": "Parece ser la primera vez que se usa config-sync en este proyecto.",
34+
"FirstExport.Button": "Hacer la exportación inicial",
35+
36+
"Settings.Tool.Title": "Interfaz",
37+
38+
"plugin.name": "Config Sync"
39+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "strapi-plugin-config-sync",
3-
"version": "1.1.3",
3+
"version": "1.1.4",
44
"description": "Migrate your config data across environments using the CLI or Strapi admin panel.",
55
"strapi": {
66
"displayName": "Config Sync",

0 commit comments

Comments
 (0)