Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Fix missing translations in inspector #6737

Merged
merged 23 commits into from
Aug 1, 2022
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
89a2bc1
Try registering the "cart taxes" inner block
tarhi-saad Jul 22, 2022
713b835
Fix registering the cart taxes inner block issue
tarhi-saad Jul 22, 2022
21ffbd9
Update translation script loading
tarhi-saad Jul 22, 2022
18648ce
Remove unnecessary JS translation
tarhi-saad Jul 25, 2022
06cebc4
Put back the initial code in the 'Cart Taxes' inner block
tarhi-saad Jul 28, 2022
18e3a98
Generate `block.json`files for inner blocks
tarhi-saad Jul 28, 2022
310dd42
Set the folder name exactly the same as the inner block name
tarhi-saad Jul 28, 2022
a24deee
Update imports after folder renaming
tarhi-saad Jul 28, 2022
49e207b
Get block name directly from the JSON metadata
tarhi-saad Jul 28, 2022
b0101b0
Revert folder naming change of `Cart taxes` inner block
tarhi-saad Jul 28, 2022
477896a
Fix missing translations for the `Cart Subtotal` Block
tarhi-saad Jul 28, 2022
f62033f
Register only the client-side settings on the client
tarhi-saad Jul 29, 2022
466ecd1
Add schema validation to `block.json`
tarhi-saad Jul 29, 2022
c5670f6
Use the same `editor_script` as the parent block
tarhi-saad Jul 29, 2022
83a8b43
Add C&C inner blocks in Cart.php & Checkout.php
tarhi-saad Jul 29, 2022
7c2aefd
Fix all Cart inner blocks missing translations
tarhi-saad Jul 29, 2022
a9e0d3c
Create the "AbstractInnerBlock" class
tarhi-saad Aug 1, 2022
686fe50
Update the "Inner Blocks" PHP classes
tarhi-saad Aug 1, 2022
0a9cf4a
Fix PHP lint erros & update function description
tarhi-saad Aug 1, 2022
602ea19
Fix missing translations bug for all Checkout Inner Blocks
tarhi-saad Aug 1, 2022
bbc73ec
Merge branch 'trunk' into fix/6244-missing-translations-in-inspector
tarhi-saad Aug 1, 2022
eb6dd53
Update src/BlockTypes/Checkout.php
tarhi-saad Aug 1, 2022
b220e49
skip lazy loaded scripts
senadir Aug 1, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@
},
"parent": [ "woocommerce/cart-totals-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget to ask why was this needed?

Copy link
Contributor Author

@tarhi-saad tarhi-saad Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading the schema definition file allows supported editors to provide help like tooltips, autocomplete, and schema validation. For example, you can hover over a field in block.json to see a tooltip description for it. So, it's always good to add this line for development purposes.

"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ import { Icon, payment } from '@wordpress/icons';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
icon: {
src: (
<Icon
icon={ payment }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
} );
registerFeaturePluginBlockType(
'woocommerce/cart-accepted-payment-methods-block',
{
icon: {
src: (
<Icon
icon={ payment }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"parent": [ "woocommerce/cart-totals-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-express-payment-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"parent": [ "woocommerce/filled-cart-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-items-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"parent": [ "woocommerce/cart-items-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-line-items-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"parent": [ "woocommerce/cart-totals-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-order-summary-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
icon: {
src: (
<Icon
icon={ tag }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
} );
registerFeaturePluginBlockType(
'woocommerce/cart-order-summary-coupon-form-block',
{
icon: {
src: (
<Icon
icon={ tag }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
} );
registerFeaturePluginBlockType(
'woocommerce/cart-order-summary-discount-block',
{
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-order-summary-fee-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
} );
registerFeaturePluginBlockType(
'woocommerce/cart-order-summary-heading-block',
{
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
*/
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
attributes,
edit: Edit,
save: Save,
} );
registerFeaturePluginBlockType(
'woocommerce/cart-order-summary-shipping-block',
{
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
attributes,
edit: Edit,
save: Save,
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
} );
registerFeaturePluginBlockType(
'woocommerce/cart-order-summary-subtotal-block',
{
icon: {
src: (
<Icon
icon={ totals }
className="wc-block-editor-components-block-icon"
/>
),
},
edit: Edit,
save: Save,
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
},
"parent": [ "woocommerce/cart-order-summary-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
*/
import { Edit, Save } from './edit';
import attributes from './attributes';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-order-summary-taxes-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@
},
"parent": [ "woocommerce/filled-cart-block" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/cart-totals-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"parent": [ "woocommerce/cart" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ import { registerFeaturePluginBlockType } from '@woocommerce/block-settings';
* Internal dependencies
*/
import { Edit, Save } from './edit';
import metadata from './block.json';

registerFeaturePluginBlockType( metadata, {
registerFeaturePluginBlockType( 'woocommerce/empty-cart-block', {
icon: {
src: (
<Icon
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@
},
"parent": [ "woocommerce/cart" ],
"textdomain": "woo-gutenberg-products-block",
"$schema": "https://schemas.wp.org/trunk/block.json",
"apiVersion": 2
}
Loading