Skip to content

Commit 5b30291

Browse files
committed
patch 7.4.2250
Problem: Some error message cannot be translated. Solution: Enclose them in _() and N_(). (Dominique Pelle)
1 parent ba20990 commit 5b30291

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

src/channel.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ channel_open(
702702
if ((host = gethostbyname(hostname)) == NULL)
703703
{
704704
ch_error(channel, "in gethostbyname() in channel_open()");
705-
PERROR("E901: gethostbyname() in channel_open()");
705+
PERROR(_("E901: gethostbyname() in channel_open()"));
706706
channel_free(channel);
707707
return NULL;
708708
}
@@ -729,7 +729,7 @@ channel_open(
729729
if (sd == -1)
730730
{
731731
ch_error(channel, "in socket() in channel_open().");
732-
PERROR("E898: socket() in channel_open()");
732+
PERROR(_("E898: socket() in channel_open()"));
733733
channel_free(channel);
734734
return NULL;
735735
}
@@ -2070,7 +2070,7 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv)
20702070
{
20712071
ch_error(channel, "received command with non-string argument");
20722072
if (p_verbose > 2)
2073-
EMSG("E903: received command with non-string argument");
2073+
EMSG(_("E903: received command with non-string argument"));
20742074
return;
20752075
}
20762076
arg = argv[1].vval.v_string;
@@ -2129,13 +2129,13 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv)
21292129
{
21302130
ch_error(channel, "last argument for expr/call must be a number");
21312131
if (p_verbose > 2)
2132-
EMSG("E904: last argument for expr/call must be a number");
2132+
EMSG(_("E904: last argument for expr/call must be a number"));
21332133
}
21342134
else if (is_call && argv[2].v_type != VAR_LIST)
21352135
{
21362136
ch_error(channel, "third argument for call must be a list");
21372137
if (p_verbose > 2)
2138-
EMSG("E904: third argument for call must be a list");
2138+
EMSG(_("E904: third argument for call must be a list"));
21392139
}
21402140
else
21412141
{
@@ -2195,7 +2195,7 @@ channel_exe_cmd(channel_T *channel, int part, typval_T *argv)
21952195
else if (p_verbose > 2)
21962196
{
21972197
ch_errors(channel, "Received unknown command: %s", (char *)cmd);
2198-
EMSG2("E905: received unknown command: %s", cmd);
2198+
EMSG2(_("E905: received unknown command: %s"), cmd);
21992199
}
22002200
}
22012201

@@ -3382,7 +3382,7 @@ channel_send(channel_T *channel, int part, char_u *buf, int len, char *fun)
33823382
if (!channel->ch_error && fun != NULL)
33833383
{
33843384
ch_errors(channel, "%s(): write while not connected", fun);
3385-
EMSG2("E630: %s(): write while not connected", fun);
3385+
EMSG2(_("E630: %s(): write while not connected"), fun);
33863386
}
33873387
channel->ch_error = TRUE;
33883388
return FAIL;
@@ -3407,7 +3407,7 @@ channel_send(channel_T *channel, int part, char_u *buf, int len, char *fun)
34073407
if (!channel->ch_error && fun != NULL)
34083408
{
34093409
ch_errors(channel, "%s(): write failed", fun);
3410-
EMSG2("E631: %s(): write failed", fun);
3410+
EMSG2(_("E631: %s(): write failed"), fun);
34113411
}
34123412
channel->ch_error = TRUE;
34133413
return FAIL;

src/evalfunc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7413,7 +7413,7 @@ f_matchadd(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
74137413
return;
74147414
if (id >= 1 && id <= 3)
74157415
{
7416-
EMSGN("E798: ID is reserved for \":match\": %ld", id);
7416+
EMSGN(_("E798: ID is reserved for \":match\": %ld"), id);
74177417
return;
74187418
}
74197419

@@ -7478,7 +7478,7 @@ f_matchaddpos(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
74787478
/* id == 3 is ok because matchaddpos() is supposed to substitute :3match */
74797479
if (id == 1 || id == 2)
74807480
{
7481-
EMSGN("E798: ID is reserved for \":match\": %ld", id);
7481+
EMSGN(_("E798: ID is reserved for \":match\": %ld"), id);
74827482
return;
74837483
}
74847484

src/ex_cmds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7088,7 +7088,7 @@ helptags_one(
70887088
|| filecount == 0)
70897089
{
70907090
if (!got_int)
7091-
EMSG2("E151: No match: %s", NameBuff);
7091+
EMSG2(_("E151: No match: %s"), NameBuff);
70927092
return;
70937093
}
70947094

@@ -7331,7 +7331,7 @@ do_helptags(char_u *dirname, int add_help_tags)
73317331
EW_FILE|EW_SILENT) == FAIL
73327332
|| filecount == 0)
73337333
{
7334-
EMSG2("E151: No match: %s", NameBuff);
7334+
EMSG2(_("E151: No match: %s"), NameBuff);
73357335
return;
73367336
}
73377337

src/spell.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2470,7 +2470,7 @@ did_set_spelllang(win_T *wp)
24702470
* destroying the buffer we are using... */
24712471
if (!bufref_valid(&bufref))
24722472
{
2473-
ret_msg = (char_u *)"E797: SpellFileMissing autocommand deleted buffer";
2473+
ret_msg = (char_u *)N_("E797: SpellFileMissing autocommand deleted buffer");
24742474
goto theend;
24752475
}
24762476
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,6 +763,8 @@ static char *(features[]) =
763763

764764
static int included_patches[] =
765765
{ /* Add new patch number below this line */
766+
/**/
767+
2250,
766768
/**/
767769
2249,
768770
/**/

src/window.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6751,7 +6751,7 @@ match_add(
67516751
return -1;
67526752
if (id < -1 || id == 0)
67536753
{
6754-
EMSGN("E799: Invalid ID: %ld (must be greater than or equal to 1)", id);
6754+
EMSGN(_("E799: Invalid ID: %ld (must be greater than or equal to 1)"), id);
67556755
return -1;
67566756
}
67576757
if (id != -1)
@@ -6761,7 +6761,7 @@ match_add(
67616761
{
67626762
if (cur->id == id)
67636763
{
6764-
EMSGN("E801: ID already taken: %ld", id);
6764+
EMSGN(_("E801: ID already taken: %ld"), id);
67656765
return -1;
67666766
}
67676767
cur = cur->next;
@@ -6938,7 +6938,7 @@ match_delete(win_T *wp, int id, int perr)
69386938
if (id < 1)
69396939
{
69406940
if (perr == TRUE)
6941-
EMSGN("E802: Invalid ID: %ld (must be greater than or equal to 1)",
6941+
EMSGN(_("E802: Invalid ID: %ld (must be greater than or equal to 1)"),
69426942
id);
69436943
return -1;
69446944
}
@@ -6950,7 +6950,7 @@ match_delete(win_T *wp, int id, int perr)
69506950
if (cur == NULL)
69516951
{
69526952
if (perr == TRUE)
6953-
EMSGN("E803: ID not found: %ld", id);
6953+
EMSGN(_("E803: ID not found: %ld"), id);
69546954
return -1;
69556955
}
69566956
if (cur == prev)

0 commit comments

Comments
 (0)