[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GSBaseLocalizedString()
From: |
Richard Frith-Macdonald |
Subject: |
Re: GSBaseLocalizedString() |
Date: |
Wed, 16 Feb 2011 06:27:05 +0000 |
On 15 Feb 2011, at 09:29, David Chisnall wrote:
> 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.
Great idea ... I added it.