Skip to content

Commit 799e394

Browse files
feat (TCDICORE-534): make posts pagination translatable
1 parent 0b64e00 commit 799e394

5 files changed

Lines changed: 33 additions & 4 deletions

File tree

plugins/wp-react-blocks-plugin/blocks/posts-pagination/BlockEdit.jsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ class BlockEdit extends BlockEditWithFilters {
1717
numberOfItemsPerPage,
1818
wordpressSource,
1919
wordpressSourceType,
20+
pageLabel,
21+
ofLabel,
2022
}
2123
} = this.props;
2224

@@ -39,6 +41,22 @@ class BlockEdit extends BlockEditWithFilters {
3941
/>
4042
</PanelRow>
4143
</PanelBody>
44+
<PanelBody title={__("Pagination Labels")}>
45+
<PanelRow>
46+
<TextControl
47+
label={__('"Page" label')}
48+
value={pageLabel}
49+
onChange={(pageLabel) => setAttributes({ pageLabel })}
50+
/>
51+
</PanelRow>
52+
<PanelRow>
53+
<TextControl
54+
label={__('"of" label')}
55+
value={ofLabel}
56+
onChange={(ofLabel) => setAttributes({ ofLabel })}
57+
/>
58+
</PanelRow>
59+
</PanelBody>
4260

4361
{this.renderWordpressSource()}
4462

plugins/wp-react-blocks-plugin/blocks/posts-pagination/BlockSave.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ const BlockSave = (props) => {
77
numberOfItemsPerPage,
88
wordpressSource,
99
wordpressSourceType,
10+
pageLabel,
11+
ofLabel,
1012
}
1113
} = props;
1214

@@ -22,6 +24,8 @@ const BlockSave = (props) => {
2224
data-number-of-items-per-page={numberOfItemsPerPage}
2325
data-wordpress-source={wordpressSource}
2426
data-wordpress-source-type={wordpressSourceType}
27+
data-page-label={pageLabel}
28+
data-of-label={ofLabel}
2529
></div>
2630
);
2731
};

plugins/wp-react-blocks-plugin/blocks/posts-pagination/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ registerBlockType(BLOCKS_NS + '/posts-pagination',
2626
wordpressSourceType: {
2727
type: 'string',
2828
default: 'internal'
29+
},
30+
pageLabel: {
31+
type: 'string',
32+
default: 'Page'
33+
},
34+
ofLabel: {
35+
type: 'string',
36+
default: 'of'
2937
}
3038
},
3139
edit: BlockEdit,

wordpress.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ else
77
echo "Updating WordPress files..."
88
# Extract wp-content tarball
99
if [ -f /tmp/wp-content.tgz ]; then
10-
tar -xzf /tmp/wp-content.tgz -C /var/www/html/ --overwrite
10+
tar -xzf /tmp/wp-content.tgz -C /var/www/html/ --overwrite
1111
echo "WordPress files updated successfully"
1212
else
1313
echo "Warning: /tmp/wp-content.tgz not found"
@@ -20,4 +20,4 @@ chown -R www-data:www-data /var/www/html/wp-content/uploads
2020
chmod -R 755 /var/www/html/wp-content/uploads
2121

2222
# Execute the WordPress entrypoint (which will switch to www-data user)
23-
exec /usr/local/bin/docker-entrypoint.sh "$@"
23+
exec /usr/local/bin/docker-entrypoint.sh "$@"

wp-theme/_plugins_installer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ function dg_semantic_recommended_plugins($plugins) {
157157
'featured' => false,
158158
'is_local' => false,
159159
),
160-
161-
160+
162161
);
163162
return array_merge($plugins, $theme_plugins);
164163
}

0 commit comments

Comments
 (0)