Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix String Translation in image image.js #547

Merged
merged 8 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/blocks/image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ export function ImageEdit(props) {
const isExternal = isExternalImage(id, url);
const src = isExternal ? url : undefined;
const mediaPreview = !!url && (
<img alt={__('Edit image')} title={__('Edit image')} className={'edit-image-preview'} src={url} />
<img alt={__('Edit image', 'kadence-blocks')} title={__('Edit image', 'kadence-blocks')} className={'edit-image-preview'} src={url} />
);
const previewMarginTop = getPreviewSize(
previewDevice,
Expand Down
10 changes: 5 additions & 5 deletions src/blocks/image/image-editing/aspect-ratio-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function AspectRatioDropdown({ toggleProps }) {
return (
<DropdownMenu
icon={aspectRatioIcon}
label={__('Aspect Ratio')}
label={__('Aspect Ratio', 'kadence-blocks')}
popoverProps={POPOVER_PROPS}
toggleProps={toggleProps}
className="wp-block-kadence-image__aspect-ratio"
Expand All @@ -54,17 +54,17 @@ export default function AspectRatioDropdown({ toggleProps }) {
value={aspect}
aspectRatios={[
{
title: __('Original'),
title: __('Original', 'kadence-blocks'),
aspect: defaultAspect,
},
{
title: __('Square'),
title: __('Square', 'kadence-blocks'),
aspect: 1,
},
]}
/>
<AspectGroup
label={__('Landscape')}
label={__('Landscape', 'kadence-blocks')}
isDisabled={isInProgress}
onClick={(newAspect) => {
setAspect(newAspect);
Expand All @@ -91,7 +91,7 @@ export default function AspectRatioDropdown({ toggleProps }) {
]}
/>
<AspectGroup
label={__('Portrait')}
label={__('Portrait', 'kadence-blocks')}
isDisabled={isInProgress}
onClick={(newAspect) => {
setAspect(newAspect);
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/image/image-editing/form-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ export default function FormControls() {
return (
<>
<ToolbarButton onClick={apply} disabled={isInProgress}>
{__('Apply')}
{__('Apply', 'kadence-blocks')}
</ToolbarButton>
<ToolbarButton onClick={cancel}>{__('Cancel')}</ToolbarButton>
<ToolbarButton onClick={cancel}>{__('Cancel', 'kadence-blocks')}</ToolbarButton>
</>
);
}
2 changes: 1 addition & 1 deletion src/blocks/image/image-editing/rotation-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ import { useImageEditingContext } from './context';
export default function RotationButton() {
const { isInProgress, rotateClockwise } = useImageEditingContext();
return (
<ToolbarButton icon={rotateRightIcon} label={__('Rotate')} onClick={rotateClockwise} disabled={isInProgress} />
<ToolbarButton icon={rotateRightIcon} label={__('Rotate', 'kadence-blocks')} onClick={rotateClockwise} disabled={isInProgress} />
);
}
2 changes: 1 addition & 1 deletion src/blocks/image/image-editing/use-save-image.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function useSaveImage({ crop, rotation, height, width, aspect, ur
createErrorNotice(
sprintf(
/* translators: 1. Error message */
__('Could not edit image. %s'),
__('Could not edit image. %s', 'kadence-blocks'),
error.message
),
{
Expand Down
4 changes: 2 additions & 2 deletions src/blocks/image/image-editing/zoom-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export default function ZoomDropdown() {
renderToggle={({ isOpen, onToggle }) => (
<ToolbarButton
icon={search}
label={__('Zoom')}
label={__('Zoom', 'kadence-blocks')}
onClick={onToggle}
aria-expanded={isOpen}
disabled={isInProgress}
/>
)}
renderContent={() => (
<RangeControl
label={__('Zoom')}
label={__('Zoom', 'kadence-blocks')}
min={MIN_ZOOM}
max={MAX_ZOOM}
value={Math.round(zoom)}
Expand Down
10 changes: 5 additions & 5 deletions src/blocks/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ export default function Image({
}}
icon={captionIcon}
isPressed={stateShowCaption}
label={stateShowCaption ? __('Remove caption') : __('Add caption')}
label={stateShowCaption ? __('Remove caption', 'kadence-blocks') : __('Add caption', 'kadence-blocks')}
/>
)}
{!isEditingImage && !isDynamic && !isDynamicLink && (
Expand Down Expand Up @@ -593,7 +593,7 @@ export default function Image({
context={context}
/>
)}
{allowCrop && <ToolbarButton onClick={() => setIsEditingImage(true)} icon={crop} label={__('Crop')} />}
{allowCrop && <ToolbarButton onClick={() => setIsEditingImage(true)} icon={crop} label={__('Crop', 'kadence-blocks')} />}
{externalBlob && !isDynamic && (
<ToolbarButton
onClick={uploadExternal}
Expand Down Expand Up @@ -1290,7 +1290,7 @@ export default function Image({
</>
)}
<SelectControl
label={__('Blend Mode')}
label={__('Blend Mode', 'kadence-blocks')}
value={overlayBlendMode ? overlayBlendMode : 'none'}
options={BLEND_OPTIONS}
onChange={(value) => setAttributes({ overlayBlendMode: value })}
Expand Down Expand Up @@ -1445,11 +1445,11 @@ export default function Image({
} else if (filename) {
defaultedAlt = sprintf(
/* translators: %s: file name */
__('This image has an empty alt attribute; its file name is %s'),
__('This image has an empty alt attribute; its file name is %s', 'kadence-blocks'),
filename
);
} else {
defaultedAlt = __('This image has an empty alt attribute');
defaultedAlt = __('This image has an empty alt attribute', 'kadence-blocks');
}
let hasMask = false;
let theMaskRepeat = 'no-repeat';
Expand Down
Loading