bugGNU gettext - Bugs: bug #33552, po-mode.el: Highlight formatting...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #33552: po-mode.el: Highlight formatting strings with reordered arguments (e.g. %2$d)

Submitter:  None
Submitted:  Mon 13 Jun 2011 01:14:15 PM UTC
   
 
Category:  PO mode Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Tue 05 Mar 2013 07:06:45 AM UTC, comment #1: 
Daiki Ueno <ueno>
Group administrator
Mon 13 Jun 2011 01:14:15 PM UTC, original submission:  

Currently po-mode.el highlights %s inside msgid/msgstr.

However if translation requires reordering of arguments as described in GNU gettext manual by using syntax such as "%2$d Zeichen lang ist die Zeichenkette `%1$s'", then po-mode.el no longer highlights %2$s equally as %s.

Following trivial change fixes highlighting:

--- /usr/share/emacs/site-lisp/gettext/po-mode.el~ 2010-09-19 18:14:43.000000000 +0300
+++ /usr/share/emacs/site-lisp/gettext/po-mode.el 2011-06-13 15:43:52.000000000 +0300
@@ -1057,7 +1057,7 @@
     ;;  '("msgctxt " "msgid " "msgid_plural " "msgstr " "msgstr[0] " "msgstr[1] "))
     ("^\\(\\(msg\\(ctxt\\|id\\(_plural\\)?\\|str\\(\\[[0-9]\\]\\)?\\)\\) \\)?\"\\|\"$"
      . font-lock-keyword-face)
-    ("\\\\.\\|%\\*?[-.0-9ul]*[a-zA-Z]" . font-lock-variable-name-face)
+    ("\\\\.\\|%\\([0-9]\\$\\)?\\*?[-.0-9ul]*[a-zA-Z]" . font-lock-variable-name-face)
     ("^# .*\\|^#[:,]?" . font-lock-comment-face)
     ("^#:\\(.*\\)" 1 font-lock-reference-face)
     ;; The following line does not work, and I wonder why.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone PO mode
        Assigned toNone ueno
    2013-03-05 ueno StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code