Skip to content

Commit 27a298e

Browse files
refactor: tweaks on translation
1 parent 75d5d17 commit 27a298e

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

js/ActionPopup/SortableItem.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import { SortableElement, sortableHandle } from 'react-sortable-hoc';
3-
import { __ } from '@wordpress/i18n';
3+
import { __, sprintf } from '@wordpress/i18n';
44
import { unescape } from 'lodash';
55
import {
66
Icon,
@@ -168,7 +168,14 @@ const SortableItem = ({ propRef, loopIndex, item }) => {
168168
<BaseControl>
169169
<TextareaControl
170170
label={ __( 'Main Prompt', 'feedzy-rss-feeds' ) }
171-
help={__( 'You can use {content} in the textarea such as: "Rephrase my {content} for better SEO.".', 'feedzy-rss-feeds' )}
171+
help={
172+
sprintf(
173+
// translators: %1$s is the tag content: {content}, %2$s is the tag content: {content}
174+
__( 'You can use %1$s in the textarea such as: "Rephrase my %2$s for better SEO."', 'feedzy-rss-feeds' ),
175+
'{content}',
176+
'{content}'
177+
)
178+
}
172179
value={ item.data.ChatGPT ? unescape(item.data.ChatGPT.replaceAll('&#039;', '\'')) : '' }
173180
onChange={ ( currentValue ) => propRef.onChangeHandler( { 'index': loopIndex, 'ChatGPT': currentValue ?? '' } ) }
174181
disabled={!feedzyData.isPro || !feedzyData.apiLicenseStatus.openaiStatus}

js/FeedzyBlock/Editor.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const { date } = wp.date;
2626
import queryString from 'query-string';
2727
import Inspector from './inspector';
2828
import { unescapeHTML, filterData, inArray, arrangeMeta, filterCustomPattern } from './utils';
29+
import { RawHTML } from '@wordpress/element';
2930

3031
class Editor extends Component {
3132
/*eslint-env es6*/
@@ -422,14 +423,16 @@ class Editor extends Component {
422423
( ! feedzyjs.isPro ) && (
423424
<div className="fz-source-upgrade-alert">
424425
<strong>{ __( 'NEW!', 'feedzy-rss-feeds' ) } </strong>
425-
{
426-
sprintf(
427-
// translators: %1$s: opening anchor tag, %2$s: closing anchor tag
428-
__( 'Enable Amazon Product Advertising feeds to generate affiliate revenue by %1$s upgrading to Feedzy Pro. %2$s', 'feedzy-rss-feeds' ),
429-
`<a target="_blank" href="${feedzyjs?.upsellLinkBlockEditor}">`,
430-
'</a>'
431-
)
432-
}
426+
<RawHTML>
427+
{
428+
sprintf(
429+
// translators: %1$s: opening anchor tag, %2$s: closing anchor tag
430+
__( 'Enable Amazon Product Advertising feeds to generate affiliate revenue by %1$s upgrading to Feedzy Pro. %2$s', 'feedzy-rss-feeds' ),
431+
`<a target="_blank" href="${feedzyjs?.upsellLinkBlockEditor}">`,
432+
'</a>'
433+
)
434+
}
435+
</RawHTML>
433436
</div>
434437
),
435438
( this.state.error ) && <div>{ __( 'Feed URL is invalid or unreachable by WordPress SimplePie and will NOT display items.', 'feedzy-rss-feeds') }</div>,
@@ -486,10 +489,10 @@ class Editor extends Component {
486489
}
487490

488491
let meta_values = new Object();
489-
meta_values['author'] = __( 'by' ) + ' ' + author;
490-
meta_values['date'] = __( 'on' ) + ' ' + unescapeHTML( itemDate );
491-
meta_values['time'] = __( 'at' ) + ' ' + unescapeHTML( itemTime );
492-
meta_values['categories'] = __( 'in' ) + ' ' + unescapeHTML( categories );
492+
meta_values['author'] = __( 'by', 'feedzy-rss-feeds' ) + ' ' + author;
493+
meta_values['date'] = __( 'on', 'feedzy-rss-feeds' ) + ' ' + unescapeHTML( itemDate );
494+
meta_values['time'] = __( 'at', 'feedzy-rss-feeds' ) + ' ' + unescapeHTML( itemTime );
495+
meta_values['categories'] = __( 'in', 'feedzy-rss-feeds' ) + ' ' + unescapeHTML( categories );
493496

494497
return (
495498
<li key={i} style={ { padding: '15px 0 25px' } } className={ `rss_item feedzy-rss-col-${ this.props.attributes.columns }` }>

js/FeedzyBlock/inspector.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
/**
44
* Block dependencies
55
*/
6+
import { RawHTML } from '@wordpress/element';
67
import RadioImageControl from './radio-image-control/';
78

89
/**
@@ -110,6 +111,7 @@ class Inspector extends Component {
110111
{(this.props.attributes.status !== 0 && !feedzyjs.isPro) && [
111112
<div className="fz-upgrade-alert">
112113
<strong>{ __( 'NEW!', 'feedzy-rss-feeds' ) } </strong>
114+
<RawHTML>
113115
{
114116
sprintf(
115117
// translators: %1$s: opening anchor tag, %2$s: closing anchor tag
@@ -118,6 +120,7 @@ class Inspector extends Component {
118120
'</a>'
119121
)
120122
}
123+
</RawHTML>
121124
<Dashicon icon="no-alt" onClick={(el) => {el.target.parentNode.style.display="none"}}/>
122125
</div>
123126
]}

0 commit comments

Comments
 (0)