Mercurial > vim
comparison runtime/tutor/tutor.vim @ 16168:7688bff96a8c v8.1.1089
patch 8.1.1089: tutor does not check $LC_MESSAGES
commit https://github.com/vim/vim/commit/b44b7add8ae8e15328b4f68c3caf511bd9aaac8c
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Mar 30 19:56:46 2019 +0100
patch 8.1.1089: tutor does not check $LC_MESSAGES
Problem: Tutor does not check $LC_MESSAGES.
Solution: Let $LC_MESSAGES overrule $LANG. (Miklos Vajna, closes https://github.com/vim/vim/issues/4112)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 30 Mar 2019 20:00:06 +0100 |
parents | 2a4a2dc35c55 |
children | c4cdc715cb68 |
comparison
equal
deleted
inserted
replaced
16167:ff925d952c91 | 16168:7688bff96a8c |
---|---|
1 " Vim tutor support file | 1 " Vim tutor support file |
2 " Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es> | 2 " Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es> |
3 " Maintainer: Bram Moolenaar | 3 " Maintainer: Bram Moolenaar |
4 " Last Change: 2018 Apr 11 | 4 " Last Change: 2019 Mar 30 |
5 | 5 |
6 " This Vim script is used for detecting if a translation of the | 6 " This Vim script is used for detecting if a translation of the |
7 " tutor file exist, i.e., a tutor.xx file, where xx is the language. | 7 " tutor file exist, i.e., a tutor.xx file, where xx is the language. |
8 " If the translation does not exist, or no extension is given, | 8 " If the translation does not exist, or no extension is given, |
9 " it defaults to the English version. | 9 " it defaults to the English version. |
20 " Ignore "1043" and "C". | 20 " Ignore "1043" and "C". |
21 if exists("v:lang") && v:lang =~ '\a\a' | 21 if exists("v:lang") && v:lang =~ '\a\a' |
22 let s:lang = v:lang | 22 let s:lang = v:lang |
23 elseif $LC_ALL =~ '\a\a' | 23 elseif $LC_ALL =~ '\a\a' |
24 let s:lang = $LC_ALL | 24 let s:lang = $LC_ALL |
25 elseif $LC_MESSAGES =~ '\a\a' || $LC_MESSAGES ==# "C" | |
26 " LC_MESSAGES=C can be used to explicitly ask for English messages while | |
27 " keeping LANG non-English; don't set s:lang then. | |
28 if $LC_MESSAGES =~ '\a\a' | |
29 let s:lang = $LC_MESSAGES | |
30 endif | |
25 elseif $LANG =~ '\a\a' | 31 elseif $LANG =~ '\a\a' |
26 let s:lang = $LANG | 32 let s:lang = $LANG |
27 endif | 33 endif |
28 if s:lang != "" | 34 if s:lang != "" |
29 " Remove "@euro" (ignoring case), it may be at the end | 35 " Remove "@euro" (ignoring case), it may be at the end |