use the _() macro for localisation within base

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@32173 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2011-02-15 06:25:54 +00:00
parent e141e8aada
commit 21e22ecfb0
17 changed files with 45 additions and 60 deletions

View file

@ -27,39 +27,12 @@
#import "common.h"
#define EXPOSE_NSUndoManager_IVARS 1
#import "Foundation/NSArray.h"
#import "Foundation/NSBundle.h"
#import "Foundation/NSNotification.h"
#import "Foundation/NSInvocation.h"
#import "Foundation/NSException.h"
#import "Foundation/NSRunLoop.h"
#import "Foundation/NSUndoManager.h"
/*
* Localize a message of the gnustep-base library.
*/
static inline NSString *GSBaseLocalizedString (NSString *key)
{
static NSBundle *baseBundle = nil;
if (!baseBundle)
{
/* Create the base bundle we use to localize messages. */
baseBundle = [NSBundle bundleForLibrary: @"gnustep-base"
version: OBJC_STRINGIFY(GNUSTEP_BASE_MAJOR_VERSION.GNUSTEP_BASE_MINOR_VERSION)];
RETAIN(baseBundle);
}
if (baseBundle != nil)
{
return [baseBundle localizedStringForKey: key value: @"" table: nil];
}
else
{
return key;
}
}
/*
* Private class for grouping undo/redo actions.
*/
@ -715,12 +688,11 @@ static inline NSString *GSBaseLocalizedString (NSString *key)
{
if ([actionName isEqual: @""])
{
return GSBaseLocalizedString(@"Redo");
return _(@"Redo");
}
else
{
return [NSString stringWithFormat:
GSBaseLocalizedString(@"Redo %@"), actionName];
return [NSString stringWithFormat: @"%@ %@", _(@"Redo"), actionName];
}
}
return actionName;
@ -996,12 +968,11 @@ static inline NSString *GSBaseLocalizedString (NSString *key)
{
if ([actionName isEqual: @""])
{
return GSBaseLocalizedString(@"Undo");
return _(@"Undo");
}
else
{
return [NSString stringWithFormat:
GSBaseLocalizedString(@"Undo %@"), actionName];
return [NSString stringWithFormat: @"%@ %@", _(@"Undo"), actionName];
}
}
return actionName;