This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc/cp/pt.c: use ngettext() when needed


On 02/24/2010 02:47 PM, Paolo Bonzini wrote:

Marco, xgettext can't accept the --flag argument that have more than one
argnums. It will have the argnums like 2,3 if the above code added.

Not true:


     If KEYWORDSPEC is
     of the form `ID:ARGNUM1,ARGNUM2', `xgettext' looks for strings in
     the ARGNUM1st argument and in the ARGNUM2nd argument of the call,
     and treats them as singular/plural variants for a message with
     plural handling.

Yes, --keyword is assigned KEYWORDSPEC, but
'--flag=word:arg:flagâ
Specifies additional flags for strings occurring as part of the argth argument of the function word.
I think the --keyword=error_n:3,4 should the following flag
--flag=error_n:3:gcc-internal-format
--flag=error_n:4:gcc-internal-format
but not --flag=error_n:3,4:gcc-internal-format


So the change for exgettext would be
Index: po/exgettext
===================================================================
--- po/exgettext        ïäèç 157027ï
+++ po/exgettext        ïåäæèï
@@ -113,9 +113,14 @@ function keyword_option(line) {
        format="c-format"

     if (n == 1) { keyword = "--keyword=" name }
-    else { keyword = "--keyword=" name ":" n }
+    else {
+       keyword = "--keyword=" name ":" n
+       if (name ~ /_n$/)
+         keyword = keyword "," (n + 1)}
     if (format) {
         keyword=keyword "\n--flag=" name ":" n ":" format
+       if (name ~ /_n$/)
+         keyword = keyword "\n--flag=" name ":" (n + 1) ":" format
     }

if (! keyword_seen[name]) {


Pearly



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]