| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | " Vim syntax file | 
					
						
							|  |  |  | " Language:	po (gettext) | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | " Maintainer:	Dwayne Bailey <dwayne@translate.org.za> | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | " Last Change:	2008 Sep 17 | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | " Contributors: Dwayne Bailey (Most advanced syntax highlighting) | 
					
						
							|  |  |  | "               Leonardo Fontenelle (Spell checking) | 
					
						
							| 
									
										
										
										
											2010-01-06 20:54:52 +01:00
										 |  |  | "               SungHyun Nam <goweol@gmail.com> (Original maintainer) | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " For version 5.x: Clear all syntax items | 
					
						
							|  |  |  | " For version 6.x: Quit when a syntax file was already loaded | 
					
						
							|  |  |  | if version < 600 | 
					
						
							|  |  |  |   syntax clear | 
					
						
							|  |  |  | elseif exists("b:current_syntax") | 
					
						
							|  |  |  |   finish | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | syn sync minlines=10 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Identifiers | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn match  poStatementMsgCTxt "^msgctxt" | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | syn match  poStatementMsgidplural "^msgid_plural" contained | 
					
						
							|  |  |  | syn match  poPluralCaseN "[0-9]" contained | 
					
						
							|  |  |  | syn match  poStatementMsgstr "^msgstr\(\[[0-9]\]\)" contains=poPluralCaseN | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Simple HTML and XML highlighting | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn match  poHtml "<\_[^<>]\+>" contains=poHtmlTranslatables,poLineBreak | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | syn match  poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1 | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn region poHtmlTranslatables start=+\(abbr\|alt\|content\|summary\|standby\|title\)=\\"+ms=e-1 end=+\\"+ contained contains=@Spell | 
					
						
							|  |  |  | syn match poLineBreak +"\n"+ contained | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Translation blocks | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn region     poMsgCTxt	matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 matchgroup=poStringCTxt end=+^msgid "+me=s-1 contains=poStringCTxt | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | syn region     poMsgID	matchgroup=poStatementMsgid start=+^msgid "+rs=e-1 matchgroup=poStringID end=+^msgstr\(\|\[[\]0\[]\]\) "+me=s-1 contains=poStringID,poStatementMsgidplural,poStatementMsgid | 
					
						
							|  |  |  | syn region     poMsgSTR	matchgroup=poStatementMsgstr start=+^msgstr\(\|\[[\]0\[]\]\) "+rs=e-1 matchgroup=poStringSTR end=+\n\n+me=s-1 contains=poStringSTR,poStatementMsgstr | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn region poStringCTxt	start=+"+ skip=+\\\\\|\\"+ end=+"+ | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | syn region poStringID	start=+"+ skip=+\\\\\|\\"+ end=+"+ contained  | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  |                             \ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | syn region poStringSTR	start=+"+ skip=+\\\\\|\\"+ end=+"+ contained  | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  |                             \ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Header and Copyright | 
					
						
							|  |  |  | 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 | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn match     poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME <EMAIL@ADDRESS>\|LANGUAGE <LL@li.org>\|CHARSET\|ENCODING\|INTEGER\|EXPRESSION\)" contained | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 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 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Translation comment block including: translator comment, automatic coments, flags and locations | 
					
						
							|  |  |  | syn match     poComment "^#.*$" | 
					
						
							|  |  |  | syn keyword   poFlagFuzzy fuzzy contained | 
					
						
							|  |  |  | syn match     poCommentTranslator "^# .*$" contains=poCopyrightUnset | 
					
						
							|  |  |  | syn match     poCommentAutomatic "^#\..*$"  | 
					
						
							|  |  |  | syn match     poCommentSources	"^#:.*$" | 
					
						
							|  |  |  | syn match     poCommentFlags "^#,.*$" contains=poFlagFuzzy | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Translations (also includes header fields as they appear in a translation msgstr) | 
					
						
							|  |  |  | syn region poCommentKDE	  start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained | 
					
						
							|  |  |  | syn region poCommentKDEError  start=+"\(\|\s\+\)_:+ms=s+1 end="\\n" end=+"\n\n+me=s-1 contained | 
					
						
							|  |  |  | syn match  poPluralKDE   +"_n: +ms=s+1 contained | 
					
						
							|  |  |  | syn region poPluralKDEError   start=+"\(\|\s\+\)_n:+ms=s+1 end="\"\n\n"me=s-1 contained | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | syn match  poSpecial	contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)" | 
					
						
							|  |  |  | syn match  poFormat	"%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlL]\|ll\)\=\([diuoxXfeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained | 
					
						
							|  |  |  | syn match  poFormat	"%%" contained | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " msguniq and msgcat conflicts | 
					
						
							|  |  |  | syn region poMsguniqError matchgroup=poMsguniqErrorMarkers  start="#-#-#-#-#"  end='#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)-\("\n"\|\)#\("\n"\|\)\\n' contained | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Obsolete messages | 
					
						
							|  |  |  | syn match poObsolete "^#\~.*$"  | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " KDE Name= handling | 
					
						
							|  |  |  | syn match poKDEdesktopFile "\"\(Name\|Comment\|GenericName\|Description\|Keywords\|About\)="ms=s+1,me=e-1 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " Accelerator keys - this messes up if the preceding or following char is a multibyte unicode char | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  | syn match poAcceleratorId  contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1  | 
					
						
							|  |  |  | syn match poAcceleratorStr  contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1 contains=@Spell | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Variables simple | 
					
						
							|  |  |  | syn match poVariable contained "%\d" | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | " Define the default highlighting. | 
					
						
							|  |  |  | " For version 5.7 and earlier: only when not done already | 
					
						
							|  |  |  | " For version 5.8 and later: only when an item doesn't have highlighting yet | 
					
						
							|  |  |  | if version >= 508 || !exists("did_po_syn_inits") | 
					
						
							|  |  |  |   if version < 508 | 
					
						
							|  |  |  |     let did_po_syn_inits = 1 | 
					
						
							|  |  |  |     command -nargs=+ HiLink hi link <args> | 
					
						
							|  |  |  |   else | 
					
						
							|  |  |  |     command -nargs=+ HiLink hi def link <args> | 
					
						
							|  |  |  |   endif | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  |   HiLink poCommentSources    PreProc | 
					
						
							|  |  |  |   HiLink poComment	     Comment | 
					
						
							|  |  |  |   HiLink poCommentAutomatic  Comment | 
					
						
							|  |  |  |   HiLink poCommentTranslator Comment | 
					
						
							|  |  |  |   HiLink poCommentFlags      Special | 
					
						
							|  |  |  |   HiLink poCopyrightUnset    Todo | 
					
						
							|  |  |  |   HiLink poFlagFuzzy         Todo | 
					
						
							|  |  |  |   HiLink poObsolete         Comment | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   HiLink poStatementMsgid   Statement | 
					
						
							|  |  |  |   HiLink poStatementMsgstr  Statement | 
					
						
							|  |  |  |   HiLink poStatementMsgidplural  Statement | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  |   HiLink poStatementMsgCTxt Statement | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  |   HiLink poPluralCaseN      Constant | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  |   HiLink poStringCTxt	    Comment | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  |   HiLink poStringID	    String | 
					
						
							|  |  |  |   HiLink poStringSTR	    String | 
					
						
							|  |  |  |   HiLink poCommentKDE       Comment | 
					
						
							|  |  |  |   HiLink poCommentKDEError  Error | 
					
						
							|  |  |  |   HiLink poPluralKDE        Comment | 
					
						
							|  |  |  |   HiLink poPluralKDEError   Error | 
					
						
							|  |  |  |   HiLink poHeaderItem       Identifier | 
					
						
							|  |  |  |   HiLink poHeaderUndefined  Todo | 
					
						
							|  |  |  |   HiLink poKDEdesktopFile   Identifier | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   HiLink poHtml              Identifier | 
					
						
							|  |  |  |   HiLink poHtmlNot           String | 
					
						
							|  |  |  |   HiLink poHtmlTranslatables String | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  |   HiLink poLineBreak         String | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   HiLink poFormat	    poSpecial | 
					
						
							|  |  |  |   HiLink poSpecial	    Special | 
					
						
							| 
									
										
										
										
											2008-06-24 21:56:24 +00:00
										 |  |  |   HiLink poAcceleratorId    Special | 
					
						
							|  |  |  |   HiLink poAcceleratorStr   Special | 
					
						
							|  |  |  |   HiLink poVariable         Special | 
					
						
							| 
									
										
										
										
											2005-06-22 22:29:18 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   HiLink poMsguniqError        Special | 
					
						
							|  |  |  |   HiLink poMsguniqErrorMarkers Comment | 
					
						
							| 
									
										
										
										
											2004-06-13 20:20:40 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   delcommand HiLink | 
					
						
							|  |  |  | endif | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | let b:current_syntax = "po" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | " vim:set ts=8 sts=2 sw=2 noet: |