[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GSBaseLocalizedString()
From: |
David Chisnall |
Subject: |
Re: GSBaseLocalizedString() |
Date: |
Tue, 15 Feb 2011 09:29:18 +0000 |
On 15 Feb 2011, at 06:29, Richard Frith-Macdonald wrote:
> That's because, while Wolfgang is right in principle, there was the problem
> that the _() macro uses the main bundle to lookup strings.
> I changed the code so that, within the base library, the macro is redefined
> to use the base library bundle rather than the main bundle
> (the redefinition is done in Source/common.h).
> The changes are now in svn ... please let me know if that works OK.
It would be nice if we could generalise this a bit, and define it as:
#ifndef BUNDLE_ID
# define _(key, comment) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
#else
# define _(key, comment) \
[[NSBundle bundleWithIdentifier: BUNDLE_ID] localizedStringForKey:(key)
value:@"" table:nil]
#endif
And have -make add -DBUNDLE_ID=${FRAMEWORK_NAME} (or BUNDLE_NAME) for framework
/ bundle targets, so that the _() macro would Just Work™ when building an app,
a bundle, or a framework.
David
-- Sent from my PDP-11