]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.1032: error message for declaring a variable cannot be translated v8.2.1032
authorBram Moolenaar <Bram@vim.org>
Sun, 21 Jun 2020 18:38:28 +0000 (20:38 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 21 Jun 2020 18:38:28 +0000 (20:38 +0200)
Problem:    Error message for declaring a variable cannot be translated.
Solution:   Enclose in _().  Make environment variable a separate message.

src/globals.h
src/version.c
src/vim9compile.c

index 5dc139eebba84c81b15c9ae53d18703ac8d30616..a8ff50cc471d57273a018c77898ab9dad046613c 100644 (file)
@@ -1788,7 +1788,8 @@ EXTERN char e_no_white_before[] INIT(= N_("E1068: No white space allowed before
 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"));
index bfcd95d6c4f73aedf1eba6b24726146c6ff3ef40..5463b44c0001c82fa0a98506ddccb709e26af717 100644 (file)
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1032,
 /**/
     1031,
 /**/
index 871e70736fcc6815d6a9fb52996b17fc9c2f86d8..52ca9e219b0cbddf26e79a317ffc027d54f2974b 100644 (file)
@@ -4679,12 +4679,13 @@ vim9_declare_error(char_u *name)
 
     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);
 }