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: RFA [PR objc/29200][diagnostic] Make diagnostics translation friendly


Thank you Philipp,

after building the required version of gettext, translating and moving
the builddir/po/de.pox info gcc/po/de.po and installing the messages
were successfully translated.

I'm rerunning the regression tests on i686-pc-linux-gnu.

Here is the updated patch, which include intl.h and renames the message
parameter to msgid for gettext (thanks again Andreas).

OK for the trunk for the i18n POV?

Cheers,
David

2009-00-00  David Ayers  <ayers@fsfe.org>

	PR objc/29200
	* objc/objc-act.c (check_duplicates): Make warning translation
	friendly.
	(warn_with_method): Translate the message.  Rename parameter
	to msgid for xgetext.

Index: gcc/objc/objc-act.c
===================================================================
--- gcc/objc/objc-act.c	(Revision 145477)
+++ gcc/objc/objc-act.c	(Arbeitskopie)
@@ -47,6 +47,7 @@
 #include "rtl.h"
 #include "tm_p.h"
 #include "expr.h"
+#include "intl.h"
 
 #ifdef OBJCPLUS
 #include "cp-tree.h"
@@ -6103,16 +6104,29 @@
 	    }
 
 	issue_warning:
-	  warning (0, "multiple %s named %<%c%s%> found",
-		   methods ? "methods" : "selectors",
-		   (is_class ? '+' : '-'),
-		   IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
+	  if (methods)
+	    {
+	      warning (0, "multiple methods named %<%c%s%> found",
+		       (is_class ? '+' : '-'),
+		       IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
+	      warn_with_method ("using",
+				((TREE_CODE (meth) == INSTANCE_METHOD_DECL)
+				 ? '-'
+				 : '+'),
+				meth);
+	    }
+	  else
+	    {
+	      warning (0, "multiple selectors named %<%c%s%> found",
+		       (is_class ? '+' : '-'),
+		       IDENTIFIER_POINTER (METHOD_SEL_NAME (meth)));
+	      warn_with_method ("found",
+				((TREE_CODE (meth) == INSTANCE_METHOD_DECL)
+				 ? '-'
+				 : '+'),
+				meth);
+	    }
 
-	  warn_with_method (methods ? "using" : "found",
-			    ((TREE_CODE (meth) == INSTANCE_METHOD_DECL)
-			     ? '-'
-			     : '+'),
-			    meth);
 	  for (loop = hsh->list; loop; loop = loop->next)
 	    warn_with_method ("also found",
 			      ((TREE_CODE (loop->value) == INSTANCE_METHOD_DECL)
@@ -8428,11 +8442,11 @@
 }
 
 static void
-warn_with_method (const char *message, int mtype, tree method)
+warn_with_method (const char *msgid, int mtype, tree method)
 {
   /* Add a readable method name to the warning.  */
   warning (0, "%J%s %<%c%s%>", method,
-           message, mtype, gen_method_decl (method));
+           _(msgid), mtype, gen_method_decl (method));
 }
 
 /* Return 1 if TYPE1 is equivalent to TYPE2

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