WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#35670 closed defect (bug) (wontfix)

Avoid using HTML tags in translation strings (network documentation links)

Reported by: ramiy Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: I18N Keywords: has-patch
Focuses: Cc:

Description

The documentation links in help tabs are translatable. But the translation strings contain the HTML <a> tags with the links.

The attached patch fixes this, moving the HTML tag out of the translation string.

In this ticket I've started with the network documentation links. If the ticket will be approved, I'll fix documentation links in other help tabs.

This ticket is a part of my core i18n improvements project.

Attachments (3)

network-documentation-links.png (143.0 KB) - added by ramiy 5 years ago.
35670.patch (13.5 KB) - added by ramiy 5 years ago.
35670.2.patch (13.6 KB) - added by ramiy 5 years ago.

Download all attachments as: .zip

Change History (10)

@ramiy
5 years ago

#1 @ocean90
5 years ago

The codex links should be still translatable.

#2 @ramiy
5 years ago

  • Keywords has-patch added

I can replace:

esc_url( 'https://codex.wordpress.org/Tools_Network_Screen' )

With:

esc_url( __( 'https://codex.wordpress.org/Tools_Network_Screen' ) )

@ramiy
5 years ago

#3 @ramiy
5 years ago

I can also do that with sprintf() for documentation strings:

sprintf(
	'<a href="%1$s" target="_blank">%2$s</a>'
	__( 'https://codex.wordpress.org/XXX' ),
	__( 'Documentation on XXX' ),
)

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


5 years ago

#5 @ocean90
5 years ago

  • Milestone changed from Awaiting Review to 4.6

This ticket was mentioned in Slack in #core-i18n by ocean90. View the logs.


5 years ago

#7 @ocean90
5 years ago

  • Milestone 4.6 deleted
  • Resolution set to wontfix
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.