Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#42112 closed defect (bug) (fixed)

Customize Menus: Adjust "Menu Locations" labels for singular/plural

Reported by: melchoyce's profile melchoyce Owned by: westonruter's profile westonruter
Milestone: 4.9 Priority: normal
Severity: normal Version: 4.9
Component: Customize Keywords: has-patch commit
Focuses: ui Cc:

Description

Currently, "Menu Locations" is plural even if you only have one location to assign menus to.

Attachments (1)

42112.diff (1.6 KB) - added by felipeelia 7 years ago.

Download all attachments as: .zip

Change History (11)

#1 @melchoyce
7 years ago

  • Owner set to bpayton
  • Status changed from new to assigned

@felipeelia
7 years ago

#2 @felipeelia
7 years ago

  • Keywords has-patch added

I talked about this with @bpayton at slack and I've uploaded a patch (trying) to help. Note that it also changes View All Locations to View Location when there is only one of them.

#3 @melchoyce
7 years ago

Looks good to me!

#4 follow-up: @westonruter
7 years ago

It looks good to me too, but @felipeelia why introduce a new template variable for locationsTitle when it could just replace the _e() call with an echo _n() in tmpl-nav-menu-locations-header?

#5 in reply to: ↑ 4 ; follow-up: @felipeelia
7 years ago

Replying to westonruter:

It looks good to me too, but @felipeelia why introduce a new template variable for locationsTitle when it could just replace the _e() call with an echo _n() in tmpl-nav-menu-locations-header?

Hi @westonruter :)
I think it couldn't be replaced by _n directly because we don't have the number of locations avaiable inside print_templates() function. Please correct me if I'm wrong.

#6 @bpayton
7 years ago

I was happy to see the new variable because I was planning to introduce it anyway to share it with class-wp-customize-nav-menu-locations-control.php.

#7 @bpayton
7 years ago

We need to fix that title as well, but I can fix that as part of #42113.

#8 in reply to: ↑ 5 @westonruter
7 years ago

  • Keywords commit added
  • Owner changed from bpayton to westonruter
  • Status changed from assigned to accepted

Replying to felipeelia:

I think it couldn't be replaced by _n directly because we don't have the number of locations avaiable inside print_templates() function. Please correct me if I'm wrong.

The printing of templates would happen even after enqueue_scripts, so the number of registered nav menus would for sure be known at that point. But since @bpayton would like to re-use the string, the patch is good as is.

#9 @westonruter
7 years ago

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

In 41812:

Customize: Adjust "Menu Locations" labels for singular/plural.

Props felipeelia.
Fixes #42112.

#10 @westonruter
7 years ago

In 41816:

Customize: Fix string translations for singular vs plural after [41812].

Props felipeelia, tobifjellner, SergeyBiryukov.
See #42112.
Fixes #42170.

Note: See TracTickets for help on using tickets.