patch 9.0.1133: error message names do not match the items
Problem: Error message names do not match the items.
Solution: Add "_str" when the text contains "%s".
diff --git a/src/vim9compile.c b/src/vim9compile.c
index c5b41da..0bf04a1 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -1314,15 +1314,15 @@
case 'w': scope = _("window"); break;
case 't': scope = _("tab"); break;
case 'v': scope = "v:"; break;
- case '$': semsg(_(e_cannot_declare_an_environment_variable), name);
+ case '$': semsg(_(e_cannot_declare_an_environment_variable_str), name);
return;
- case '&': semsg(_(e_cannot_declare_an_option), name);
+ case '&': semsg(_(e_cannot_declare_an_option_str), name);
return;
case '@': semsg(_(e_cannot_declare_a_register_str), name);
return;
default: return;
}
- semsg(_(e_cannot_declare_a_scope_variable), scope, name);
+ semsg(_(e_cannot_declare_a_scope_variable_str), scope, name);
}
/*
@@ -1578,7 +1578,7 @@
{
if (is_decl)
{
- semsg(_(e_variable_already_declared), lhs->lhs_name);
+ semsg(_(e_variable_already_declared_str), lhs->lhs_name);
return FAIL;
}
}
@@ -1748,7 +1748,7 @@
if (oplen > 1 && !heredoc)
{
// +=, /=, etc. require an existing variable
- semsg(_(e_cannot_use_operator_on_new_variable), lhs->lhs_name);
+ semsg(_(e_cannot_use_operator_on_new_variable_str), lhs->lhs_name);
return FAIL;
}
if (!is_decl || (lhs->lhs_has_index && !has_cmd
@@ -1851,14 +1851,14 @@
if (!lhs->lhs_has_index && lhs->lhs_lvar == &lhs->lhs_arg_lvar)
{
- semsg(_(e_cannot_assign_to_argument), lhs->lhs_name);
+ semsg(_(e_cannot_assign_to_argument_str), lhs->lhs_name);
return FAIL;
}
if (!is_decl && lhs->lhs_lvar != NULL
&& lhs->lhs_lvar->lv_const != ASSIGN_VAR
&& !lhs->lhs_has_index)
{
- semsg(_(e_cannot_assign_to_constant), lhs->lhs_name);
+ semsg(_(e_cannot_assign_to_constant_str), lhs->lhs_name);
return FAIL;
}
return OK;