The prepositions “to” and “from” are not available for translation and are included in the translated text as is.
E1515: Konvertierung from 'utf-8'-Codierung nicht möglich
E1515: Impossible de convertir to encodage "latin1"
E1515: Impossibile convertire from codifica "ab12xy"
Vim 9.1.1016 and later
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()
It may not be the prettiest way to fix it
--- a/src/strings.c +++ b/src/strings.c @@ -1339,7 +1339,9 @@ f_blob2str(typval_T *argvars, typval_T *rettv) vim_free(str); if (converted_str == NULL) { - semsg(_(e_str_encoding_failed), "from", from_encoding); + //Translator. This preposition "from" is inserted in the error + //message "E1515: Unable to convert from '<enc>' encoding" + semsg(_(e_str_encoding_failed), _("from"), from_encoding); goto done; } } @@ -1348,7 +1350,9 @@ f_blob2str(typval_T *argvars, typval_T *rettv) { if (!utf_valid_string(converted_str, NULL)) { - semsg(_(e_str_encoding_failed), "from", p_enc); + //Translator. This preposition "from" is inserted in the error + //message "E1515: Unable to convert from '<enc>' encoding" + semsg(_(e_str_encoding_failed), _("from"), p_enc); vim_free(converted_str); goto done; } @@ -1414,7 +1418,9 @@ f_str2blob(typval_T *argvars, typval_T *rettv) str = convert_string(str, p_enc, to_encoding); if (str == NULL) { - semsg(_(e_str_encoding_failed), "to", to_encoding); + //Translator. This preposition "to" is inserted into the error + //message "E1515: Unable to convert to '<enc>' encoding". + semsg(_(e_str_encoding_failed), _("to"), to_encoding); goto done; } }
--- a/src/errors.h +++ b/src/errors.h @@ -3661,4 +3661,7 @@ EXTERN char e_winfixbuf_cannot_go_to_buffer[] EXTERN char e_invalid_return_type_from_findfunc[] INIT(= N_("E1514: 'findfunc' did not return a List type")); EXTERN char e_str_encoding_failed[] +//Translator. The first format character %s is replaced by the preposition +//"to" or "from" in the error message +//"E1515: Unable to convert {to | from} '<enc>' encoding" INIT(= N_("E1515: Unable to convert %s '%s' encoding"));
Maybe @yegappan can come up with something more elegant.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
That is better, isn't it:
diff --git a/src/errors.h b/src/errors.h index a1165056b..ca5ec850e 100644 --- a/src/errors.h +++ b/src/errors.h @@ -3660,5 +3660,7 @@ EXTERN char e_winfixbuf_cannot_go_to_buffer[] INIT(= N_("E1513: Cannot switch buffer. 'winfixbuf' is enabled")); EXTERN char e_invalid_return_type_from_findfunc[] INIT(= N_("E1514: 'findfunc' did not return a List type")); -EXTERN char e_str_encoding_failed[] - INIT(= N_("E1515: Unable to convert %s '%s' encoding")); +EXTERN char e_str_encoding_from_failed[] + INIT(= N_("E1515: Unable to convert from '%s' encoding")); +EXTERN char e_str_encoding_to_failed[] + INIT(= N_("E1516: Unable to convert to '%s' encoding")); diff --git a/src/strings.c b/src/strings.c index 640ad39a8..d6f1b3823 100644 --- a/src/strings.c +++ b/src/strings.c @@ -1339,7 +1339,7 @@ f_blob2str(typval_T *argvars, typval_T *rettv) vim_free(str); if (converted_str == NULL) {
- semsg(_(e_str_encoding_failed), "from", from_encoding);
+ semsg(_(e_str_encoding_from_failed), from_encoding); goto done; } } @@ -1348,7 +1348,7 @@ f_blob2str(typval_T *argvars, typval_T *rettv) { if (!utf_valid_string(converted_str, NULL)) {
- semsg(_(e_str_encoding_failed), "from", p_enc);
+ semsg(_(e_str_encoding_from_failed), p_enc); vim_free(converted_str); goto done; } @@ -1414,7 +1414,7 @@ f_str2blob(typval_T *argvars, typval_T *rettv) str = convert_string(str, p_enc, to_encoding); if (str == NULL) {
- semsg(_(e_str_encoding_failed), "to", to_encoding);
+ semsg(_(e_str_encoding_to_failed), to_encoding);
goto done;
}
}—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Yes, that's better.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
Closed #16898 as completed via d5afc74.
—
Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.![]()