Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Programming > Localization

    Locale file highlighter for Vim -

    Download button

    No screenshots available
    Downloads: 952  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    Good (3.6/5)
    19 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Dwayne Bailey | More programs
    GPL / FREE
    April 13th, 2005, 21:00 GMT
    ROOT / Programming / Localization

     Read user reviews (0)  Refer to a friend  Subscribe

    Locale file highlighter for Vim description

    Locale file highlighter for Vim is highlights ISO TR 14652-style locale input files.

    Glibc uses locale (or fdcc) files to define cultural conventions. The files are usualy named
    xx_ZZ where xx is the ISO language code and ZZ is the ISO country code.

    Here are some key features of "Locale file highlighter for Vim":

    · highlights only valid keys with various LC_ sections
    · Shows bad < UNNNN > unicode as an error



    Installation

    · Copy the file to your .vim/syntax directory in a locale file type: set syntax=fdcc



    Filetype detection

    Slightly harder as locale files do not have any specific suffix - but here's what to do

    Insert this after the Diff section in your scripts.vim file. It does initial patern matching and then looks within the file to determine if it is a locale file.

    The double quotes below are escaped on this site so remove those escapes. In fact it will probably mess up all back slashes aswell.

    " CVS diff
    else
    let lnum = 1
    while getline(lnum) =~ "^? " && lnum < line("$")
    let lnum = lnum + 1
    endwhile
    if getline(lnum) =~ '^Index:s+f+$'
    set ft=diff

    " locale input files: Formal Definitions of Cultural Conventions
    " filename must be like en_US, fr_FR@euro or en_US.UTF-8
    "elseif expand("%") =~ '(ll_uu($|[.@])|i18n|POSIX|translit_*)'
    elseif expand("%") =~ 'aa_aa($|[.@])|i18n$|POSIX$|translit_'
    let lnum = 1
    while lnum < 100 && lnum < line("$")
    if getline(lnum) =~ '^LC_(IDENTIFICATION|CTYPE|COLLATE|MONETARY|NUMERIC|TIME|MESSAGES|PAPER|TELEPHONE|MEASUREMENT|NAME|ADDRESS)$'
    setf fdcc
    break
    endif
    let lnum = lnum + 1
    endwhile
    endif

    endif

    unlet s:line2 s:line3 s:line4 s:line5

    endif

    Product's homepage

      


    TAGS:

    ISO highlightes | locale file highlighter | Vim script | ISO | highlightes | Vim

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM