[geany/geany-plugins] adc625: pohelper: Fix message fuzziness toggling on plural forms
Colomban Wendling
git-noreply at xxxxx
Sat May 11 21:55:18 UTC 2013
Branch: refs/heads/master
Author: Colomban Wendling <ban at herbesfolles.org>
Committer: Colomban Wendling <ban at herbesfolles.org>
Date: Sat, 11 May 2013 21:55:18 UTC
Commit: adc625e18826dd401ab5cc3bc094f2b72957fcf5
https://github.com/geany/geany-plugins/commit/adc625e18826dd401ab5cc3bc094f2b72957fcf5
Log Message:
-----------
pohelper: Fix message fuzziness toggling on plural forms
Modified Paths:
--------------
pohelper/src/gph-plugin.c
Modified: pohelper/src/gph-plugin.c
17 files changed, 17 insertions(+), 0 deletions(-)
===================================================================
@@ -800,6 +800,22 @@ enum {
return style;
}
+/* checks whether @line is a primary msgid line, e.g. not a plural form */
+static gboolean
+line_is_primary_msgid (ScintillaObject *sci,
+ gint line)
+{
+ gint pos = (gint) scintilla_send_message (sci, SCI_GETLINEINDENTPOSITION,
+ (uptr_t) line, 0);
+
+ return (sci_get_char_at (sci, pos++) == 'm' &&
+ sci_get_char_at (sci, pos++) == 's' &&
+ sci_get_char_at (sci, pos++) == 'g' &&
+ sci_get_char_at (sci, pos++) == 'i' &&
+ sci_get_char_at (sci, pos++) == 'd' &&
+ g_ascii_isspace (sci_get_char_at (sci, pos)));
+}
+
/* parse flags line @line and puts the read flags in @flags
* a flags line looks like:
* #, flag-1, flag-2, flag-2, ... */
@@ -908,6 +924,7 @@ enum {
/* find the msgid for the current line */
while (line > 0 &&
(style == SCE_PO_DEFAULT ||
+ (style == SCE_PO_MSGID && ! line_is_primary_msgid (sci, line)) ||
style == SCE_PO_MSGID_TEXT ||
style == SCE_PO_MSGSTR ||
style == SCE_PO_MSGSTR_TEXT)) {
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list