comparison runtime/tutor/tutor.vim @ 782:d20041a02ee5

updated for version 7.0228
author vimboss
date Sat, 18 Mar 2006 21:40:56 +0000
parents 862863033fdd
children 2fb204616c9b
comparison
equal deleted inserted replaced
781:afa9ef8a18a1 782:d20041a02ee5
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 " Last Change: 2005 Oct 16 3 " Last Change: 2006 Mar 18
4 4
5 " This small source file is used for detecting if a translation of the 5 " This small source file is used for detecting if a translation of the
6 " tutor file exist, i.e., a tutor.xx file, where xx is the language. 6 " tutor file exist, i.e., a tutor.xx file, where xx is the language.
7 " If the translation does not exist, or no extension is given, 7 " If the translation does not exist, or no extension is given,
8 " it defaults to the english version. 8 " it defaults to the english version.
13 let s:ext = "" 13 let s:ext = ""
14 if strlen($xx) > 1 14 if strlen($xx) > 1
15 let s:ext = "." . $xx 15 let s:ext = "." . $xx
16 else 16 else
17 let s:lang = "" 17 let s:lang = ""
18 if exists("v:lang") 18 " Check that a potential value has at least two letters.
19 " Ignore "1043" and "C".
20 if exists("v:lang") && v:lang =~ '\a\a'
19 let s:lang = v:lang 21 let s:lang = v:lang
20 elseif strlen($LC_ALL) > 0 22 elseif $LC_ALL =~ '\a\a'
21 let s:lang = $LC_ALL 23 let s:lang = $LC_ALL
22 elseif strlen($LANG) > 0 24 elseif $LANG =~ '\a\a'
23 let s:lang = $LANG 25 let s:lang = $LANG
24 endif
25 if s:lang == "C"
26 let s:lang = ""
27 endif 26 endif
28 if s:lang != "" 27 if s:lang != ""
29 " Remove "@euro" (ignoring case), it may be at the end 28 " Remove "@euro" (ignoring case), it may be at the end
30 let s:lang = substitute(s:lang, '\c@euro', '', '') 29 let s:lang = substitute(s:lang, '\c@euro', '', '')
31 " On MS-Windows it may be German_Germany.1252 or Polish_Poland.1250. How 30 " On MS-Windows it may be German_Germany.1252 or Polish_Poland.1250. How
34 let s:ext = ".de" 33 let s:ext = ".de"
35 elseif s:lang =~ "Polish" 34 elseif s:lang =~ "Polish"
36 let s:ext = ".pl" 35 let s:ext = ".pl"
37 elseif s:lang =~ "Slovak" 36 elseif s:lang =~ "Slovak"
38 let s:ext = ".sk" 37 let s:ext = ".sk"
38 elseif s:lang =~ "Dutch"
39 let s:ext = ".nl"
39 else 40 else
40 let s:ext = "." . strpart(s:lang, 0, 2) 41 let s:ext = "." . strpart(s:lang, 0, 2)
41 endif 42 endif
42 endif 43 endif
43 endif 44 endif