Make WordPress Core

Opened 11 months ago

Closed 11 months ago

Last modified 11 months ago

#58424 closed enhancement (fixed)

Provide gettext context to disambiguate various translation strings

Reported by: gonzomir's profile gonzomir Owned by: audrasjb's profile audrasjb
Milestone: 6.3 Priority: normal
Severity: normal Version: 6.3
Component: I18N Keywords: has-patch commit
Focuses: Cc:

Description

The word 'Header' appears as translatable string in different places and different contexts. This makes it impossible to properly translate it in the context it's used. As an example in Bulgarian 'Header' has been translated in 2011 by Nikolay Bachiyski (nbachiyski) in the context of header image, and now this translation started appearing in site editor in the context of header template or page section. I understand most of the changes needed will be in the Gutenberg project `I'll file an issue there too), but my suggestion is to always use gettext content when this word appears alone in the UI.

Attachments (1)

58424.diff (4.7 KB) - added by SergeyBiryukov 11 months ago.

Download all attachments as: .zip

Change History (12)

This ticket was mentioned in PR #4520 on WordPress/wordpress-develop by gonzomir.


11 months ago
#1

  • Keywords has-patch added

Use _x() with appropriate context when translating the word 'Header'.

Trac ticket: [](https://core.trac.wordpress.org/ticket/58424)

#2 @SergeyBiryukov
11 months ago

  • Milestone changed from Awaiting Review to 6.3

Hi there, welcome to WordPress Trac! Thanks for the ticket and the PR.

This makes sense to me.

In 58424.diff, I've added the context for a few more related strings for consistency:

  • The 'Background' string. Like the custom-header theme feature, it could also use the context for clarity.
  • The 'General' and 'Footer' strings when referring to template part areas.

#3 @mukesh27
11 months ago

  • Keywords commit added

Hi there! thanks for ticket and PR.

@SergeyBiryukov patch 58424.diff look good to me and ready for merge.

#4 @mukesh27
11 months ago

As we update other strings, do we also need to update the ticket title here?

This ticket was mentioned in Slack in #core by mukeshpanchal27. View the logs.


11 months ago

#6 @costdev
11 months ago

58424.diff looks good to me too.

@mukesh27 Yeah I think the ticket should be renamed.

#7 @ankitmaru
11 months ago

This looks good to me as well.

#8 @audrasjb
11 months ago

  • Summary changed from 'Header' used in i18n functions in different contexts without gettext context to Provide gettext context to disambiguate various translation strings

#9 @audrasjb
11 months ago

  • Owner set to audrasjb
  • Status changed from new to reviewing

Self assigning for commit consideration.

#10 @audrasjb
11 months ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 55881:

I18N: Provide gettext context to disambiguate various translation strings.

This changeset adds context to various strings:

  • 'Background' string when referring to Custom Background appearance screens
  • 'Header' string when referring to Custom Header appearance screens
  • 'General', 'Header' and 'Footer' strings when referring to template part areas

Props gonzomir, SergeyBiryukov, mukesh27, costdev, ankitmaru.
Fixes #58424.

Note: See TracTickets for help on using tickets.