Ken Takata wrote:

> Some error messages about smack are divided into small pieces, so they
> cannot be translated to other languages like Japanese which syntax is
> different from English.
> The following patch fixes the problem:
> 
> --- a/src/os_unix.c
> +++ b/src/os_unix.c
> @@ -2848,11 +2848,10 @@ mch_copy_sec(from_file, to_file)
>           ret = setxattr((char*)to_file, name, buffer, (size_t)size, 0);
>           if (ret < 0)
>           {
> -             MSG_PUTS(_("Could not set security context "));
> -             MSG_PUTS(name);
> -             MSG_PUTS(_(" for "));
> -             msg_outtrans(to_file);
> -             msg_putchar('\n');
> +             vim_snprintf((char *)IObuff, IOSIZE,
> +                     _("Could not set security context %s for %s\n"),
> +                     name, to_file);
> +             msg_puts(IObuff);
>           }
>       }
>       else
> @@ -2868,11 +2867,10 @@ mch_copy_sec(from_file, to_file)
>               case ERANGE:
>               default:
>                   /* no enough size OR unexpected error */
> -                 MSG_PUTS(_("Could not get security context "));
> -                 MSG_PUTS(name);
> -                 MSG_PUTS(_(" for "));
> -                 msg_outtrans(from_file);
> -                 MSG_PUTS(_(". Removing it!\n"));
> +                 vim_snprintf((char *)IObuff, IOSIZE,
> +                         _("Could not get security context %s for %s. 
> Removing it!\n"),
> +                         name, from_file);
> +                 msg_puts(IObuff);
>                   /* FALLTHROUGH to remove the attribute */
>  
>               case ENODATA:
> 
> 
> I'm not sure using msg_puts() is okay. msg_outtrans() should be used
> instead?

Thanks.  yes, the file name may contain special characters and those
need to be translated.  But then the newline also gets translated, thus
it has to be written separately:

                vim_snprintf((char *)IObuff, IOSIZE,
                        _("Could not set security context %s for %s"),
                        name, to_file);
                msg_outtrans(IObuff);
                msg_putchar('\n');

-- 
Never go to the toilet in a paperless office.

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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 vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui