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.
Built from https://develop.svn.wordpress.org/trunk@59431


git-svn-id: http://core.svn.wordpress.org/trunk@58817 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
SergeyBiryukov committed Nov 20, 2024
1 parent c557605 commit d37c855
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions wp-admin/js/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
Loading

0 comments on commit d37c855

Please sign in to comment.