updated for version 7.2a
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: po (gettext)
|
||||
" Maintainer: Dwayne Bailey <dwayne@translate.org.za>
|
||||
" Last Change: 2004 Nov 13
|
||||
" Last Change: 2008 Jan 08
|
||||
" Contributors: Dwayne Bailey (Most advanced syntax highlighting)
|
||||
" Leonardo Fontenelle (Spell checking)
|
||||
" Nam SungHyun <namsh@kldp.org> (Original maintainer)
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@ -14,26 +17,30 @@ endif
|
||||
syn sync minlines=10
|
||||
|
||||
" Identifiers
|
||||
syn match poStatementMsgCTxt "^msgctxt"
|
||||
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
|
||||
syn match poHtml "<[^<>]\+>" contains=poHtmlTranslatables
|
||||
syn match poHtml "<\_[^<>]\+>" contains=poHtmlTranslatables,poLineBreak
|
||||
syn match poHtmlNot +"<[^<]\+>"+ms=s+1,me=e-1
|
||||
syn region poHtmlTranslatables start=+alt=\\"+ms=e-1 end=+\\"+ contained
|
||||
syn region poHtmlTranslatables start=+\(abbr\|alt\|content\|summary\|standby\|title\)=\\"+ms=e-1 end=+\\"+ contained contains=@Spell
|
||||
syn match poLineBreak +"\n"+ contained
|
||||
|
||||
" Translation blocks
|
||||
syn region poMsgCTxt matchgroup=poStatementMsgCTxt start=+^msgctxt "+rs=e-1 matchgroup=poStringCTxt end=+^msgid "+me=s-1 contains=poStringCTxt
|
||||
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
|
||||
syn region poStringCTxt start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region poStringID start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
|
||||
\ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAccelerator,poHtmlNot,poVariable
|
||||
\ contains=poSpecial,poFormat,poCommentKDE,poPluralKDE,poKDEdesktopFile,poHtml,poAcceleratorId,poHtmlNot,poVariable
|
||||
syn region poStringSTR start=+"+ skip=+\\\\\|\\"+ end=+"+ contained
|
||||
\ contains=poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAccelerator,poHtmlNot,poVariable
|
||||
\ contains=@Spell,poSpecial,poFormat,poHeaderItem,poCommentKDEError,poHeaderUndefined,poPluralKDEError,poMsguniqError,poKDEdesktopFile,poHtml,poAcceleratorStr,poHtmlNot,poVariable
|
||||
|
||||
" 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
|
||||
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
|
||||
syn match poHeaderUndefined "\(PACKAGE VERSION\|YEAR-MO-DA HO:MI+ZONE\|FULL NAME <EMAIL@ADDRESS>\|LANGUAGE <LL@li.org>\|CHARSET\|ENCODING\|INTEGER\|EXPRESSION\)" contained
|
||||
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
|
||||
@ -63,7 +70,8 @@ syn match poObsolete "^#\~.*$"
|
||||
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
|
||||
syn match poAccelerator contained "[^&_~][&_~]\(\a\|\d\)[^:]"ms=s+1,me=e-1
|
||||
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
|
||||
|
||||
" Variables simple
|
||||
syn match poVariable contained "%\d"
|
||||
@ -91,8 +99,10 @@ if version >= 508 || !exists("did_po_syn_inits")
|
||||
HiLink poStatementMsgid Statement
|
||||
HiLink poStatementMsgstr Statement
|
||||
HiLink poStatementMsgidplural Statement
|
||||
HiLink poStatementMsgCTxt Statement
|
||||
HiLink poPluralCaseN Constant
|
||||
|
||||
HiLink poStringCTxt Comment
|
||||
HiLink poStringID String
|
||||
HiLink poStringSTR String
|
||||
HiLink poCommentKDE Comment
|
||||
@ -106,11 +116,13 @@ if version >= 508 || !exists("did_po_syn_inits")
|
||||
HiLink poHtml Identifier
|
||||
HiLink poHtmlNot String
|
||||
HiLink poHtmlTranslatables String
|
||||
HiLink poLineBreak String
|
||||
|
||||
HiLink poFormat poSpecial
|
||||
HiLink poSpecial Special
|
||||
HiLink poAccelerator Special
|
||||
HiLink poVariable Special
|
||||
HiLink poAcceleratorId Special
|
||||
HiLink poAcceleratorStr Special
|
||||
HiLink poVariable Special
|
||||
|
||||
HiLink poMsguniqError Special
|
||||
HiLink poMsguniqErrorMarkers Comment
|
||||
|
||||
Reference in New Issue
Block a user