Mercurial > vim
annotate src/po/cleanup.vim @ 31420:dcd73efec7de v9.0.1043
patch 9.0.1043: macro has confusing name and is duplicated
Commit: https://github.com/vim/vim/commit/c51a376265708e49a46832816077b6dd27d12c0c
Author: zeertzjq <zeertzjq@outlook.com>
Date: Sat Dec 10 10:22:29 2022 +0000
patch 9.0.1043: macro has confusing name and is duplicated
Problem: Macro has confusing name and is duplicated.
Solution: Use one macro with an understandable name. (closes https://github.com/vim/vim/issues/11686)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 10 Dec 2022 11:30:04 +0100 |
parents | 1e9e9d89f0ee |
children | 0c60c61e8fed |
rev | line source |
---|---|
449 | 1 " Vim script to cleanup a .po file: |
2 " - Remove line numbers (avoids that diffs are messy). | |
3 " - Comment-out fuzzy and empty messages. | |
4 " - Make sure there is a space before the string (required for Solaris). | |
439 | 5 " Requires Vim 6.0 or later (because of multi-line search patterns). |
658 | 6 |
7 " Disable diff mode, because it makes this very slow | |
8 let s:was_diff = &diff | |
9 setl nodiff | |
10 | |
11686
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
11 " untranslated message preceded by c-format or comment |
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
12 silent g/^#, c-format\n#/.d |
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
13 silent g/^#\..*\n#/.d |
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
14 |
29087 | 15 " c-format comments have no effect, the check.vim scripts checks it. |
29104 | 16 " But they might still be useful? |
17 " silent g/^#, c-format$/d | |
29087 | 18 |
11686
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
19 silent g/^#[:~] /d |
557 | 20 silent g/^#, fuzzy\(, .*\)\=\nmsgid ""\@!/.+1,/^$/-1s/^/#\~ / |
21 silent g/^msgstr"/s//msgstr "/ | |
22 silent g/^msgid"/s//msgid "/ | |
23 silent g/^msgstr ""\(\n"\)\@!/?^msgid?,.s/^/#\~ / | |
658 | 24 |
29193 | 25 " Comments only useful for the translator |
26 silent g/^#\. /d | |
27 | |
27772
5d26e9a7f8f2
patch 8.2.4412: translation cleanup script does not remove empty lines at end
Bram Moolenaar <Bram@vim.org>
parents:
11686
diff
changeset
|
28 " clean up empty lines |
11686
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
29 silent g/^\n\n\n/.d |
27772
5d26e9a7f8f2
patch 8.2.4412: translation cleanup script does not remove empty lines at end
Bram Moolenaar <Bram@vim.org>
parents:
11686
diff
changeset
|
30 silent! %s/\n\+\%$// |
11686
325a1dbf662d
patch 8.0.0726: translations cleanup script is too conservative
Christian Brabandt <cb@256bit.org>
parents:
658
diff
changeset
|
31 |
658 | 32 if s:was_diff |
33 setl diff | |
34 endif |