[vim/vim] Incomplete translation of the error message E1515 (Issue #16898)

7 views
Skip to first unread message

Restorer

unread,
Mar 15, 2025, 3:16:23 AM3/15/25
to vim/vim, Subscribed

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, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/16898@github.com>

RestorerZRestorerZ created an issue (vim/vim#16898)

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.Message ID: <vim/vim/issues/16898@github.com>

Restorer

unread,
Mar 15, 2025, 3:27:08 AM3/15/25
to vim/vim, Subscribed

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.Message ID: <vim/vim/issues/16898/2726302970@github.com>

RestorerZRestorerZ left a comment (vim/vim#16898)

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.Message ID: <vim/vim/issues/16898/2726302970@github.com>

Christian Brabandt

unread,
Mar 16, 2025, 4:52:50 PM3/16/25
to vim/vim, Subscribed

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.Message ID: <vim/vim/issues/16898/2727641096@github.com>

chrisbrachrisbra left a comment (vim/vim#16898)

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.Message ID: <vim/vim/issues/16898/2727641096@github.com>

Restorer

unread,
Mar 17, 2025, 2:41:36 PM3/17/25
to vim/vim, Subscribed

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.Message ID: <vim/vim/issues/16898/2730505684@github.com>

RestorerZRestorerZ left a comment (vim/vim#16898)

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.Message ID: <vim/vim/issues/16898/2730505684@github.com>

Christian Brabandt

unread,
Mar 18, 2025, 3:58:45 PM3/18/25
to vim/vim, Subscribed

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.Message ID: <vim/vim/issue/16898/issue_event/16845404179@github.com>

Reply all
Reply to author
Forward
0 new messages