Menus: i18n: Fix untranslatable strings in `nav-menu.js`.

Wrap three untranslatable strings in nav menus in JS translation functions.

Follow up to [59265].

Props juliemoynat, swissspidy, yogeshbhutkar, sergeybiryukov, desrosj, tobifjellner, audrasjb, joedolson.
Fixes #62402.
Built from https://develop.svn.wordpress.org/trunk@59426


git-svn-id: http://core.svn.wordpress.org/trunk@58812 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
joedolson 2024-11-19 23:25:20 +00:00
parent e8741c53c8
commit 41226f1164
3 changed files with 17 additions and 5 deletions

View File

@ -319,7 +319,7 @@
$selected = 'selected';
}
$html += '<option ' + $selected + ' value="0">No Parent</option>';
$html += '<option ' + $selected + ' value="0">' + wp.i18n._x( 'No Parent', 'menu item without a parent in navigation menu' ) + '</option>';
$.each( menuItems, function() {
var menuItem = $(this),
@ -364,7 +364,13 @@
if ( i == itemPosition ) {
$selected = 'selected';
}
$html += '<option ' + $selected + ' value="' + i + '">' + i + ' of ' + totalMenuItems + '</option>';
// 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' ),
i,
totalMenuItems
);
$html += '<option ' + $selected + ' value="' + i + '">' + itemString + '</option>';
}
} else {
@ -380,7 +386,13 @@
if ( i == itemPosition ) {
$selected = 'selected';
}
$html += '<option ' + $selected + ' value="' + i + '">' + i + ' of ' + totalSubMenuItems + '</option>';
// 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' ),
i,
totalSubMenuItems
);
$html += '<option ' + $selected + ' value="' + i + '">' + submenuString + '</option>';
}
}

File diff suppressed because one or more lines are too long

View File

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