diff --git a/projects/packages/jetpack-mu-wpcom/changelog/update-locale-to-wpcom b/projects/packages/jetpack-mu-wpcom/changelog/update-locale-to-wpcom new file mode 100644 index 0000000000000..b8a285b3ab38e --- /dev/null +++ b/projects/packages/jetpack-mu-wpcom/changelog/update-locale-to-wpcom @@ -0,0 +1,4 @@ +Significance: minor +Type: changed + +Replace language selector with a link to WPCOM diff --git a/projects/packages/jetpack-mu-wpcom/composer.json b/projects/packages/jetpack-mu-wpcom/composer.json index 5d0e6a23b36fb..ed61dcc42c734 100644 --- a/projects/packages/jetpack-mu-wpcom/composer.json +++ b/projects/packages/jetpack-mu-wpcom/composer.json @@ -62,7 +62,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "5.57.x-dev" + "dev-trunk": "5.58.x-dev" }, "textdomain": "jetpack-mu-wpcom", "version-constants": { diff --git a/projects/packages/jetpack-mu-wpcom/package.json b/projects/packages/jetpack-mu-wpcom/package.json index 51745d707c362..d4c510f13657a 100644 --- a/projects/packages/jetpack-mu-wpcom/package.json +++ b/projects/packages/jetpack-mu-wpcom/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@automattic/jetpack-mu-wpcom", - "version": "5.57.2-alpha", + "version": "5.58.0-alpha", "description": "Enhances your site with features powered by WordPress.com", "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/packages/jetpack-mu-wpcom/#readme", "bugs": { diff --git a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php index 4d2100eb947df..d0df81f52136d 100644 --- a/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php +++ b/projects/packages/jetpack-mu-wpcom/src/class-jetpack-mu-wpcom.php @@ -13,7 +13,7 @@ * Jetpack_Mu_Wpcom main class. */ class Jetpack_Mu_Wpcom { - const PACKAGE_VERSION = '5.57.2-alpha'; + const PACKAGE_VERSION = '5.58.0-alpha'; const PKG_DIR = __DIR__ . '/../'; const BASE_DIR = __DIR__ . '/'; const BASE_FILE = __FILE__; diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.php b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.php index f6c74c7a93d50..2b950a10863d3 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.php +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.php @@ -45,6 +45,10 @@ function wpcom_profile_settings_add_links_to_wpcom() { 'wpcom-profile-settings-link-to-wpcom', 'wpcomProfileSettingsLinkToWpcom', array( + 'language' => array( + 'link' => esc_url( $wpcom_host . '/me/account' ), + 'text' => __( 'Your admin interface language is managed on WordPress.com Account settings', 'jetpack-mu-wpcom' ), + ), 'synced' => array( 'link' => esc_url( $wpcom_host . '/me' ), 'text' => __( 'You can manage your profile on WordPress.com Profile settings (First / Last / Display Names, Website, and Biographical Info)', 'jetpack-mu-wpcom' ), diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.ts b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.ts index 011860cf9649a..621c213633e06 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.ts +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/profile-settings-link-to-wpcom.ts @@ -18,18 +18,28 @@ const wpcom_profile_settings_disable_email_field = () => { * Add a link to the WordPress.com profile settings page. */ const wpcom_profile_settings_add_links_to_wpcom = () => { - const usernameSection = document.querySelector( '.user-user-login-wrap' )?.querySelector( 'td' ); - const emailSection = document.querySelector( '.user-email-wrap' )?.querySelector( 'td' ); - const newPasswordSection = document.getElementById( 'password' )?.querySelector( 'td' ); const userSessionSection = document.querySelector( '.user-sessions-wrap' ); - userSessionSection?.remove(); // We cannot set a password in wp-admin except on Atomic Classic sites. + const newPasswordSection = document.getElementById( 'password' )?.querySelector( 'td' ); if ( ! window.wpcomProfileSettingsLinkToWpcom?.isWpcomAtomicClassic && newPasswordSection ) { newPasswordSection.innerHTML = ''; } + const languageSection = document.querySelector( '.user-language-wrap' )?.querySelector( 'td' ); + const languageSelect = document.getElementById( 'locale' ); + const languageSettingsLink = window.wpcomProfileSettingsLinkToWpcom?.language?.link; + const languageSettingsLinkText = window.wpcomProfileSettingsLinkToWpcom?.language?.text; + if ( languageSettingsLink && languageSettingsLinkText ) { + const notice = document.createElement( 'p' ); + notice.className = 'description'; + notice.innerHTML = `${ languageSettingsLinkText }.`; + languageSection?.appendChild( notice ); + languageSelect?.remove(); + } + + const emailSection = document.querySelector( '.user-email-wrap' )?.querySelector( 'td' ); const emailSettingsLink = window.wpcomProfileSettingsLinkToWpcom?.email?.link; const emailSettingsLinkText = window.wpcomProfileSettingsLinkToWpcom?.email?.text; if ( emailSection && emailSettingsLink && emailSettingsLinkText ) { @@ -48,6 +58,7 @@ const wpcom_profile_settings_add_links_to_wpcom = () => { newPasswordSection.appendChild( notice ); } + const usernameSection = document.querySelector( '.user-user-login-wrap' )?.querySelector( 'td' ); const syncedSettingsLink = window.wpcomProfileSettingsLinkToWpcom?.synced?.link; const syncedSettingsLinkText = window.wpcomProfileSettingsLinkToWpcom?.synced?.text; if ( usernameSection && syncedSettingsLink && syncedSettingsLinkText ) { diff --git a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/types.d.ts b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/types.d.ts index 550cadaa47b70..a3d97189c251b 100644 --- a/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/types.d.ts +++ b/projects/packages/jetpack-mu-wpcom/src/features/wpcom-profile-settings/types.d.ts @@ -1,6 +1,14 @@ declare global { interface Window { wpcomProfileSettingsLinkToWpcom: { + language: { + link: string; + text: string; + }; + synced: { + link: string; + text: string; + }; email: { link: string; text: string; diff --git a/projects/plugins/mu-wpcom-plugin/changelog/update-locale-to-wpcom b/projects/plugins/mu-wpcom-plugin/changelog/update-locale-to-wpcom new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/mu-wpcom-plugin/changelog/update-locale-to-wpcom @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/mu-wpcom-plugin/composer.lock b/projects/plugins/mu-wpcom-plugin/composer.lock index dda8e32de3ebc..46f5b03123dfe 100644 --- a/projects/plugins/mu-wpcom-plugin/composer.lock +++ b/projects/plugins/mu-wpcom-plugin/composer.lock @@ -1005,7 +1005,7 @@ "dist": { "type": "path", "url": "../../packages/jetpack-mu-wpcom", - "reference": "022350b06a2d6341c35415ada223184263b916e8" + "reference": "acaaab4c89fce8ed6ad2ea4986cf3e1e6f127b14" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1039,7 +1039,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "5.57.x-dev" + "dev-trunk": "5.58.x-dev" }, "textdomain": "jetpack-mu-wpcom", "version-constants": { diff --git a/projects/plugins/wpcomsh/changelog/update-locale-to-wpcom b/projects/plugins/wpcomsh/changelog/update-locale-to-wpcom new file mode 100644 index 0000000000000..9aa70e3ec1f75 --- /dev/null +++ b/projects/plugins/wpcomsh/changelog/update-locale-to-wpcom @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Updated composer.lock. + + diff --git a/projects/plugins/wpcomsh/composer.lock b/projects/plugins/wpcomsh/composer.lock index 731cc76369613..5f8e47aef7dd4 100644 --- a/projects/plugins/wpcomsh/composer.lock +++ b/projects/plugins/wpcomsh/composer.lock @@ -1142,7 +1142,7 @@ "dist": { "type": "path", "url": "../../packages/jetpack-mu-wpcom", - "reference": "022350b06a2d6341c35415ada223184263b916e8" + "reference": "acaaab4c89fce8ed6ad2ea4986cf3e1e6f127b14" }, "require": { "automattic/jetpack-assets": "@dev", @@ -1176,7 +1176,7 @@ }, "autotagger": true, "branch-alias": { - "dev-trunk": "5.57.x-dev" + "dev-trunk": "5.58.x-dev" }, "textdomain": "jetpack-mu-wpcom", "version-constants": {