aboutsummaryrefslogtreecommitdiff
path: root/src/po/check.vim
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2014-05-12 02:25:17 +0200
committerEliseo Martínez <eliseomarmol@gmail.com>2014-05-15 20:46:01 +0200
commitda51dc9cf202772f60bd2da975dbef257bd9237c (patch)
tree5c16b93238a153f55634e9323077f30c8133970c /src/po/check.vim
parentffe61e5ba1721340ca51d56bae3ddaca415fb5bc (diff)
downloadrneovim-da51dc9cf202772f60bd2da975dbef257bd9237c.tar.gz
rneovim-da51dc9cf202772f60bd2da975dbef257bd9237c.tar.bz2
rneovim-da51dc9cf202772f60bd2da975dbef257bd9237c.zip
Introduce nvim namespace: Move files.
Move files from src/ to src/nvim/. - src/nvim/ becomes the new root dir for nvim executable sources. - src/libnvim/ is planned to become root dir of the neovim library.
Diffstat (limited to 'src/po/check.vim')
-rw-r--r--src/po/check.vim88
1 files changed, 0 insertions, 88 deletions
diff --git a/src/po/check.vim b/src/po/check.vim
deleted file mode 100644
index 5a3a0e3f46..0000000000
--- a/src/po/check.vim
+++ /dev/null
@@ -1,88 +0,0 @@
-" Vim script for checking .po files.
-"
-" Go through the file and verify that:
-" - All %...s items in "msgid" are identical to the ones in "msgstr".
-" - An error or warning code in "msgid" matches the one in "msgstr".
-
-if 1 " Only execute this if the eval feature is available.
-
-" Function to get a split line at the cursor.
-" Used for both msgid and msgstr lines.
-" Removes all text except % items and returns the result.
-func! GetMline()
- let idline = substitute(getline('.'), '"\(.*\)"$', '\1', '')
- while line('.') < line('$')
- +
- let line = getline('.')
- if line[0] != '"'
- break
- endif
- let idline .= substitute(line, '"\(.*\)"$', '\1', '')
- endwhile
-
- " remove '%', not used for formatting.
- let idline = substitute(idline, "'%'", '', 'g')
-
- " remove '%' used for plural forms.
- let idline = substitute(idline, '\\nPlural-Forms: .\+;\\n', '', '')
-
- " remove everything but % items.
- return substitute(idline, '[^%]*\(%[-+ #''.0-9*]*l\=[dsuxXpoc%]\)\=', '\1', 'g')
-endfunc
-
-" This only works when 'wrapscan' is set.
-let s:save_wrapscan = &wrapscan
-set wrapscan
-
-" Start at the first "msgid" line.
-1
-/^msgid
-let startline = line('.')
-let error = 0
-
-while 1
- if getline(line('.') - 1) !~ "no-c-format"
- let fromline = GetMline()
- if getline('.') !~ '^msgstr'
- echo 'Missing "msgstr" in line ' . line('.')
- let error = 1
- endif
- let toline = GetMline()
- if fromline != toline
- echo 'Mismatching % in line ' . (line('.') - 1)
- echo 'msgid: ' . fromline
- echo 'msgstr: ' . toline
- let error = 1
- endif
- endif
-
- " Find next msgid.
- " Wrap around at the end of the file, quit when back at the first one.
- /^msgid
- if line('.') == startline
- break
- endif
-endwhile
-
-" Check that error code in msgid matches the one in msgstr.
-"
-" Examples of mismatches found with msgid "E123: ..."
-" - msgstr "E321: ..." error code mismatch
-" - msgstr "W123: ..." warning instead of error
-" - msgstr "E123 ..." missing colon
-" - msgstr "..." missing error code
-"
-1
-if search('msgid "\("\n"\)\?\([EW][0-9]\+:\).*\nmsgstr "\("\n"\)\?[^"]\@=\2\@!') > 0
- echo 'Mismatching error/warning code in line ' . line('.')
- let error = 1
-endif
-
-if error == 0
- echo "OK"
-endif
-
-let &wrapscan = s:save_wrapscan
-unlet s:save_wrapscan
-
-endif