vim tutor support file

Bram Moolenaar Bram@moolenaar.net
Tue, 15 Mar 2005 13:34:56 +0100


Pierre Habouzit wrote:

> I sent that to the tutor/tutor.vim maintainer, but his mailbox
> bounced, so I post it to the list, hoping someone would take it into
> account. 

I'm looking into this.

> Hi, I'm one of the debian VIM packaging crew.
> 
> We have a user that complained for vimtutor not respecting usual 
> LC_ALL/LC_MESSAGE/... semantics (see http://bugs.debian.org/289113)
> 
> attached is a patch that corrects the issue, and that will be included 
> in our next vim upload.

I don't think $LC_MESSAGE applies here.  This is not about (error)
messages.  Checking $LC_ALL is useful though.

>    let s:ext = "." . $xx
>  else
>    let s:lang = ""
> -  if exists("v:lang") && v:lang != "C"
> +  if exists("v:lang")
>      let s:lang = v:lang
> -  elseif strlen($LANG) > 0 && $LANG != "C"
> +  elseif strlen($LC_MESSAGES) > 0
>      let s:lang = $LANG
> +  elseif strlen($LC_ALL) > 0
> +    let s:lang = $LANG
> +  elseif strlen($LANG) > 0
> +    let s:lang = $LANG
> +  endif
> +  if s:lang == "C"
> +    let s:lang=""
>    endif
>    if s:lang != ""
>      " Remove "@euro" (ignoring case), it may be at the end

There are a few mistakes in there.  How about this:

  let s:lang = ""
  if exists("v:lang")
    let s:lang = v:lang
  elseif strlen($LC_ALL) > 0
    let s:lang = $LC_ALL
  elseif strlen($LANG) > 0
    let s:lang = $LANG
  endif
  if s:lang == "C"
    let s:lang = ""
  endif


-- 
An indication you must be a manager:
You give constructive feedback to your dog.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\     Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html   ///