diff options
Diffstat (limited to 'runtime/tutor/tutor.vim')
-rw-r--r-- | runtime/tutor/tutor.vim | 75 |
1 files changed, 42 insertions, 33 deletions
diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim index 3dda1ea0e..81e5a1919 100644 --- a/runtime/tutor/tutor.vim +++ b/runtime/tutor/tutor.vim @@ -1,6 +1,6 @@ " Vim tutor support file " Author: Eduardo F. Amatria <eferna1@platea.pntic.mec.es> -" Last Change: 2007 Mar 01 +" Last Change: 2008 Jun 21 " This small source file is used for detecting if a translation of the " tutor file exist, i.e., a tutor.xx file, where xx is the language. @@ -45,23 +45,28 @@ else endif endif +" Somehow ".ge" (Germany) is sometimes used for ".de" (Deutsch). +if s:ext =~? '\.ge' + let s:ext = ".de" +endif + +if s:ext =~? '\.en' + let s:ext = "" +endif + " The japanese tutor is available in two encodings, guess which one to use " The "sjis" one is actually "cp932", it doesn't matter for this text. if s:ext =~? '\.ja' if &enc =~ "euc" let s:ext = ".ja.euc" - elseif &enc =~ "utf-8$" - let s:ext = ".ja.utf-8" - else + elseif &enc != "utf-8" let s:ext = ".ja.sjis" endif endif " The korean tutor is available in two encodings, guess which one to use if s:ext =~? '\.ko' - if &enc =~ "utf-8$" - let s:ext = ".ko.utf-8" - else + if &enc != "utf-8" let s:ext = ".ko.euc" endif endif @@ -72,7 +77,7 @@ endif if s:ext =~? '\.zh' if &enc =~ 'big5\|cp950' let s:ext = ".zh.big5" - else + elseif &enc != 'utf-8' let s:ext = ".zh.euc" endif endif @@ -81,16 +86,12 @@ endif if s:ext =~? '\.pl' if &enc =~ 1250 let s:ext = ".pl.cp1250" - elseif &enc =~ "utf-8$" - let s:ext = ".pl.utf-8" endif endif " The Turkish tutor is available in two encodings, guess which one to use if s:ext =~? '\.tr' - if &enc == "utf-8" - let s:ext = ".tr.utf-8" - elseif &enc == "iso-8859-9" + if &enc == "iso-8859-9" let s:ext = ".tr.iso9" endif endif @@ -99,59 +100,67 @@ endif " We used ".gr" (Greece) instead of ".el" (Greek); accept both. if s:ext =~? '\.gr\|\.el' if &enc == "iso-8859-7" - let s:ext = ".gr" + let s:ext = ".el" elseif &enc == "utf-8" - let s:ext = ".gr.utf-8" + let s:ext = ".el.utf-8" elseif &enc =~ 737 - let s:ext = ".gr.cp737" + let s:ext = ".el.cp737" endif endif " The Slovak tutor is available in three encodings, guess which one to use if s:ext =~? '\.sk' - if &enc == 'utf-8' - let s:ext = ".sk.utf-8" - elseif &enc =~ 1250 + if &enc =~ 1250 let s:ext = ".sk.cp1250" endif endif " The Czech tutor is available in three encodings, guess which one to use if s:ext =~? '\.cs' - if &enc == 'utf-8' - let s:ext = ".cs.utf-8" - elseif &enc =~ 1250 + if &enc =~ 1250 let s:ext = ".cs.cp1250" endif endif " The Russian tutor is available in three encodings, guess which one to use. if s:ext =~? '\.ru' - if &enc == 'utf-8' - let s:ext = '.ru.utf-8' - elseif &enc =~ '1251' + if &enc =~ '1251' let s:ext = '.ru.cp1251' elseif &enc =~ 'koi8' let s:ext = '.ru' endif endif -" The Hungarian tutor is available in two encodings, guess which one to use. +" The Hungarian tutor is available in three encodings, guess which one to use. if s:ext =~? '\.hu' - if &enc == 'utf-8' - let s:ext = '.hu.utf-8' + if &enc =~ 1250 + let s:ext = ".hu.cp1250" elseif &enc =~ 'iso-8859-2' let s:ext = '.hu' endif endif -" Somehow ".ge" (Germany) is sometimes used for ".de" (Deutsch). -if s:ext =~? '\.ge' - let s:ext = ".de" +" The Croatian tutor is available in three encodings, guess which one to use. +if s:ext =~? '\.hr' + if &enc =~ 1250 + let s:ext = ".hr.cp1250" + elseif &enc =~ 'iso-8859-2' + let s:ext = '.hr' + endif endif -if s:ext =~? '\.en' - let s:ext = "" +" Esperanto is only available in utf-8 +if s:ext =~? '\.eo' + let s:ext = ".eo.utf-8" +endif +" Vietnamese is only available in utf-8 +if s:ext =~? '\.vi' + let s:ext = ".vi.utf-8" +endif + +" If 'encoding' is utf-8 s:ext must end in utf-8. +if &enc == 'utf-8' && s:ext !~ '\.utf-8' + s:ext .= '.utf-8' endif " 2. Build the name of the file: |