Sublime Forum

Gettext (.po) syntax coloring?

#1

Does Gettext syntax coloring exist?

The file content looks pretty much like this:

# 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?

0 Likes

#2

svn.textmate.org/trunk/Bundles/G … tmLanguage

save it to the package folder.

0 Likes

#3

Thanks!

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

Any idea what could be causing this?

0 Likes

#4

<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.

0 Likes

#5

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.

0 Likes

#6

Here`s modified version of the code that tito linked.
http://pastebin.com/Pjp8fd9i

0 Likes