patch 8.2.1032: error message for declaring a variable cannot be translated
Problem: Error message for declaring a variable cannot be translated.
Solution: Enclose in _(). Make environment variable a separate message.
diff --git a/src/globals.h b/src/globals.h
index 5dc139e..a8ff50c 100644
--- a/src/globals.h
+++ b/src/globals.h
@@ -1788,7 +1788,8 @@
EXTERN char e_lock_unlock[] INIT(= N_("E940: Cannot lock or unlock variable %s"));
EXTERN char e_const_req_value[] INIT(= N_("E1021: const requires a value"));
EXTERN char e_type_req[] INIT(= N_("E1022: type or initialization required"));
-EXTERN char e_declare_var[] INIT(= N_("E1016: Cannot declare a%s variable: %s"));
+EXTERN char e_declare_var[] INIT(= N_("E1016: Cannot declare a %s variable: %s"));
+EXTERN char e_declare_env_var[] INIT(= N_("E1016: Cannot declare an environment variable: %s"));
#endif
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
EXTERN char e_alloc_color[] INIT(= N_("E254: Cannot allocate color %s"));
diff --git a/src/version.c b/src/version.c
index bfcd95d..5463b44 100644
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1032,
+/**/
1031,
/**/
1030,
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 871e707..52ca9e2 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -4679,12 +4679,13 @@
switch (*name)
{
- case 'g': scope = " global"; break;
- case 'b': scope = " buffer"; break;
- case 'w': scope = " window"; break;
- case 't': scope = " tab"; break;
- case 'v': scope = " v:"; break;
- case '$': scope = "n environment"; break;
+ case 'g': scope = _("global"); break;
+ case 'b': scope = _("buffer"); break;
+ case 'w': scope = _("window"); break;
+ case 't': scope = _("tab"); break;
+ case 'v': scope = "v:"; break;
+ case '$': semsg(_(e_declare_env_var), name); return;
+ default: return;
}
semsg(_(e_declare_var), scope, name);
}