Hi Bram,

2020年6月22日月曜日 3時38分54秒 UTC+9 Bram Moolenaar:
>
>
> Ken Takata wrote: 
>
> > 2020年6月21日日曜日 22時53分37秒 UTC+9 Bram Moolenaar: 
> > > 
> > > 
> > > Patch 8.2.1028 
> > > Problem:    Vim9: no error for declaring buffer, window, etc. 
> variable. 
> > > Solution:   Give an error.  Unify the error messages. 
> > > Files:      src/evalvars.c, src/globals.h, src/vim9compile.c, 
> > >             src/proto/vim9compile.pro, 
> src/testdir/test_vim9_expr.vim, 
> > >             src/testdir/test_vim9_script.vim 
> > > 
> > > 
> > ! EXTERN char e_declare_var[]        INIT(= N_("E1016: Cannot declare 
> a%s 
> > > variable: %s")); 
> > > 
> > 
> > This is tricky. 
> >   
> > 
> > > +         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; 
> > 
> > These strings should be translatable. 
>
> I suppose that's consistent with other places where these words are 
> used.  It won't work for "an environment", I'll make that a separate 
> message.  Hopefully that is not needed for the other cases. 
>

How about this?

EXTERN char e_declare_var[]    INIT(= N_("E1016: Cannot declare %s 
variable: %s"));

    case 'g': scope = _("a global"); break;
    case 'b': scope = _("a buffer"); break;
    case 'w': scope = _("a window"); break;
    case 't': scope = _("a tab"); break;
    case 'v': scope = _("a v:"); break;
    case '$': scope = _("an environment"); break;

 

> This message is only used once, but still defined in globals.h. 
> I'm wondering if we should either move a message like this to where it 
> is used, or put all messages together, and sort them on number.  One 
> disadvantage is that the context of the message may be less clear. 
>
 
Regards,
Ken Takata

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/07fff910-33c0-4d65-a9a5-afa8a6ff2ebao%40googlegroups.com.

Raspunde prin e-mail lui