After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 548552 - Improving gettext highlighting
Improving gettext highlighting
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: Syntax files
git master
Other Linux
: Normal enhancement
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
: 333795 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-08-19 23:10 UTC by Bob Mauchin
Modified: 2018-05-26 10:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add msgctx keyword (367 bytes, patch)
2008-08-19 23:15 UTC, Bob Mauchin
committed Details | Review
Adds fuzzy highlighting (769 bytes, patch)
2008-08-19 23:17 UTC, Bob Mauchin
committed Details | Review
Trying to add untranslated highlighting (not working) (990 bytes, patch)
2008-08-19 23:28 UTC, Bob Mauchin
none Details | Review

Description Bob Mauchin 2008-08-19 23:10:33 UTC
Hi,

I would like some improvements for gettext highlighting :
 → Adding the new keyword "msgctx" for the new type comment (http://live.gnome.org/GnomeGoals/MsgctxtMigration).
 
 → Highlighting the "fuzzy" keyword and untranslated string like TODO and FIXME
Comment 1 Bob Mauchin 2008-08-19 23:15:23 UTC
Created attachment 117013 [details] [review]
Add msgctx keyword
Comment 2 Bob Mauchin 2008-08-19 23:17:28 UTC
Created attachment 117014 [details] [review]
Adds fuzzy highlighting
Comment 3 Bob Mauchin 2008-08-19 23:28:27 UTC
Created attachment 117017 [details] [review]
Trying to add untranslated highlighting (not working)

I didn't manage to get it working. I think there is a conflict with the msgstr keyword, but I don't know how to solve that.
Could someone help me with this one?

Thanks a lot.
Comment 4 Yevgen Muntyan 2008-08-19 23:50:15 UTC
Put the "empty" context before "keyword" (no idea if it all will start working nicely, but keyword context won't steal the "msgstr" string).
Comment 5 Bob Mauchin 2008-08-20 07:10:17 UTC
Thanks Yevgen. It almost works but it seems that regex can't recognize a newline :
<match>msgstr(\[\d+\])?\ ""\ *\n</match>

I've looked in other .lang files, and sql.lang contains this comment <!-- FIXME no \n in patterns! -->. Is there a workaround to detect a newline ?

Thanks.
Comment 6 Yevgen Muntyan 2008-08-20 07:53:49 UTC
Detect end of line instead: msgstr(\[\d+\])?\ ""\ *$
But it is broken, isn't it? Can't you have stuff like

msgstr ""
"actual stuff here because it's a long string or something"
Comment 7 Bob Mauchin 2008-08-20 08:11:03 UTC
Yes I must detect a newline or the EOF because of the example you've mentioned.

(And I don't even try to detect some strange syntax like :
msgstr ""
""
)

Thanks.
Comment 8 Claude Paroz 2008-08-28 21:07:40 UTC
the keyword is msgctxt, not msgctx
Comment 9 Bob Mauchin 2008-08-28 21:30:19 UTC
Thanks Claude, I will edit it ASAP. BTW, do you have any other suggestions about thoses patches ?

Regards,
Comment 10 Paolo Borelli 2008-08-30 20:25:00 UTC
I started adding the highlighting of msgctxt and fuzzy to svn so that they'll surely make into the next version.
Comment 11 Paolo Borelli 2008-08-30 20:27:51 UTC
*** Bug 333795 has been marked as a duplicate of this bug. ***
Comment 12 Sébastien Wilmet 2018-05-26 10:09:04 UTC
Some patches were merged, and some patches were work-in-progress (probably with lots of conflicts now). So it's not very useful to keep this bug open.