discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnustep] Localization


From: Jonathan Gapen
Subject: Re: [Discuss-gnustep] Localization
Date: Thu, 21 Sep 2000 11:29:55 -0500 (CDT)

On Thu, 21 Sep 2000, Nicola Pero wrote:
> > You then use NSBundles localizedStringForKey:value:table: method to fetch 
> > the
> > appropriate localized version for each string you want to localize.
> 
> I don't know much about this - but - are there any plans for some simpler
> GNUstep extension/front-end to this ?

    There's already an easy way to do it in OpenStep; use the macro
NSLocalizedString().  This macro takes two string arguments, first the
string as used by the application (e.g. "Quit"), and second a description
of it (e.g. "main menu quit item").  The macro simply returns the first
argument if it can't load a localized version of the string, so it's easy
to add localization support to an app by simply replacing all occurances
of a constant string with this macro instead.
    I had the idea a while back of creating a command-line tool that would
scan your sources for occurances of this macro, and then create a template
Localizable.strings file to hand off to your translators.  Of course,
Apple beat me too it, as I noticed in their release notes that they have
added just such a tool to MacOS X.

-- 
/Ralph Nader can win the Presidency, if we vote for him!  www.votenader.org\
\On Election Day, don't pick the Evil of two Lessers.    www.nader2000.org /



reply via email to

[Prev in Thread] Current Thread [Next in Thread]