Skip to content

Commit

Permalink
js-packages: Fix textdomains (#40368)
Browse files Browse the repository at this point in the history
We have a bunch of packages that, for historical reasons, use "jetpack"
rather than a unique text domain. Fix them now.

Committed via a GitHub action: https://github.com/Automattic/jetpack/actions/runs/12124750667

Upstream-Ref: Automattic/jetpack@d56cb8a
  • Loading branch information
anomiex authored and matticbot committed Dec 2, 2024
1 parent 16a148b commit a443c7a
Show file tree
Hide file tree
Showing 17 changed files with 102 additions and 72 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

### This is a list detailing changes for the Jetpack RNA Connection Component releases.

## [0.35.21-alpha] - unreleased
## [0.36.0-alpha] - unreleased

This is an alpha version! The changes listed here are not final.

### Changed
- Changed text domain from 'jetpack' to 'jetpack-connection-js'.

## [0.35.20] - 2024-11-26
### Changed
- Update dependencies.
Expand Down Expand Up @@ -905,7 +908,7 @@ This is an alpha version! The changes listed here are not final.
- `Main` and `ConnectUser` components added.
- `JetpackRestApiClient` API client added.

[0.35.21-alpha]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.20...v0.35.21-alpha
[0.36.0-alpha]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.20...v0.36.0-alpha
[0.35.20]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.19...v0.35.20
[0.35.19]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.18...v0.35.19
[0.35.18]: https://github.com/Automattic/jetpack-connection-js/compare/v0.35.17...v0.35.18
Expand Down
2 changes: 1 addition & 1 deletion components/connect-button/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const ConnectButton = props => {
const {
apiRoot,
apiNonce,
connectLabel = __( 'Connect', 'jetpack' ),
connectLabel = __( 'Connect', 'jetpack-connection-js' ),
registrationNonce,
redirectUri = null,
from,
Expand Down
5 changes: 3 additions & 2 deletions components/connect-screen/basic/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,12 @@ const ConnectScreen: React.FC< Props > = ( {
return (
<ConnectScreenVisual
title={
title || __( 'Over 5 million WordPress sites are faster and more secure', 'jetpack' )
title ||
__( 'Over 5 million WordPress sites are faster and more secure', 'jetpack-connection-js' )
}
images={ images || [] }
assetBaseUrl={ assetBaseUrl }
buttonLabel={ buttonLabel || __( 'Set up Jetpack', 'jetpack' ) }
buttonLabel={ buttonLabel || __( 'Set up Jetpack', 'jetpack-connection-js' ) }
loadingLabel={ loadingLabel }
handleButtonClick={ handleRegisterSite }
displayButtonError={ displayButtonError }
Expand Down
27 changes: 15 additions & 12 deletions components/connect-screen/basic/visual.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,25 @@ const getErrorMessage = ( errorCode, isOfflineMode ) => {
case 'siteurl_private_ip':
return __(
'Your site host is on a private network. Jetpack can only connect to public sites.',
'jetpack'
'jetpack-connection-js'
);
case 'connection_disabled':
return __( 'This site has been suspended.', 'jetpack' );
return __( 'This site has been suspended.', 'jetpack-connection-js' );
}

if ( isOfflineMode ) {
return createInterpolateElement( __( 'Unavailable in <a>Offline Mode</a>', 'jetpack' ), {
a: (
<a
href={ getRedirectUrl( 'jetpack-support-development-mode' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
} );
return createInterpolateElement(
__( 'Unavailable in <a>Offline Mode</a>', 'jetpack-connection-js' ),
{
a: (
<a
href={ getRedirectUrl( 'jetpack-support-development-mode' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
}
);
}
};

Expand Down Expand Up @@ -109,7 +112,7 @@ const ConnectScreenVisual: React.FC< Props > = ( {
isDisabled={ isOfflineMode }
/>
<span className="jp-connection__connect-screen__loading-message" role="status">
{ buttonIsLoading ? loadingLabel || __( 'Loading', 'jetpack' ) : '' }
{ buttonIsLoading ? loadingLabel || __( 'Loading', 'jetpack-connection-js' ) : '' }
</span>

{ footer && <div className="jp-connection__connect-screen__footer">{ footer }</div> }
Expand Down
7 changes: 5 additions & 2 deletions components/connect-screen/required-plan/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ import ConnectScreenRequiredPlanVisual from './visual';
*/
const ConnectScreenRequiredPlan = props => {
const {
title = __( 'Over 5 million WordPress sites are faster and more secure', 'jetpack' ),
title = __(
'Over 5 million WordPress sites are faster and more secure',
'jetpack-connection-js'
),
autoTrigger = false,
buttonLabel = __( 'Set up Jetpack', 'jetpack' ),
buttonLabel = __( 'Set up Jetpack', 'jetpack-connection-js' ),
apiRoot,
apiNonce,
registrationNonce,
Expand Down
25 changes: 14 additions & 11 deletions components/connect-screen/required-plan/visual.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ const ConnectScreenRequiredPlanVisual = props => {
debug( 'props are %o', props );

const withSubscription = createInterpolateElement(
__( 'Already have a subscription? <connectButton/>', 'jetpack' ),
__( 'Already have a subscription? <connectButton/>', 'jetpack-connection-js' ),
{
connectButton: (
<ActionButton
label={ __( 'Log in to get started', 'jetpack' ) }
label={ __( 'Log in to get started', 'jetpack-connection-js' ) }
onClick={ handleButtonClick }
isLoading={ buttonIsLoading }
/>
Expand All @@ -56,15 +56,18 @@ const ConnectScreenRequiredPlanVisual = props => {
);

const errorMessage = isOfflineMode
? createInterpolateElement( __( 'Unavailable in <a>Offline Mode</a>', 'jetpack' ), {
a: (
<a
href={ getRedirectUrl( 'jetpack-support-development-mode' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
} )
? createInterpolateElement(
__( 'Unavailable in <a>Offline Mode</a>', 'jetpack-connection-js' ),
{
a: (
<a
href={ getRedirectUrl( 'jetpack-support-development-mode' ) }
target="_blank"
rel="noopener noreferrer"
/>
),
}
)
: undefined;

return (
Expand Down
2 changes: 1 addition & 1 deletion components/connected-plugins/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const ConnectedPlugins = props => {
<p className="jp-connection__disconnect-dialog__large-text">
{ __(
'Jetpack is powering other plugins on your site. If you disconnect, these plugins will no longer work.',
'jetpack'
'jetpack-connection-js'
) }
</p>
</div>
Expand Down
6 changes: 3 additions & 3 deletions components/connection-error-notice/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const ConnectionErrorNotice = props => {
<Notice status={ 'error' } isDismissible={ false } className={ wrapperClassName }>
<div className={ styles.message }>
<Spinner color="#B32D2E" size={ 24 } />
{ __( 'Reconnecting Jetpack', 'jetpack' ) }
{ __( 'Reconnecting Jetpack', 'jetpack-connection-js' ) }
</div>
</Notice>
);
Expand All @@ -66,7 +66,7 @@ const ConnectionErrorNotice = props => {
{ icon }
{ sprintf(
/* translators: placeholder is the error. */
__( 'There was an error reconnecting Jetpack. Error: %s', 'jetpack' ),
__( 'There was an error reconnecting Jetpack. Error: %s', 'jetpack-connection-js' ),
restoreConnectionError
) }
</div>
Expand All @@ -88,7 +88,7 @@ const ConnectionErrorNotice = props => {
className={ styles.button }
href="#"
>
{ __( 'Restore Connection', 'jetpack' ) }
{ __( 'Restore Connection', 'jetpack-connection-js' ) }
</a>
) }
</Notice>
Expand Down
2 changes: 1 addition & 1 deletion components/disconnect-dialog/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const DisconnectDialog = props => {
apiRoot,
apiNonce,
connectedPlugins,
title = __( 'Are you sure you want to disconnect?', 'jetpack' ),
title = __( 'Are you sure you want to disconnect?', 'jetpack-connection-js' ),
pluginScreenDisconnectCallback,
onDisconnected,
onError,
Expand Down
10 changes: 5 additions & 5 deletions components/disconnect-dialog/steps/step-disconnect-confirm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const StepDisconnectConfirm = props => {
<div className="jp-connection__disconnect-dialog__step-copy jp-connection__disconnect-dialog__step-copy--narrow">
<h1>
{ createInterpolateElement(
__( 'Jetpack has been <br/>successfully disconnected.', 'jetpack' ),
__( 'Jetpack has been <br/>successfully disconnected.', 'jetpack-connection-js' ),
{
br: <br />,
}
Expand All @@ -35,7 +35,7 @@ const StepDisconnectConfirm = props => {
<p>
{ __(
'We’re sorry to see you go. Here at Jetpack, we’re always striving to provide the best experience for our customers. Please take our short survey (2 minutes, promise).',
'jetpack'
'jetpack-connection-js'
) }
</p>
<p>
Expand All @@ -44,15 +44,15 @@ const StepDisconnectConfirm = props => {
onClick={ onProvideFeedback }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
{ __( 'Help us improve', 'jetpack' ) }
{ __( 'Help us improve', 'jetpack-connection-js' ) }
</Button>
</p>
<a
className="jp-connection__disconnect-dialog__link jp-connection__disconnect-dialog__link--bold"
href="#"
onClick={ onExit }
>
{ __( 'No thank you', 'jetpack' ) }
{ __( 'No thank you', 'jetpack-connection-js' ) }
</a>
</>
) }
Expand All @@ -65,7 +65,7 @@ const StepDisconnectConfirm = props => {
onClick={ onExit }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
{ __( 'Back to my website', 'jetpack' ) }
{ __( 'Back to my website', 'jetpack-connection-js' ) }
</Button>
</p>
</>
Expand Down
26 changes: 18 additions & 8 deletions components/disconnect-dialog/steps/step-disconnect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ const StepDisconnect = props => {
* @return {React.Component} - Button used for disconnect.
*/
const renderDisconnectButton = () => {
let buttonText = __( 'Disconnect', 'jetpack' );
let buttonText = __( 'Disconnect', 'jetpack-connection-js' );
// When showing on the plugins page, this button should deactivate the plugin as well.
if ( isDisconnecting ) {
buttonText = __( 'Disconnecting…', 'jetpack' );
buttonText = __( 'Disconnecting…', 'jetpack-connection-js' );
} else if ( context === 'plugins' ) {
buttonText = __( 'Deactivate', 'jetpack' );
buttonText = __( 'Deactivate', 'jetpack-connection-js' );
}

return (
Expand Down Expand Up @@ -104,9 +104,15 @@ const StepDisconnect = props => {
return (
<div className="jp-connection__disconnect-dialog__step-copy">
<p className="jp-connection__disconnect-dialog__large-text">
{ __( 'Jetpack is currently powering multiple products on your site.', 'jetpack' ) }
{ __(
'Jetpack is currently powering multiple products on your site.',
'jetpack-connection-js'
) }
<br />
{ __( 'Once you disconnect Jetpack, these will no longer work.', 'jetpack' ) }
{ __(
'Once you disconnect Jetpack, these will no longer work.',
'jetpack-connection-js'
) }
</p>
</div>
);
Expand Down Expand Up @@ -134,7 +140,7 @@ const StepDisconnect = props => {
{ createInterpolateElement(
__(
'<strong>Need help?</strong> Learn more about the <jpConnectionInfoLink>Jetpack connection</jpConnectionInfoLink> or <jpSupportLink>contact Jetpack support</jpSupportLink>.',
'jetpack'
'jetpack-connection-js'
),
{
strong: <strong></strong>,
Expand Down Expand Up @@ -166,8 +172,12 @@ const StepDisconnect = props => {
className="jp-connection__disconnect-dialog__btn-dismiss"
>
{ context === 'plugins'
? __( 'Cancel', 'jetpack' )
: __( 'Stay connected', 'jetpack', /* dummy arg to avoid bad minification */ 0 ) }
? __( 'Cancel', 'jetpack-connection-js' )
: __(
'Stay connected',
'jetpack-connection-js',
/* dummy arg to avoid bad minification */ 0
) }
</Button>
{ renderDisconnectButton() }
</div>
Expand Down
6 changes: 3 additions & 3 deletions components/disconnect-dialog/steps/step-survey.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ const StepSurvey = props => {

return (
<div className="jp-connection__disconnect-dialog__content">
<h1>{ __( 'Before you go, help us improve Jetpack', 'jetpack' ) }</h1>
<h1>{ __( 'Before you go, help us improve Jetpack', 'jetpack-connection-js' ) }</h1>
<p className="jp-connection__disconnect-dialog__large-text">
{ __( 'Let us know what didn‘t work for you', 'jetpack' ) }
{ __( 'Let us know what didn‘t work for you', 'jetpack-connection-js' ) }
</p>
<DisconnectSurvey
onSubmit={ onFeedBackProvided }
Expand All @@ -30,7 +30,7 @@ const StepSurvey = props => {
href="#"
onClick={ onExit }
>
{ __( 'Skip for now', 'jetpack' ) }
{ __( 'Skip for now', 'jetpack-connection-js' ) }
</a>
</div>
);
Expand Down
6 changes: 3 additions & 3 deletions components/disconnect-dialog/steps/step-thank-you.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const StepThankYou = props => {
<DecorativeCard format="vertical" imageUrl={ disconnectImage } />

<div className="jp-connection__disconnect-dialog__copy">
<h1>{ __( 'Thank you!', 'jetpack' ) }</h1>
<h1>{ __( 'Thank you!', 'jetpack-connection-js' ) }</h1>
<p className="jp-connection__disconnect-dialog__large-text">
{ createInterpolateElement(
__(
'Your answer has been submitted. <br/>Thanks for your input on how we can improve Jetpack.',
'jetpack'
'jetpack-connection-js'
),
{
br: <br />,
Expand All @@ -37,7 +37,7 @@ const StepThankYou = props => {
onClick={ onExit }
className="jp-connection__disconnect-dialog__btn-back-to-wp"
>
{ __( 'Back to my website', 'jetpack' ) }
{ __( 'Back to my website', 'jetpack-connection-js' ) }
</Button>
</div>
</div>
Expand Down
Loading

0 comments on commit a443c7a

Please sign in to comment.