Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#60630 closed defect (bug) (fixed)

Updates / Plugin Dependencies: Improve localized strings

Reported by: swissspidy's profile swissspidy Owned by: swissspidy's profile swissspidy
Milestone: 6.5 Priority: normal
Severity: normal Version: 6.5
Component: Upgrade/Install Keywords: has-patch
Focuses: Cc:

Description

[57545] introduced many new localized strings, especially in updates.js.

Many of them are using _x() incorrectly or unnecessarily. So there's definitely room for improvement here.

Then there are dependencies separated by "|" (pipe) character instead of using wp_get_list_item_separator().

Also some usage of sprintf() that could be improved.

Change History (9)

#1 @swissspidy
11 months ago

  • Milestone changed from Awaiting Review to 6.5
  • Version set to trunk

This ticket was mentioned in PR #6175 on WordPress/wordpress-develop by @swissspidy.


11 months ago
#2

There might be more strings that need improvement. These are just the ones I found at first glance after looking at https://core.trac.wordpress.org/changeset/57545

Trac ticket: https://core.trac.wordpress.org/ticket/60630

#3 @kebbet
11 months ago

I think the comments plugin or theme are there for a reason. Some locales might translate the same word into different strings depending on context. Could a translator comment be added to each string instead of using _x?

#4 @swissspidy
11 months ago

That „Activate“ string doesn‘t need context though and has happily existed without context for years. If anything we‘d change this consistently throughout the code base.
A translator comment is not an adequate replacement for context, as it will just result in 1 string with multiple different comments for translators.

#5 @rabmalin
11 months ago

Note: this plugin cannot be activated until the plugins that are required by it are activated.

We generally capitalize the letter after Note:.
So, it could be

Note: This plugin cannot be activated until the plugins that are required by it are activated.

Another example:

Note: this plugin cannot be deactivated or deleted until the plugins that require it are deactivated or deleted.

@swissspidy commented on PR #6175:


11 months ago
#6

Looked at this with fresh eyes today after checking the rest of the code base and also what the code looked like in previous releases.

Ended up changing my view and added context where in doubt, rather then removing it.

In short, if we use _x( 'Activate', 'plugin' ), let's make sure we use it everywhere like this.

#7 @swissspidy
11 months ago

@rabmalin Good point. Updated the PR accordingly.

#8 @swissspidy
11 months ago

  • Owner set to swissspidy
  • Resolution set to fixed
  • Status changed from assigned to closed

In 57714:

Upgrade/Install: Improve localized strings related to plugin/theme installation and activation.

Adds context to strings where applicable to disambiguate them, coherently throughout the admin. Also improves some of the strings introduced in [57545] to ease localization.

Props swissspidy, costdev.
Fixes #60630. See #22316.

Note: See TracTickets for help on using tickets.