0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1572: error messages are not translated

Problem:    Error messages are not translated.
Solution:   Add _().
This commit is contained in:
Bram Moolenaar
2023-05-20 16:39:07 +01:00
parent 79cdf026f1
commit 50809a45eb
7 changed files with 46 additions and 44 deletions

View File

@@ -1022,7 +1022,7 @@ crypt_sodium_init_(
return OK; return OK;
# else # else
emsg(e_libsodium_not_built_in); emsg(_(e_libsodium_not_built_in));
return FAIL; return FAIL;
# endif # endif
} }
@@ -1051,7 +1051,7 @@ crypt_sodium_encode(
{ {
if (len <= crypto_secretstream_xchacha20poly1305_HEADERBYTES) if (len <= crypto_secretstream_xchacha20poly1305_HEADERBYTES)
{ {
emsg(e_libsodium_cannot_encrypt_header); emsg(_(e_libsodium_cannot_encrypt_header));
return; return;
} }
crypto_secretstream_xchacha20poly1305_init_push(&sod_st->state, crypto_secretstream_xchacha20poly1305_init_push(&sod_st->state,
@@ -1061,7 +1061,7 @@ crypt_sodium_encode(
if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES)
{ {
emsg(e_libsodium_cannot_encrypt_buffer); emsg(_(e_libsodium_cannot_encrypt_buffer));
return; return;
} }
@@ -1098,7 +1098,7 @@ crypt_sodium_decode(
if (sod_st->count == 0 if (sod_st->count == 0
&& len <= crypto_secretstream_xchacha20poly1305_HEADERBYTES) && len <= crypto_secretstream_xchacha20poly1305_HEADERBYTES)
{ {
emsg(e_libsodium_cannot_decrypt_header); emsg(_(e_libsodium_cannot_decrypt_header));
return; return;
} }
@@ -1106,7 +1106,7 @@ crypt_sodium_decode(
if (buf_out == NULL) if (buf_out == NULL)
{ {
emsg(e_libsodium_cannot_allocate_buffer); emsg(_(e_libsodium_cannot_allocate_buffer));
return; return;
} }
if (sod_st->count == 0) if (sod_st->count == 0)
@@ -1114,7 +1114,7 @@ crypt_sodium_decode(
if (crypto_secretstream_xchacha20poly1305_init_pull( if (crypto_secretstream_xchacha20poly1305_init_pull(
&sod_st->state, from, sod_st->key) != 0) &sod_st->state, from, sod_st->key) != 0)
{ {
emsg(e_libsodium_decryption_failed_header_incomplete); emsg(_(e_libsodium_decryption_failed_header_incomplete));
goto fail; goto fail;
} }
@@ -1127,20 +1127,20 @@ crypt_sodium_decode(
if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES) if (sod_st->count && len <= crypto_secretstream_xchacha20poly1305_ABYTES)
{ {
emsg(e_libsodium_cannot_decrypt_buffer); emsg(_(e_libsodium_cannot_decrypt_buffer));
goto fail; goto fail;
} }
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
buf_out, &buf_len, &tag, from, len, NULL, 0) != 0) buf_out, &buf_len, &tag, from, len, NULL, 0) != 0)
{ {
emsg(e_libsodium_decryption_failed); emsg(_(e_libsodium_decryption_failed));
goto fail; goto fail;
} }
sod_st->count++; sod_st->count++;
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
{ {
emsg(e_libsodium_decryption_failed_premature); emsg(_(e_libsodium_decryption_failed_premature));
goto fail; goto fail;
} }
if (p1 == p2) if (p1 == p2)
@@ -1179,7 +1179,7 @@ crypt_sodium_buffer_encode(
*buf_out = alloc_clear(length); *buf_out = alloc_clear(length);
if (*buf_out == NULL) if (*buf_out == NULL)
{ {
emsg(e_libsodium_cannot_allocate_buffer); emsg(_(e_libsodium_cannot_allocate_buffer));
return -1; return -1;
} }
ptr = *buf_out; ptr = *buf_out;
@@ -1230,7 +1230,7 @@ crypt_sodium_buffer_decode(
*buf_out = alloc_clear(len); *buf_out = alloc_clear(len);
if (*buf_out == NULL) if (*buf_out == NULL)
{ {
emsg(e_libsodium_cannot_allocate_buffer); emsg(_(e_libsodium_cannot_allocate_buffer));
return -1; return -1;
} }
@@ -1239,7 +1239,7 @@ crypt_sodium_buffer_decode(
if (crypto_secretstream_xchacha20poly1305_init_pull(&sod_st->state, if (crypto_secretstream_xchacha20poly1305_init_pull(&sod_st->state,
from, sod_st->key) != 0) from, sod_st->key) != 0)
{ {
emsg(e_libsodium_decryption_failed_header_incomplete); emsg(_(e_libsodium_decryption_failed_header_incomplete));
return -1; return -1;
} }
from += crypto_secretstream_xchacha20poly1305_HEADERBYTES; from += crypto_secretstream_xchacha20poly1305_HEADERBYTES;
@@ -1249,12 +1249,12 @@ crypt_sodium_buffer_decode(
if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state, if (crypto_secretstream_xchacha20poly1305_pull(&sod_st->state,
*buf_out, &out_len, &tag, from, len, NULL, 0) != 0) *buf_out, &out_len, &tag, from, len, NULL, 0) != 0)
{ {
emsg(e_libsodium_decryption_failed); emsg(_(e_libsodium_decryption_failed));
return -1; return -1;
} }
if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last) if (tag == crypto_secretstream_xchacha20poly1305_TAG_FINAL && !last)
emsg(e_libsodium_decryption_failed_premature); emsg(_(e_libsodium_decryption_failed_premature));
return (long) out_len; return (long) out_len;
# else # else
return -1; return -1;

View File

@@ -2956,7 +2956,7 @@ gui_mch_get_font(char_u *vim_font_name, int report_error)
} }
if (report_error) if (report_error)
semsg(e_unknown_font_str, vim_font_name); semsg(_(e_unknown_font_str), vim_font_name);
return FAIL; return FAIL;
} }

View File

@@ -3198,7 +3198,7 @@ source_startup_scripts(mparm_T *parmp)
{ {
if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, NULL) if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, NULL)
!= OK) != OK)
emsg(e_failed_to_source_defaults); emsg(_(e_failed_to_source_defaults));
} }
else if (STRCMP(parmp->use_vimrc, "NONE") == 0 else if (STRCMP(parmp->use_vimrc, "NONE") == 0
|| STRCMP(parmp->use_vimrc, "NORC") == 0) || STRCMP(parmp->use_vimrc, "NORC") == 0)
@@ -3273,7 +3273,7 @@ source_startup_scripts(mparm_T *parmp)
// When no .vimrc file was found: source defaults.vim. // When no .vimrc file was found: source defaults.vim.
if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE, if (do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE,
NULL) == FAIL) NULL) == FAIL)
emsg(e_failed_to_source_defaults); emsg(_(e_failed_to_source_defaults));
} }
} }

