I18N: Adjust translator comments in `nav-menu.js`.

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
This commit is contained in:
Sergey Biryukov 2024-11-20 11:22:19 +00:00
parent c557605794
commit d37c855db1
3 changed files with 6 additions and 6 deletions

View File

@ -364,9 +364,9 @@
if ( i == itemPosition ) { if ( i == itemPosition ) {
$selected = 'selected'; $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( 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, i,
totalMenuItems totalMenuItems
); );
@ -386,9 +386,9 @@
if ( i == itemPosition ) { if ( i == itemPosition ) {
$selected = 'selected'; $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( 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, i,
totalSubMenuItems totalSubMenuItems
); );

File diff suppressed because one or more lines are too long

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.8-alpha-59430'; $wp_version = '6.8-alpha-59431';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.