Mercurial > vim
comparison runtime/menu.vim @ 3879:447c688b82eb v7.3.696
updated for version 7.3.696
Problem: Message about added spell language can be wrong.
Solution: Give correct message. Add g:menutrans_set_lang_to to allow for
translation. (Jiri Sedlak)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Sun, 21 Oct 2012 01:21:59 +0200 |
parents | 12f838be9c59 |
children | c3036f1dca68 |
comparison
equal
deleted
inserted
replaced
3878:d8e5c76c108f | 3879:447c688b82eb |
---|---|
432 let enc = "latin1" | 432 let enc = "latin1" |
433 else | 433 else |
434 let enc = &enc | 434 let enc = &enc |
435 endif | 435 endif |
436 | 436 |
437 if !exists("g:menutrans_set_lang_to") | |
438 let g:menutrans_set_lang_to = 'Set language to' | |
439 endif | |
440 | |
437 let found = 0 | 441 let found = 0 |
438 let s = globpath(&rtp, "spell/*." . enc . ".spl") | 442 let s = globpath(&rtp, "spell/*." . enc . ".spl") |
439 if s != "" | 443 if s != "" |
440 let n = 300 | 444 let n = 300 |
441 for f in split(s, "\n") | 445 for f in split(s, "\n") |
442 let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") | 446 let nm = substitute(f, '.*spell[/\\]\(..\)\.[^/\\]*\.spl', '\1', "") |
443 if nm != "en" && nm !~ '/' | 447 if nm != "en" && nm !~ '/' |
448 let _nm = nm | |
444 let found += 1 | 449 let found += 1 |
445 let menuname = '&Tools.&Spelling.Set\ language\ to\ "' . nm . '"' | 450 let menuname = '&Tools.&Spelling.' . escape(g:menutrans_set_lang_to, "\\. \t|") . '\ "' . nm . '"' |
446 exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>' | 451 exe 'an 40.335.' . n . ' ' . menuname . ' :set spl=' . nm . ' spell<CR>' |
447 let s:undo_spellang += ['aun ' . menuname] | 452 let s:undo_spellang += ['aun ' . menuname] |
448 endif | 453 endif |
449 let n += 10 | 454 let n += 10 |
450 endfor | 455 endfor |
451 endif | 456 endif |
452 if found == 0 | 457 if found == 0 |
453 echomsg "Could not find other spell files" | 458 echomsg "Could not find other spell files" |
454 elseif found == 1 | 459 elseif found == 1 |
455 echomsg "Found spell file " . nm | 460 echomsg "Found spell file " . _nm |
456 else | 461 else |
457 echomsg "Found " . found . " more spell files" | 462 echomsg "Found " . found . " more spell files" |
458 endif | 463 endif |
459 " Need to redo this when 'encoding' is changed. | 464 " Need to redo this when 'encoding' is changed. |
460 augroup spellmenu | 465 augroup spellmenu |