WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#42160 closed enhancement (duplicate)

i18n: Avoid using URLs in translation strings (wp-admin/options-writing.php)

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

Description

The attached patch removes the URLs from the translation strings replacing them with %s placeholders. It also adds translators comments.

Attachments (1)

42160.patch (1.7 KB) - added by ramiy 3 years ago.

Download all attachments as: .zip

Change History (9)

@ramiy
3 years ago

#1 @ramiy
3 years ago

  • Keywords has-patch added

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


3 years ago

#3 @danieltj
3 years ago

  • Keywords needs-refresh added

The patch in 42160.patch creates another translation string of the actual link to WordPress.org that should ideally be avoided. If the you remove the __() from the URL then it'd be fine.

#4 follow-up: @ocean90
3 years ago

  • Keywords needs-refresh removed
  • Milestone changed from Awaiting Review to 5.0
  • Type changed from defect (bug) to enhancement

Codex pages can also be translated therefore the link needs to be translatable as well.

#5 in reply to: ↑ 4 @danieltj
3 years ago

  • Keywords close added

Replying to ocean90:

Codex pages can also be translated therefore the link needs to be translatable as well.

In that case, the original code is fine as it is. Splitting one translation string into two is unnecessary if the URL should be localised as well. That can be done when part of the original string.

#6 @ocean90
3 years ago

  • Keywords close removed

In case of a URL change it's better to invalidate only one string.

#7 @ramiy
3 years ago

The convention is to use <a href="%s"> moving the URL into a separate translation string. This ticket is just fixing the string that don't use this convention yet.

#8 @SergeyBiryukov
3 years ago

  • Milestone 5.0 deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Fixed in [41986], see #40763.

Note: See TracTickets for help on using tickets.