Skip to content

Commit 0f23277

Browse files
authored
release: fixes
- Fix: text changes - Fix: image size generation on import - Fix: Improved text translations
2 parents 1891586 + d5ed955 commit 0f23277

File tree

12 files changed

+106
-54
lines changed

12 files changed

+106
-54
lines changed

assets/src/Components/CloudLibrary/DemoSiteTemplatesImport.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ const DemoSiteTemplatesImport = ( {
9797
return <Spinner />;
9898
}
9999
if ( templates.length < 1 ) {
100-
return __( 'No templates for this starter site.' );
100+
return __( 'No templates for this starter site.', 'templates-patterns-collection' );
101101
}
102102

103103
return (
@@ -126,7 +126,7 @@ const DemoSiteTemplatesImport = ( {
126126
<div className="breadcrumb">
127127
<Button isTertiary onClick={ cancel }>
128128
<Icon icon={chevronLeft} />
129-
{ __( 'Back to Starter Sites' ) }
129+
{ __( 'Back to Starter Sites', 'templates-patterns-collection' ) }
130130
</Button>
131131
</div>
132132
<div className="header">
@@ -147,7 +147,7 @@ const DemoSiteTemplatesImport = ( {
147147
</h1>
148148
<p className="description">
149149
{ __(
150-
'You can import individual pages or bulk-import all of them.'
150+
'You can import individual pages or bulk-import all of them.', 'templates-patterns-collection'
151151
) }
152152
</p>
153153
</div>
@@ -156,14 +156,14 @@ const DemoSiteTemplatesImport = ( {
156156
{ ! upsell && (
157157
<>
158158
<Button isSecondary onClick={ launchImport }>
159-
{ __( 'Import Starter Site' ) }
159+
{ __( 'Import Starter Site', 'templates-patterns-collection' ) }
160160
</Button>
161161
<Button
162162
isPrimary
163163
disabled={ templates.length < 1 }
164164
onClick={ handleBulk }
165165
>
166-
{ __( 'Import All Pages' ) }
166+
{ __( 'Import All Pages', 'templates-patterns-collection' ) }
167167
</Button>
168168
</>
169169
) }
@@ -172,7 +172,7 @@ const DemoSiteTemplatesImport = ( {
172172
href={ utmOutboundLink || tiobDash.upgradeURL }
173173
isSecondary
174174
>
175-
{ __( 'Upgrade' ) }
175+
{ __( 'Upgrade', 'templates-patterns-collection' ) }
176176
</Button>
177177
) }
178178
</div>
@@ -219,7 +219,7 @@ const DemoSiteTemplatesImport = ( {
219219
isSecondary
220220
onClick={ launchImport }
221221
>
222-
{ __( 'Import Starter Site' ) }
222+
{ __( 'Import Starter Site', 'templates-patterns-collection' ) }
223223
</Button>
224224
<Button
225225
isPrimary
@@ -230,7 +230,7 @@ const DemoSiteTemplatesImport = ( {
230230
)
231231
}
232232
>
233-
{ __( 'Import Page' ) }
233+
{ __( 'Import Page', 'templates-patterns-collection' ) }
234234
</Button>
235235
</>
236236
) }
@@ -241,7 +241,7 @@ const DemoSiteTemplatesImport = ( {
241241
}
242242
isSecondary
243243
>
244-
{ __( 'Upgrade' ) }
244+
{ __( 'Upgrade', 'templates-patterns-collection' ) }
245245
</Button>
246246
) }
247247
</>

assets/src/Components/CloudLibrary/Library.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,15 +81,15 @@ const Library = ( {
8181

8282
const EDITORS = {
8383
gutenberg: {
84-
label: __( 'Gutenberg' ),
84+
label: __( 'Gutenberg', 'templates-patterns-collection' ),
8585
icon: 'gutenberg.jpg',
8686
},
8787
elementor: {
88-
label: __( 'Elementor' ),
88+
label: __( 'Elementor', 'templates-patterns-collection' ),
8989
icon: 'elementor.jpg',
9090
},
9191
beaver: {
92-
label: __( 'Beaver' ),
92+
label: __( 'Beaver', 'templates-patterns-collection' ),
9393
icon: 'beaver.jpg',
9494
},
9595
};
@@ -322,7 +322,7 @@ const Library = ( {
322322
href={upgradeURLTpc}
323323
target="_blank"
324324
>
325-
{ __( 'Upgrade to PRO' ) }
325+
{ __( 'Upgrade to PRO', 'templates-patterns-collection' ) }
326326
</Button>
327327
) }
328328

@@ -345,7 +345,7 @@ const Library = ( {
345345
if ( ! userStatus && ! isGeneral ) {
346346
return (
347347
<UpsellModal
348-
title={ __( 'Templates Cloud is a PRO Feature' ) }
348+
title={ __( 'Templates Cloud is a PRO Feature', 'templates-patterns-collection' ) }
349349
description={ __(
350350
'Unlock the Templates Cloud features and save your pages or posts in the cloud.',
351351
'template-patterns-collection'
@@ -454,12 +454,12 @@ const Library = ( {
454454
src={
455455
window.tiobDash.assets + '/img/layout.jpg'
456456
}
457-
alt={ __( 'No Templates Found' ) }
457+
alt={ __( 'No Templates Found', 'templates-patterns-collection' ) }
458458
/>
459-
<h3>{ __( 'There are no templates yet' ) }</h3>
459+
<h3>{ __( 'There are no templates yet', 'templates-patterns-collection' ) }</h3>
460460
<p>
461461
{ __(
462-
'You can add a page or post to the cloud by accessing it with the WordPress or Elementor/Beaver editor. Learn more about this in our docs.'
462+
'You can add a page or post to the cloud by accessing it with the WordPress or Elementor/Beaver editor. Learn more about this in our docs.', 'templates-patterns-collection'
463463
) }
464464
</p>
465465
<Button
@@ -468,7 +468,7 @@ const Library = ( {
468468
href="https://docs.themeisle.com/article/1354-neve-template-cloud-library?utm_medium=nevedashboard&utm_source=wpadmin&utm_campaign=templatescloud&utm_content=neve"
469469
target="_blank"
470470
>
471-
{ __( 'Learn more' ) }
471+
{ __( 'Learn more', 'templates-patterns-collection' ) }
472472
</Button>
473473
</div>
474474
) ) }
@@ -480,7 +480,7 @@ const Library = ( {
480480
isPrimary
481481
onClick={ () => handleImport( previewedItem ) }
482482
>
483-
{ __( 'Import Template' ) }
483+
{ __( 'Import Template', 'templates-patterns-collection' ) }
484484
</Button>
485485
}
486486
heading={ previewedItem.template_name }

assets/src/Components/Header.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,12 @@ const TabNavigation = ( { setCurrentTab, currentTab, isFetching, license } ) =>
9595
<Button
9696
icon={ update }
9797
onClick={ sync }
98-
label={ __( 'Re-sync Library' ) }
98+
label={ __( 'Re-sync Library', 'templates-patterns-collection' ) }
9999
className={ classnames( 'is-icon-btn', {
100100
'is-loading': isSyncing,
101101
} ) }
102102
disabled={ isFetching || isSyncing }
103-
data-content={ __( 'Sync' ) }
103+
data-content={ __( 'Sync', 'templates-patterns-collection' ) }
104104
/>
105105
) }
106106
{ currentTab !== 'starterSites' && (
@@ -110,12 +110,12 @@ const TabNavigation = ( { setCurrentTab, currentTab, isFetching, license } ) =>
110110
onClick={ () => {
111111
setLicenseOpen( ! isLicenseOpen );
112112
} }
113-
label={ __( 'License' ) }
113+
label={ __( 'License', 'templates-patterns-collection' ) }
114114
className={ classnames( 'is-icon-btn', {
115115
'is-not-valid': ! isLicenseOpen && ! isValid,
116116
'is-valid': ! isLicenseOpen && isValid,
117117
} ) }
118-
data-content={ __( 'License' ) }
118+
data-content={ __( 'License', 'templates-patterns-collection' ) }
119119
/>
120120
{ isLicenseOpen && <License /> }
121121
</>

assets/src/utils/common.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ const TAGS = [
3333
__( 'Photography', 'templates-patterns-collection' ),
3434
];
3535
const CATEGORIES = {
36-
all: __( 'All Categories' ),
37-
free: __( 'Free' ),
38-
business: __( 'Business' ),
39-
portfolio: __( 'Portfolio' ),
40-
woocommerce: __( 'WooCommerce' ),
41-
blog: __( 'Blog' ),
42-
personal: __( 'Personal' ),
43-
other: __( 'Other' ),
36+
all: __( 'All Categories', 'templates-patterns-collection' ),
37+
free: __( 'Free', 'templates-patterns-collection' ),
38+
business: __( 'Business', 'templates-patterns-collection' ),
39+
portfolio: __( 'Portfolio', 'templates-patterns-collection' ),
40+
woocommerce: __( 'WooCommerce', 'templates-patterns-collection' ),
41+
blog: __( 'Blog', 'templates-patterns-collection' ),
42+
personal: __( 'Personal', 'templates-patterns-collection' ),
43+
other: __( 'Other', 'templates-patterns-collection' ),
4444
};
4545
const EDITOR_MAP = {
4646
gutenberg: {

beaver/src/export.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ if ( parseInt( window.tiTpc.tier ) === 3 ) {
5353
// eslint-disable-next-line prettier/prettier
5454
'<li><a class=\"fl-block-row-reset\" href=\"javascript:void(0);\">Reset Row Width</a></li>',
5555
// eslint-disable-next-line prettier/prettier
56-
'<li><a class=\"fl-block-row-reset\" href=\"javascript:void(0);\">Reset Row Width</a></li><li><a class=\"fl-block-row-tpc-export\" onclick="window.tiTpc.tpcExport(this)" href=\"javascript:void(0);\">Save to Neve Cloud</a></li>'
56+
'<li><a class=\"fl-block-row-reset\" href=\"javascript:void(0);\">Reset Row Width</a></li><li><a class=\"fl-block-row-tpc-export\" onclick="window.tiTpc.tpcExport(this)" href=\"javascript:void(0);\">Save to Templates Cloud</a></li>'
5757
);
5858
}
5959

editor/src/extension.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ const Exporter = () => {
110110
link: select( 'core/editor' ).getEditedPostAttribute( 'link' ),
111111
postTitle:
112112
select( 'core/editor' ).getEditedPostAttribute( 'title' ) ||
113-
__( 'Template' ),
113+
__( 'Template', 'templates-patterns-collection' ),
114114
} ) );
115115

116116
const isPostSaving = useSelect( ( select, { forceIsSaving } ) => {
@@ -187,7 +187,7 @@ const Exporter = () => {
187187
message === 'Sorry, you are not allowed to do that.'
188188
) {
189189
message = __(
190-
'Could not save template, check that the template is not empty.'
190+
'Could not save template, check that the template is not empty.', 'templates-patterns-collection'
191191
);
192192
}
193193
createErrorNotice( message, {
@@ -196,7 +196,7 @@ const Exporter = () => {
196196
} else {
197197
window.localStorage.setItem( 'tpcCacheBuster', uuidv4() );
198198

199-
createSuccessNotice( __( 'Template saved.' ), {
199+
createSuccessNotice( __( 'Template saved.', 'templates-patterns-collection' ), {
200200
type: 'snackbar',
201201
} );
202202
}
@@ -276,7 +276,7 @@ const Exporter = () => {
276276
message === 'Sorry, you are not allowed to do that.'
277277
) {
278278
message = __(
279-
'Could not save template, check that the template is not empty.'
279+
'Could not save template, check that the template is not empty.', 'templates-patterns-collection'
280280
);
281281
}
282282
createErrorNotice( message, {
@@ -285,7 +285,7 @@ const Exporter = () => {
285285
} else {
286286
window.localStorage.setItem( 'tpcCacheBuster', uuidv4() );
287287

288-
createSuccessNotice( __( 'Template saved.' ), {
288+
createSuccessNotice( __( 'Template saved.', 'templates-patterns-collection' ), {
289289
type: 'snackbar',
290290
} );
291291

@@ -327,8 +327,8 @@ const Exporter = () => {
327327
saveMeta();
328328
createSuccessNotice(
329329
published
330-
? __( 'Template Unpublished.' )
331-
: __( 'Template Published.' ),
330+
? __( 'Template Unpublished.', 'templates-patterns-collection' )
331+
: __( 'Template Published.', 'templates-patterns-collection' ),
332332
{
333333
type: 'snackbar',
334334
}
@@ -349,12 +349,12 @@ const Exporter = () => {
349349
>
350350
{ published &&
351351
( 'publishing' === isLoading
352-
? __( 'Unpublishing' )
353-
: __( 'Unpublish' ) ) }
352+
? __( 'Unpublishing', 'templates-patterns-collection' )
353+
: __( 'Unpublish', 'templates-patterns-collection' ) ) }
354354
{ ! published &&
355355
( 'publishing' === isLoading
356-
? __( 'Publishing' )
357-
: __( 'Publish' ) ) }
356+
? __( 'Publishing', 'templates-patterns-collection' )
357+
: __( 'Publish', 'templates-patterns-collection' ) ) }
358358
</Button>
359359
);
360360
};
@@ -385,7 +385,7 @@ const Exporter = () => {
385385
return (
386386
<Fragment>
387387
<PluginBlockSettingsMenuItem
388-
label={ __( 'Save to Neve Cloud' ) }
388+
label={ __( 'Save to Templates Cloud', 'templates-patterns-collection' ) }
389389
icon={ 'none' } // We don't want an icon, as new UI of Gutenberg does't have icons for Menu Items, but the component doesn't allow that so we pass an icon which doesn't exist.
390390
onClick={ () => setOpen( true ) }
391391
/>
@@ -413,7 +413,7 @@ const Exporter = () => {
413413
disabled={ isLoading }
414414
onClick={ onSavePage }
415415
>
416-
{ __( 'Save Page to Neve Cloud' ) }
416+
{ __( 'Save Page to Templates Cloud' ) }
417417
</Button>
418418

419419
<ToggleControl

includes/Admin.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* @package templates-patterns-collection
1616
*/
1717
class Admin {
18+
const API = 'api.themeisle.com';
1819

1920
/**
2021
* Admin page slug
@@ -374,7 +375,11 @@ public function localize_sites_library( $array ) {
374375
if ( $this->is_agency_plan() && ! $page_was_visited ) {
375376
$array['notifications']['template-cloud'] = array(
376377
'text' => __( 'Great news! Now you can export your own custom designs to the cloud and then reuse them on other sites.', 'templates-patterns-collection' ),
377-
'cta' => sprintf( __( 'Open %s', 'templates-patterns-collection' ), 'Templates Cloud' ),
378+
'cta' => sprintf(
379+
// translators: %s: Templates Cloud
380+
__( 'Open %s', 'templates-patterns-collection' ),
381+
'Templates Cloud'
382+
),
378383
'url' => 'themes.php?page=' . $this->page_slug . '&dismiss_notice=yes#library',
379384
);
380385
}
@@ -398,6 +403,14 @@ public function get_sites_data() {
398403
foreach ( $sites as $builder => $sites_for_builder ) {
399404
foreach ( $sites_for_builder as $slug => $data ) {
400405
$sites[ $builder ][ $slug ]['slug'] = $slug;
406+
if ( defined( 'TPC_REPLACE_API_SRC' ) && TPC_REPLACE_API_SRC === true ) {
407+
$api_src = defined( 'TPC_API_SRC' ) && ! empty( TPC_API_SRC ) ? TPC_API_SRC : self::API;
408+
409+
if ( isset( $sites[ $builder ][ $slug ]['remote_url'] ) ) {
410+
$sites[ $builder ][ $slug ]['remote_url'] = str_replace( self::API, $api_src, $sites[ $builder ][ $slug ]['remote_url'] );
411+
}
412+
$sites[ $builder ][ $slug ]['screenshot'] = str_replace( self::API, $api_src, $sites[ $builder ][ $slug ]['screenshot'] );
413+
}
401414
if ( ! isset( $data['upsell'] ) || $data['upsell'] !== true ) {
402415
continue;
403416
}

includes/Elementor.php

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function register_script() {
5656
'postType' => get_post_type(),
5757
'placeholderIndex' => '-1',
5858
'exporter' => array(
59-
'exportLabel' => sprintf( __( 'Save to %s', 'templates-patterns-collection' ), 'Neve Cloud' ),
59+
'exportLabel' => sprintf( __( 'Save to %s', 'templates-patterns-collection' ), 'Templates Cloud' ),
6060
'modalLabel' => __( 'Save Templates', 'templates-patterns-collection' ),
6161
'textLabel' => __( 'Template Name', 'templates-patterns-collection' ),
6262
'textPlaceholder' => __( 'Template', 'templates-patterns-collection' ),
@@ -67,16 +67,28 @@ public function register_script() {
6767
'templateUnpublished' => __( 'Template Unpublished.', 'templates-patterns-collection' ),
6868
),
6969
'library' => array(
70-
'libraryButton' => sprintf( __( 'Import from %s', 'templates-patterns-collection' ), 'Templates Cloud' ),
70+
'libraryButton' => sprintf(
71+
// translators: %s: Templates Cloud
72+
__( 'Import from %s', 'templates-patterns-collection' ),
73+
'Templates Cloud'
74+
),
7175
'templatesCloud' => 'Templates Cloud',
72-
'historyMessage' => sprintf( __( 'Add Template from %s:', 'templates-patterns-collection' ), 'Templates Cloud' ),
76+
'historyMessage' => sprintf(
77+
// translators: %s: Templates Cloud
78+
__( 'Add Template from %s:', 'templates-patterns-collection' ),
79+
'Templates Cloud'
80+
),
7381
'tabs' => array(
7482
'templates' => __( 'Page Templates', 'templates-patterns-collection' ),
7583
'library' => __( 'My Library', 'templates-patterns-collection' ),
7684
),
7785
'actions' => array(
7886
'sync' => __( 'Sync Library', 'templates-patterns-collection' ),
79-
'save' => sprintf( __( 'Save to %s', 'templates-patterns-collection' ), 'Neve Cloud' ),
87+
'save' => sprintf(
88+
// translators: %s: Templates Cloud
89+
__( 'Save to %s', 'templates-patterns-collection' ),
90+
'Templates Cloud'
91+
),
8092
'close' => __( 'Close', 'templates-patterns-collection' ),
8193
'cancel' => __( 'Cancel', 'templates-patterns-collection' ),
8294
'edit' => __( 'Edit', 'templates-patterns-collection' ),
@@ -98,7 +110,11 @@ public function register_script() {
98110
),
99111
'export' => array(
100112
'save' => __( 'Save', 'templates-patterns-collection' ),
101-
'title' => sprintf( __( 'Save your page to %s', 'templates-patterns-collection' ), 'Templates Cloud' ),
113+
'title' => sprintf(
114+
// translators: %s: Templates Cloud
115+
__( 'Save your page to %s', 'templates-patterns-collection' ),
116+
'Templates Cloud'
117+
),
102118
'placeholder' => __( 'Enter Template Name', 'templates-patterns-collection' ),
103119
'labelScreenshot' => __( 'Screenshot URL', 'templates-patterns-collection' ),
104120
'labelSlug' => __( 'Site Slug', 'templates-patterns-collection' ),

0 commit comments

Comments
 (0)