Skip to content

Commit

Permalink
Update translation support on 'users-permissions' , 'upload' and 'con…
Browse files Browse the repository at this point in the history
…tent-manager' plugin (#6439)

* fix: add Enable, Disable, and Done trad on email plugin

Signed-off-by: Fadhil Ahmad <fadzbobby95@gmail.com>

* fix: add translation for dinamic zone required component error

Signed-off-by: Fadhil Ahmad <fadzbobby95@gmail.com>

* fix: back to form.button.done, turns out other dont have form.button.done on strapi-admin

Signed-off-by: Fadhil Ahmad <fadzbobby95@gmail.com>

* feat: add replace media translation support

Signed-off-by: Fadhil Ahmad <fadzbobby95@gmail.com>
  • Loading branch information
fadhilx committed Jun 15, 2020
1 parent ba6695a commit d58a55d
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ const DynamicZone = ({ max, min, name }) => {
}}
/>
{hasRequiredError && !isOpen && !hasMaxError && (
<div className="error-label">Component is required</div>
<div className="error-label">
<FormattedMessage id={`${pluginId}.components.DynamicZone.required`} />
</div>
)}
{hasMaxError && !isOpen && (
<div className="error-label">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"components.DraggableAttr.edit": "Click to edit",
"components.DynamicZone.add-compo": "Add to {componentName}",
"components.DynamicZone.pick-compo": "Pick one component",
"components.DynamicZone.required": "Component is required",
"components.DynamicZone.missing.singular": "There is {count} missing component",
"components.DynamicZone.missing.plural": "There is {count} missing components",
"components.EmptyAttributesBlock.button": "Go to settings page",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ const InputModalStepper = ({ isOpen, onToggle, noNavigation, onInputMediaChange
onClick={handleReplaceMedia}
style={{ marginRight: 10 }}
>
Replace media
{formatMessage({ id: getTrad('control-card.replace-media') })}
</Button>

<Button
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ const ModalStepper = ({
onClick={handleReplaceMedia}
style={{ marginRight: 10 }}
>
Replace media
{formatMessage({ id: getTrad('control-card.replace-media') })}
</Button>

<Button
Expand Down
3 changes: 2 additions & 1 deletion packages/strapi-plugin-upload/admin/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"control-card.crop": "Crop",
"control-card.delete": "Delete",
"control-card.download": "Download",
"control-card.replace-media": "Replace Media",
"control-card.edit": "Edit",
"control-card.save": "Save",
"form.input.label.file-alt": "Alternative text",
Expand Down Expand Up @@ -71,4 +72,4 @@
"sort.updated_at_desc": "Most recent updates",
"window.confirm.close-modal.files": "Are you sure? You have some files that have not been uploaded yet.",
"window.confirm.close-modal.file": "Are you sure? Your changes will be lost."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { FormattedMessage } from 'react-intl';
import { capitalize, get, includes } from 'lodash';
import { IconLinks } from '@buffetjs/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

import getTrad from '../../utils/getTrad';
import { PopUpWarning } from 'strapi-helper-plugin';
import en from '../../translations/en.json';
import { HomePageContext } from '../../contexts/HomePage';
Expand Down Expand Up @@ -93,9 +93,13 @@ class ListRow extends React.Component {
</div>
<div className="col-md-6" style={{ fontWeight: '500' }}>
{get(this.props.values, [get(this.props.item, 'name'), 'enabled']) ? (
<span style={{ color: '#5A9E06' }}>Enabled</span>
<span style={{ color: '#5A9E06' }}>
<FormattedMessage id={getTrad('ListRow.enabled')} />
</span>
) : (
<span style={{ color: '#F64D0A' }}>Disabled</span>
<span style={{ color: '#F64D0A' }}>
<FormattedMessage id={getTrad('ListRow.disabled')} />
</span>
)}
</div>
<div className="col-md-2">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
"List.title.providers.enabled.singular": "{number} provider is enabled and",
"List.title.roles.plural": "{number} roles are available",
"List.title.roles.singular": "{number} role is available",
"ListRow.enabled": "Enabled",
"ListRow.disabled": "Disabled",
"Plugin.permissions.application.description": "Define all your project's allowed actions.",
"Plugin.permissions.plugins.description": "Define all allowed actions for the {name} plugin.",
"Plugins.header.description": "Only actions bound by a route are listed below.",
Expand Down

0 comments on commit d58a55d

Please sign in to comment.