View File

@@ -477,7 +477,7 @@ nb_parse_cmd(char_u *cmd)
if (*verb != ':') if (*verb != ':')
{ {
nbdebug((" missing colon: %s\n", cmd)); nbdebug((" missing colon: %s\n", cmd));
semsg(e_missing_colon_str, cmd); semsg(_(e_missing_colon_str), cmd);
return; return;
} }
++verb; // skip colon ++verb; // skip colon
@@ -501,7 +501,7 @@ nb_parse_cmd(char_u *cmd)
if (isfunc < 0) if (isfunc < 0)
{ {
nbdebug((" missing ! or / in: %s\n", cmd)); nbdebug((" missing ! or / in: %s\n", cmd));
semsg(e_missing_bang_or_slash_in_str, cmd); semsg(_(e_missing_bang_or_slash_in_str), cmd);
return; return;
} }
@@ -518,7 +518,7 @@ nb_parse_cmd(char_u *cmd)
* so I'm disabling it except for debugging. * so I'm disabling it except for debugging.
*/ */
nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd)); nbdebug(("nb_parse_cmd: Command error for \"%s\"\n", cmd));
emsg(e_bad_return_from_nb_do_cmd); emsg(_(e_bad_return_from_nb_do_cmd));
#endif #endif
} }
} }
@@ -1040,7 +1040,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" Invalid buffer identifier in getAnno\n")); nbdebug((" Invalid buffer identifier in getAnno\n"));
emsg(e_invalid_buffer_identifier_in_getanno); emsg(_(e_invalid_buffer_identifier_in_getanno));
retval = FAIL; retval = FAIL;
} }
else else
@@ -1063,7 +1063,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in getLength\n")); nbdebug((" invalid buffer identifier in getLength\n"));
emsg(e_invalid_buffer_identifier_in_getlength); emsg(_(e_invalid_buffer_identifier_in_getlength));
retval = FAIL; retval = FAIL;
} }
else else
@@ -1085,7 +1085,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in getText\n")); nbdebug((" invalid buffer identifier in getText\n"));
emsg(e_invalid_buffer_identifier_in_gettext); emsg(_(e_invalid_buffer_identifier_in_gettext));
retval = FAIL; retval = FAIL;
} }
else else
@@ -1148,7 +1148,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in remove\n")); nbdebug((" invalid buffer identifier in remove\n"));
emsg(e_invalid_buffer_identifier_in_remove); emsg(_(e_invalid_buffer_identifier_in_remove));
retval = FAIL; retval = FAIL;
} }
else else
@@ -1318,7 +1318,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in insert\n")); nbdebug((" invalid buffer identifier in insert\n"));
emsg(e_invalid_buffer_identifier_in_insert); emsg(_(e_invalid_buffer_identifier_in_insert));
retval = FAIL; retval = FAIL;
} }
else if (args != NULL) else if (args != NULL)
@@ -1478,7 +1478,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in create\n")); nbdebug((" invalid buffer identifier in create\n"));
emsg(e_invalid_buffer_identifier_in_create); emsg(_(e_invalid_buffer_identifier_in_create));
return FAIL; return FAIL;
} }
VIM_CLEAR(buf->displayname); VIM_CLEAR(buf->displayname);
@@ -1526,7 +1526,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in startDocumentListen\n")); nbdebug((" invalid buffer identifier in startDocumentListen\n"));
emsg(e_invalid_buffer_identifier_in_startdocumentlisten); emsg(_(e_invalid_buffer_identifier_in_startdocumentlisten));
return FAIL; return FAIL;
} }
buf->fireChanges = 1; buf->fireChanges = 1;
@@ -1537,7 +1537,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in stopDocumentListen\n")); nbdebug((" invalid buffer identifier in stopDocumentListen\n"));
emsg(e_invalid_buffer_identifier_in_stopdocumentlisten); emsg(_(e_invalid_buffer_identifier_in_stopdocumentlisten));
return FAIL; return FAIL;
} }
buf->fireChanges = 0; buf->fireChanges = 0;
@@ -1567,7 +1567,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in setTitle\n")); nbdebug((" invalid buffer identifier in setTitle\n"));
emsg(e_invalid_buffer_identifier_in_settitle); emsg(_(e_invalid_buffer_identifier_in_settitle));
return FAIL; return FAIL;
} }
vim_free(buf->displayname); vim_free(buf->displayname);
@@ -1579,7 +1579,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in initDone\n")); nbdebug((" invalid buffer identifier in initDone\n"));
emsg(e_invalid_buffer_identifier_in_initdone); emsg(_(e_invalid_buffer_identifier_in_initdone));
return FAIL; return FAIL;
} }
do_update = 1; do_update = 1;
@@ -1600,7 +1600,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in setBufferNumber\n")); nbdebug((" invalid buffer identifier in setBufferNumber\n"));
emsg(e_invalid_buffer_identifier_in_setbuffernumber); emsg(_(e_invalid_buffer_identifier_in_setbuffernumber));
return FAIL; return FAIL;
} }
path = (char_u *)nb_unquote(args, NULL); path = (char_u *)nb_unquote(args, NULL);
@@ -1611,7 +1611,7 @@ nb_do_cmd(
if (bufp == NULL) if (bufp == NULL)
{ {
nbdebug((" File %s not found in setBufferNumber\n", args)); nbdebug((" File %s not found in setBufferNumber\n", args));
semsg(e_file_str_not_found_in_setbuffernumber, args); semsg(_(e_file_str_not_found_in_setbuffernumber), args);
return FAIL; return FAIL;
} }
buf->bufp = bufp; buf->bufp = bufp;
@@ -1636,7 +1636,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in setFullName\n")); nbdebug((" invalid buffer identifier in setFullName\n"));
emsg(e_invalid_buffer_identifier_in_setfullname); emsg(_(e_invalid_buffer_identifier_in_setfullname));
return FAIL; return FAIL;
} }
vim_free(buf->displayname); vim_free(buf->displayname);
@@ -1659,7 +1659,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in editFile\n")); nbdebug((" invalid buffer identifier in editFile\n"));
emsg(e_invalid_buffer_identifier_in_editfile); emsg(_(e_invalid_buffer_identifier_in_editfile));
return FAIL; return FAIL;
} }
// Edit a file: like create + setFullName + read the file. // Edit a file: like create + setFullName + read the file.
@@ -1685,7 +1685,7 @@ nb_do_cmd(
// This message was commented out, probably because it can // This message was commented out, probably because it can
// happen when shutting down. // happen when shutting down.
if (p_verbose > 0) if (p_verbose > 0)
emsg(e_invalid_buffer_identifier_in_setvisible); emsg(_(e_invalid_buffer_identifier_in_setvisible));
return FAIL; return FAIL;
} }
if (streq((char *)args, "T") && buf->bufp != curbuf) if (streq((char *)args, "T") && buf->bufp != curbuf)
@@ -1725,7 +1725,7 @@ nb_do_cmd(
// This message was commented out, probably because it can // This message was commented out, probably because it can
// happen when shutting down. // happen when shutting down.
if (p_verbose > 0) if (p_verbose > 0)
emsg(e_invalid_buffer_identifier_in_setmodified); emsg(_(e_invalid_buffer_identifier_in_setmodified));
return FAIL; return FAIL;
} }
prev_b_changed = buf->bufp->b_changed; prev_b_changed = buf->bufp->b_changed;
@@ -1808,7 +1808,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in setDot\n")); nbdebug((" invalid buffer identifier in setDot\n"));
emsg(e_invalid_buffer_identifier_in_setdot); emsg(_(e_invalid_buffer_identifier_in_setdot));
return FAIL; return FAIL;
} }
@@ -1861,7 +1861,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in close\n")); nbdebug((" invalid buffer identifier in close\n"));
emsg(e_invalid_buffer_identifier_in_close); emsg(_(e_invalid_buffer_identifier_in_close));
return FAIL; return FAIL;
} }
@@ -1875,7 +1875,7 @@ nb_do_cmd(
// This message was commented out, probably because it can // This message was commented out, probably because it can
// happen when shutting down. // happen when shutting down.
if (p_verbose > 0) if (p_verbose > 0)
emsg(e_invalid_buffer_identifier_in_close_2); emsg(_(e_invalid_buffer_identifier_in_close_2));
} }
nbdebug((" CLOSE %d: %s\n", bufno, name)); nbdebug((" CLOSE %d: %s\n", bufno, name));
#ifdef FEAT_GUI #ifdef FEAT_GUI
@@ -1914,7 +1914,7 @@ nb_do_cmd(
if (buf == NULL) if (buf == NULL)
{ {
nbdebug((" invalid buffer identifier in defineAnnoType\n")); nbdebug((" invalid buffer identifier in defineAnnoType\n"));
emsg(e_invalid_buffer_identifier_in_defineannotype); emsg(_(e_invalid_buffer_identifier_in_defineannotype));
return FAIL; return FAIL;
} }
@@ -1942,7 +1942,7 @@ nb_do_cmd(
bg = vim_strsave(p); bg = vim_strsave(p);
if (STRLEN(fg) > MAX_COLOR_LENGTH || STRLEN(bg) > MAX_COLOR_LENGTH) if (STRLEN(fg) > MAX_COLOR_LENGTH || STRLEN(bg) > MAX_COLOR_LENGTH)
{ {
emsg(e_highlighting_color_name_too_long_in_defineAnnoType); emsg(_(e_highlighting_color_name_too_long_in_defineAnnoType));
VIM_CLEAR(typeName); VIM_CLEAR(typeName);
parse_error = TRUE; parse_error = TRUE;
} }
@@ -1971,7 +1971,7 @@ nb_do_cmd(
if (buf == NULL || buf->bufp == NULL) if (buf == NULL || buf->bufp == NULL)
{ {
nbdebug((" invalid buffer identifier in addAnno\n")); nbdebug((" invalid buffer identifier in addAnno\n"));
emsg(e_invalid_buffer_identifier_in_addanno); emsg(_(e_invalid_buffer_identifier_in_addanno));
return FAIL; return FAIL;
} }

View File

@@ -7705,7 +7705,7 @@ mch_libcall(
for (i = 0; signal_info[i].sig != -1; i++) for (i = 0; signal_info[i].sig != -1; i++)
if (lc_signal == signal_info[i].sig) if (lc_signal == signal_info[i].sig)
break; break;
semsg(e_got_sig_str_in_libcall, signal_info[i].name); semsg(_(e_got_sig_str_in_libcall), signal_info[i].name);
} }
# endif # endif
# endif # endif

View File

@@ -887,7 +887,7 @@ ex_terminal(exarg_T *eap)
tty_type = 'c'; tty_type = 'c';
else else
{ {
semsg(e_invalid_value_for_argument_str, "type"); semsg(_(e_invalid_value_for_argument_str), "type");
goto theend; goto theend;
} }
opt.jo_set2 |= JO2_TTY_TYPE; opt.jo_set2 |= JO2_TTY_TYPE;

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1572,
/**/ /**/
1571, 1571,
/**/ /**/