Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#32975 closed defect (bug) (fixed)

Improve translation string in theme edit screen

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

Description

When translating the "__( 'Header' )" string to hebrew, we use it in the context of custom-header, because this string is used to link to "themes.php?page=custom-header".

Source: https://core.trac.wordpress.org/browser/trunk/src/wp-includes/admin-bar.php#L735

But it seems like the same string "__( 'Header' )" is used in the content of descripting the "header.php" file name.

Source: https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/file.php#L21

The problem

As a translator, I can't create two different translation strings. And the result is that in the theme edit screen, the header.php file description translated to "custom header" (in hebrew).

The solution

We can replace "__( 'Header' )" with "_x( 'Header', 'context' )".

Or we can use different strings, replacing "__( 'Header' )" with "__( 'Theme Header' )".

I personally prefer the second solution, as it adds more descriptive text to the user, but both solution do the job.

Attachments (1)

32975.patch (610 bytes ) - added by ramiy 11 years ago.

Download all attachments as: .zip

Change History (5)

@ramiy
11 years ago

#1 @ramiy
11 years ago

  • Keywords has-patch added

#2 @wonderboymusic
11 years ago

  • Milestone Awaiting Review4.4
  • Owner set to ocean90
  • Status newassigned

Let's take a look

#3 @SergeyBiryukov
11 years ago

  • Keywords commit added

32975.patch looks good to me and seems consistent with "Theme Functions" below.

#4 @ocean90
11 years ago

  • Resolutionfixed
  • Status assignedclosed

In 34290:

Theme Editor: Change file descriptions of header.php and footer.php.

header.php is now "Theme Header" and footer.php is "Theme Footer". This prevents a clash with other "Header" strings in the context of "Custom Header".

Props ramiy.
Fixes #32975.

Note: See TracTickets for help on using tickets.