Germán Arias wrote:

On lun, 2011-02-14 at 21:55 +0100, Wolfgang Lux wrote:

I didn't have a look whether your definition is correct, because it is
simply pointless. The macro _(X) is defined exactly for that purpose
and it is available in -base (provided the header GNUstepBase/
GNUstep.h is included, but this should be the case for NSUndoManager).
Furthermore, make_strings will recognize this macro in contrast to
your definition, so you could automatically prepare a strings file
(though -base at present is not prepared to do that). Even without
that macro, you would be off using NSLocalizedString or
NSLocalizedStringFromTable rather than reinventing the wheel.

Wolfgang


I tried this (include GNUstepBase/GNUstep.h and use _() ) but don't
works, I get:

NSUndoManager.m: In function ‘-[NSUndoManager
redoMenuTitleForUndoActionName:]’:
NSUndoManager.m:720: warning: implicit declaration of function
‘NSLocalizedString’
NSUndoManager.m:720: warning: return makes pointer from integer without
a cast
NSUndoManager.m:725: warning: passing argument 1 of ‘stringWithFormat:’
makes pointer from integer without a cast
NSUndoManager.m: In function ‘-[NSUndoManager
undoMenuTitleForUndoActionName:]’:
NSUndoManager.m:1001: warning: return makes pointer from integer without
a cast
NSUndoManager.m:1006: warning: passing argument 1 of ‘stringWithFormat:’
makes pointer from integer without a cast

for this reason I implemented the function GSBaseLocalizedString as
suggested the FIXME note. Maybe there is a bug in NSLocalizedString?

This error should tell you that the compiler didn't find the prototype of function NSLocalizedString. Adding #import <Foundation/NSBundle.h> to NSUndoManager fixes that problem.

Wolfgang


_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to