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 untranslated sharing label #36695

Merged
merged 5 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/fix-translation-issues
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Fix translation issues for default attributes
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,88 @@ function register_block() {
),
'align' => array( 'wide', 'full' ),
),
'attributes' => array(
Copy link
Member

@simison simison Apr 2, 2024

Choose a reason for hiding this comment

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

I think @Automattic/jetpack-vulcan team just moved these attributes out to block.json as part of some refactoring of blocks — maybe that also busted translations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think yes, in the json file we can't translate.

Copy link
Member

Choose a reason for hiding this comment

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

Looks to affect few other blocks too: pf5801-Aw-p2/#comment-336 — @monsieur-z @jeherve fine to move attributes back to PHP while the localization issues are sorted out with json approach?

I'm not sure if this would affect anything else given architecture changes to blocks.

Copy link
Member

Choose a reason for hiding this comment

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

@monsieur-z has been looking at this as part of https://github.com/Automattic/vulcan/issues/244 and may be able to chime in on this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that's perfectly fine. I'll dive deeper into this, but in the meantime thanks for implementing a workaround.

'subscribePlaceholder' => array(
'type' => 'string',
'default' => __( 'Type your email…', 'jetpack' ),
),
'showSubscribersTotal' => array(
'type' => 'boolean',
'default' => false,
),
'includeSocialFollowers' => array(
'type' => 'boolean',
),
'buttonOnNewLine' => array(
'type' => 'boolean',
'default' => false,
),
'buttonWidth' => array(
'type' => 'string',
),
'submitButtonText' => array(
'type' => 'string',
'default' => __( 'Subscribe', 'jetpack' ),
),
'emailFieldBackgroundColor' => array(
'type' => 'string',
),
'customEmailFieldBackgroundColor' => array(
'type' => 'string',
),
'emailFieldGradient' => array(
'type' => 'string',
),
'customEmailFieldGradient' => array(
'type' => 'string',
),
'buttonBackgroundColor' => array(
'type' => 'string',
),
'customButtonBackgroundColor' => array(
'type' => 'string',
),
'buttonGradient' => array(
'type' => 'string',
),
'customButtonGradient' => array(
'type' => 'string',
),
'textColor' => array(
'type' => 'string',
),
'customTextColor' => array(
'type' => 'string',
),
'fontSize' => array(
'type' => 'string',
),
'customFontSize' => array(
'type' => 'string',
),
'borderRadius' => array(
'type' => 'number',
),
'borderWeight' => array(
'type' => 'number',
),
'borderColor' => array(
'type' => 'string',
),
'customBorderColor' => array(
'type' => 'string',
),
'padding' => array(
'type' => 'number',
),
'spacing' => array(
'type' => 'number',
),
'successMessage' => array(
'type' => 'string',
'default' => __( 'Success! An email was just sent to confirm your subscription. Please find the email now and click \'Confirm Follow\' to start subscribing.', 'jetpack' ),
),
),
)
);
}
Expand Down Expand Up @@ -764,7 +846,7 @@ class="screen-reader-text"
esc_attr( $subscribe_field_id ),
( ! empty( $data['subscribe_email'] )
? 'disabled title="' . esc_attr__( "You're logged in with this email", 'jetpack' ) . '"'
: ''
: 'title="' . esc_attr__( 'Please fill in this field.', 'jetpack' ) . '"'
)
);
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ public function get_global_options() {
}
}

if ( false === $this->global['sharing_label'] ) {
if ( false === $this->global['sharing_label'] || $this->global['sharing_label'] === 'Share this:' ) {
$this->global['sharing_label'] = $this->default_sharing_label;
}

Expand Down
Loading