Home Download Buy Blog Forum Support

Gettext (.po) syntax coloring?

Gettext (.po) syntax coloring?

Postby miohtama3 on Tue Jun 26, 2012 10:26 pm

Does Gettext syntax coloring exist?

The file content looks pretty much like this:

Code: Select all
# Administrative UI

#
msgid "portlet_addform_add_new"
msgstr "Lisää"

msgid "portlet_addform_add_patient"
msgstr "Potilas"

msgid "portlet_addform_add_visit"
msgstr "Käynti"

msgid "portlet_addform_add_prescription"
msgstr "Hoito"


If not... does one exist for TextMate and is it possible to convert it for Sublime?
miohtama3
 
Posts: 33
Joined: Fri Apr 27, 2012 1:46 pm

Re: Gettext (.po) syntax coloring?

Postby tito on Wed Jun 27, 2012 9:19 pm

Give APIs, let the community build the rest!
https://github.com/titoBouzout
tito
 
Posts: 855
Joined: Thu Sep 29, 2011 2:27 pm
Location: Montevideo, Uruguay

Re: Gettext (.po) syntax coloring?

Postby miohtama3 on Sun Jul 08, 2012 4:34 pm

Thanks!

Got it working, but there seems to be slight annoyance with the highlighting.

Image

Any idea what could be causing this?
miohtama3
 
Posts: 33
Joined: Fri Apr 27, 2012 1:46 pm

Re: Gettext (.po) syntax coloring?

Postby FichteFoll on Sun Jul 08, 2012 6:48 pm

Code: Select all
      <dict>
         <key>comment</key>
         <string>a line that does not begin with # or ". Could improve this regexp</string>
         <key>match</key>
         <string>^[^#"].*$</string>
         <key>name</key>
         <string>invalid.illegal.po</string>
      </dict>


Change the regexp to ^[^#"].+$ so it doesn't match empty lines.
FichteFoll
 
Posts: 406
Joined: Fri Mar 16, 2012 11:49 pm
Location: Germany

Re: Gettext (.po) syntax coloring?

Postby davemada on Mon Jul 07, 2014 6:01 pm

This worked great for me but can anyone tell me how to get a multiline msgid to still do syntax highlighting?
For example:
#: src/test.html:27
msgid ""
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
"Aenean eleifend eros eget iaculis venenatis. Duis gravida "
"libero neque, quis pulvinar augue gravida id. Etiam ac "
"orci pretium, tempus magna at, tempus arcu."
msgstr ""
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. "
"Proin ac purus orci. Quisque nec porta purus. Aenean at "
"nisl eu nibh iaculis ultrices. Curabitur tempor ornare tortor "
"et aliquam"

the comments highlight works but everything else is white.
davemada
 
Posts: 1
Joined: Mon Jul 07, 2014 5:46 pm


Return to General Discussion

Who is online

Users browsing this forum: aliteralmind, Exabot [Bot], Yahoo [Bot] and 22 guests