+2010-05-08 Bruno Haible <bruno@clisp.org>
+
+ po-mode: Fix po-msgid-to-msgstr on plural entries.
+ * po-mode.el (po-get-msgid_plural): New function.
+ (po-msgid-to-msgstr): Use it.
+
2010-05-08 Noritada Kobayashi <nori1@dolphin.c.u-tokyo.ac.jp>
Bruno Haible <bruno@clisp.org>
(if (or (eq po-entry-type 'untranslated)
(eq po-entry-type 'obsolete)
(y-or-n-p (_"Really lose previous translation? ")))
- (po-set-msgstr-form (po-get-msgid)))
+ ;; In an entry with plural forms, use the msgid_plural string,
+ ;; as it is more general than the msgid string.
+ (po-set-msgstr-form (or (po-get-msgid_plural) (po-get-msgid))))
(message ""))
;; Obsolete entries.
po-start-of-msgstr-block))))
string))
+(defun po-get-msgid_plural ()
+ "Extract and return the unquoted msgid_plural string.
+Return nil if it is not present."
+ (if po-start-of-msgid_plural
+ (let ((string (po-extract-unquoted (current-buffer)
+ po-start-of-msgid_plural
+ po-start-of-msgstr-block)))
+ string)
+ nil))
+
(defun po-get-msgstr-flavor ()
"Helper function to detect msgstr and msgstr[] variants.
Returns one of \"msgstr\" or \"msgstr[i]\" for some i."