Mercurial > vim
diff src/po/check.vim @ 14187:b79453d0d01c v8.1.0111
patch 8.1.0111: .po files do not use recommended names
commit https://github.com/vim/vim/commit/d1d037e90192ab64e4cec00b9d008b33bc69d979
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jun 24 18:04:50 2018 +0200
patch 8.1.0111: .po files do not use recommended names
Problem: .po files do not use recommended names.
Solution: Give a warning if the recommended name is not used. Accept the
recommended name for conversion. (Christian Brabandt, Ken Takata)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 24 Jun 2018 18:15:05 +0200 |
parents | b9db0bc9b8f9 |
children | 57927799c27e |
line wrap: on
line diff
--- a/src/po/check.vim +++ b/src/po/check.vim @@ -173,12 +173,37 @@ elseif !plural && search('^"Plural-Forms " We allow for a stray plural header, msginit adds one. endif +" Check that 8bit encoding is used instead of 8-bit +let cte = search('^"Content-Transfer-Encoding:\s\+8-bit', 'n') +let ctc = search('^"Content-Type:.*;\s\+\<charset=[iI][sS][oO]_', 'n') +let ctu = search('^"Content-Type:.*;\s\+\<charset=utf-8', 'n') +if cte + echomsg "Content-Transfer-Encoding should be 8bit instead of 8-bit" + " TODO: make this an error + " if error == 0 + " let error = cte + " endif +elseif ctc + echomsg "Content-Type charset should be 'ISO-...' instead of 'ISO_...'" + " TODO: make this an error + " if error == 0 + " let error = ct + " endif +elseif ctu + echomsg "Content-Type charset should be 'UTF-8' instead of 'utf-8'" + " TODO: make this an error + " if error == 0 + " let error = ct + " endif +endif + if error == 0 " If all was OK restore the view. call winrestview(wsv) echomsg "OK" else + " Put the cursor on the line with the error. exe error endif