annotate runtime/syntax/po.vim @ 882:6b89fd4ffcc6 v7.0.008

updated for version 7.0-008
author vimboss
date Sat, 13 May 2006 11:33:27 +0000
parents fb380b964d53
children 82b5078be2dd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: po (gettext)
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
3 " Maintainer: Dwayne Bailey <dwayne@translate.org.za>
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
4 " Last Change: 2004 Nov 13
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
14 syn sync minlines=10
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
15
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
16 " Identifiers
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
17 syn match poStatementMsgidplural "^msgid_plural" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
18 syn match poPluralCaseN "[0-9]" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
19 syn match poStatementMsgstr "^msgstr\(\[[0-9]\]\)" contains=poPluralCaseN
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
20
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
21 " Simple HTML and XML highlighting
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
22 syn match poHtml "<[^<>]\+>" contains=poHtmlTranslatables
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
23 syn match poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
24 syn region poHtmlTranslatables start=+alt=\\"+ms=e-1 end=+\\"+ contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
25
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
26 " Translation blocks
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
27 syn region poMsgID matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
28 syn region poMsgSTR matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
29 syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
30 \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAccelerator,poHtmlNot,poVariable
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
31 syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
32 \ contains=poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAccelerator,poHtmlNot,poVariable
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
33
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
34 " Header and Copyright
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
35 syn match poHeaderItem "\(Project-Id-Version\|Report-Msgid-Bugs-To\|POT-Creation-Date\|PO-Revision-Date\|Last-Translator\|Language-Team\|MIME-Version\|Content-Type\|Content-Transfer-Encoding\|Plural-Forms\|X-Generator\): " contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
36 syn match poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME <EMAIL@ADDRESS>\|LANGUAGE <LL@li.org>\|text/plain; charset=CHARSET\|ENCODING\)" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
37 syn match poCopyrightUnset "SOME DESCRIPTIVE TITLE\|FIRST AUTHOR <EMAIL@ADDRESS>, YEAR\|Copyright (C) YEAR Free Software Foundation, Inc\|YEAR THE PACKAGE\'S COPYRIGHT HOLDER\|PACKAGE" contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
38
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
39 " Translation comment block including: translator comment, automatic coments, flags and locations
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
40 syn match poComment "^#.*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
41 syn keyword poFlagFuzzy fuzzy contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
42 syn match poCommentTranslator "^# .*$" contains=poCopyrightUnset
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
43 syn match poCommentAutomatic "^#\..*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
44 syn match poCommentSources "^#:.*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
45 syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
46
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
47 " Translations (also includes header fields as they appear in a translation msgstr)
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
48 syn region poCommentKDE start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
49 syn region poCommentKDEError start=+"\(\|\s\+\)_:+ms=s+1 end="\\n" end=+"\n\n+me=s-1 contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
50 syn match poPluralKDE +"_n: +ms=s+1 contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
51 syn region poPluralKDEError start=+"\(\|\s\+\)_n:+ms=s+1 end="\"\n\n"me=s-1 contained
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 syn match poSpecial contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 syn match poFormat "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 syn match poFormat "%%" contained
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
55
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
56 " msguniq and msgcat conflicts
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
57 syn region poMsguniqError matchgroup=poMsguniqErrorMarkers start="#-#-#-#-#" end='#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)\\n' contained
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
58
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
59 " Obsolete messages
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
60 syn match poObsolete "^#\~.*$"
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
61
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
62 " KDE Name= handling
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
63 syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
64
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
65 " Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
66 syn match poAccelerator contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
67
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
68 " Variables simple
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
69 syn match poVariable contained "%\d"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 if version >= 508 || !exists("did_po_syn_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 let did_po_syn_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81
347
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
82 HiLink poCommentSources PreProc
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
83 HiLink poComment Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
84 HiLink poCommentAutomatic Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
85 HiLink poCommentTranslator Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
86 HiLink poCommentFlags Special
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
87 HiLink poCopyrightUnset Todo
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
88 HiLink poFlagFuzzy Todo
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
89 HiLink poObsolete Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
90
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
91 HiLink poStatementMsgid Statement
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
92 HiLink poStatementMsgstr Statement
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
93 HiLink poStatementMsgidplural Statement
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
94 HiLink poPluralCaseN Constant
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
95
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
96 HiLink poStringID String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
97 HiLink poStringSTR String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
98 HiLink poCommentKDE Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
99 HiLink poCommentKDEError Error
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
100 HiLink poPluralKDE Comment
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
101 HiLink poPluralKDEError Error
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
102 HiLink poHeaderItem Identifier
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
103 HiLink poHeaderUndefined Todo
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
104 HiLink poKDEdesktopFile Identifier
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
105
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
106 HiLink poHtml Identifier
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
107 HiLink poHtmlNot String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
108 HiLink poHtmlTranslatables String
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
109
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
110 HiLink poFormat poSpecial
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
111 HiLink poSpecial Special
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
112 HiLink poAccelerator Special
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
113 HiLink poVariable Special
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
114
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
115 HiLink poMsguniqError Special
fb380b964d53 updated for version 7.0090
vimboss
parents: 9
diff changeset
116 HiLink poMsguniqErrorMarkers Comment
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 let b:current_syntax = "po"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 " vim:set ts=8 sts=2 sw=2 noet: