Commit ffa1f6ef authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#174267 by kkaefer: improve wording of some menu messages, and add a missing format_plural()

parent 34a26b3c
......@@ -355,17 +355,17 @@ function menu_delete_menu_confirm_submit($form, &$form_state) {
function menu_edit_menu_validate($form, &$form_state) {
$item = $form_state['values'];
if (preg_match('/[^a-z0-9-]/', $item['menu_name'])) {
form_set_error('menu_name', t('Menu name may consist only of lowercase letters, numbers, and hyphens.'));
form_set_error('menu_name', t('The menu name may only consist of lowercase letters, numbers, and hyphens.'));
if (strlen($item['menu_name']) > MENU_MAX_MENU_NAME_LENGTH_UI) {
form_set_error('menu_name', t('Menu name can not be longer than '. MENU_MAX_MENU_NAME_LENGTH_UI .' characters.'));
form_set_error('menu_name', format_plural(MENU_MAX_MENU_NAME_LENGTH_UI, "The menu name can't be longer than 1 character.", "The menu name can't be longer than @count characters."));
if ($form['#insert']) {
// We will add 'menu-' to the menu name to help avoid name-space conflicts.
$item['menu_name'] = 'menu-'. $item['menu_name'];
if (db_result(db_query("SELECT menu_name FROM {menu_custom} WHERE menu_name = '%s'", $item['menu_name'])) ||
db_result(db_query_range("SELECT menu_name FROM {menu_links} WHERE menu_name = '%s'", $item['menu_name'], 0, 1))) {
form_set_error('menu_name', t('Menu already exists'));
form_set_error('menu_name', t('The menu already exists.'));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment