Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#56216 closed defect (bug) (fixed)

Further remove code from translatable strings in wp-includes/ms-default-constants.php

Reported by: sergeybiryukov's profile SergeyBiryukov Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 6.1 Priority: normal
Severity: normal Version:
Component: I18N Keywords: good-first-bug has-patch
Focuses: multisite Cc:

Description

Background: #35994.

[36773] removed some code from a translatable string in wp-includes/ms-default-constants.php, specifically constant names, file name, and a function name, as these names don't need translation.

However, there is one more string directly below which still includes some constant names:

trigger_error( __( '<strong>Conflicting values for the constants VHOST and SUBDOMAIN_INSTALL.</strong> The value of SUBDOMAIN_INSTALL will be assumed to be your subdomain configuration setting.' ) . ' ' . $vhost_deprecated, E_USER_WARNING );

As VHOST or SUBDOMAIN_INSTALL don't need translation, this can be replaced with:

trigger_error(
	sprintf(
		/* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL */
		__( '<strong>Conflicting values for the constants %1$s and %2$s.</strong> The value of %2$s will be assumed to be your subdomain configuration setting.' ),
		'<code>VHOST</code>',
		'<code>SUBDOMAIN_INSTALL</code>'
	) . ' ' . $vhost_deprecated,
	E_USER_WARNING
);

Attachments (2)

56216.diff (1.6 KB) - added by weboccults 3 years ago.
Patch created with suggested edits
56216.1.patch (1.1 KB) - added by hztyfoon 3 years ago.
added this patch 56216.1.patch as looks like in 56216.diff there's the line /* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL */ added twice.

Download all attachments as: .zip

Change History (7)

@weboccults
3 years ago

Patch created with suggested edits

#1 @weboccults
3 years ago

  • Keywords has-patch added; needs-patch removed

@hztyfoon
3 years ago

added this patch 56216.1.patch as looks like in 56216.diff there's the line /* translators: 1: VHOST, 2: SUBDOMAIN_INSTALL */ added twice.

This ticket was mentioned in PR #2976 on WordPress/wordpress-develop by pratiweb.


3 years ago
#2

Created pull request for correct translation text suggested in issue.

https://core.trac.wordpress.org/ticket/56216

#3 @SergeyBiryukov
3 years ago

Looks good, thanks everyone!

#4 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolution set to fixed
  • Status changed from new to closed

In 53699:

I18N: Remove code from a translatable string in wp-includes/ms-default-constants.php.

This replaces the VHOST and SUBDOMAIN_INSTALL constant names in a message in ms_subdomain_constants() with placeholders, as they don't need to be translated.

Follow-up to [36773].

Props weboccults, hztyfoon, pratiweb.
Fixes #56216.

SergeyBiryukov commented on PR #2976:


3 years ago
#5

Thanks for the PR! Merged in r53699.

Note: See TracTickets for help on using tickets.