Skip to content

Commit

Permalink
I18N: Adjust translator comments in nav-menu.js.
Browse files Browse the repository at this point in the history
Includes:
* Moving the comments directly above `wp.i18n._x()` so that they can be picked up properly.
* Simplifying the context to avoid unnecessarily translating the string twice for the same use case.
* Using the established translator comments format for consistency.

Follow-up to [59428].

See #62402.

git-svn-id: https://develop.svn.wordpress.org/trunk@59431 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Nov 20, 2024
1 parent 193f6eb commit 654475f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/_enqueues/lib/nav-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,9 @@
if ( i == itemPosition ) {
$selected = 'selected';
}
// Translators: %1$s is the current menu item number, %2$s is the total number of menu items.
var itemString = wp.i18n.sprintf(
wp.i18n._x( '%1$s of %2$s', 'indicating a part of a total number of items in a navigation menu' ),
/* translators: 1: The current menu item number, 2: The total number of menu items. */
wp.i18n._x( '%1$s of %2$s', 'part of a total number of menu items' ),
i,
totalMenuItems
);
Expand All @@ -386,9 +386,9 @@
if ( i == itemPosition ) {
$selected = 'selected';
}
// Translators: %1$s is the current submenu item number, %2$s is the total number of submenu items.
var submenuString = wp.i18n.sprintf(
wp.i18n._x( '%1$s of %2$s', 'indicating a part of a total number of items in a submenu' ),
/* translators: 1: The current submenu item number, 2: The total number of submenu items. */
wp.i18n._x( '%1$s of %2$s', 'part of a total number of menu items' ),
i,
totalSubMenuItems
);
Expand Down

0 comments on commit 654475f

Please sign in to comment.