discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Question about gorm and Multi language support in Gnustep


From: Chris B. Vetter
Subject: Re: Question about gorm and Multi language support in Gnustep
Date: Thu, 29 May 2003 09:15:02 -0700

On Thu, 29 May 2003 16:01:18 +0200
Stéphane PERON <address@hidden> wrote:
> Hi all !
> I have try a work of french translation.
> Many apps are made with gorm and I don't know to make the translation.
> Do I have to make a new .gorm for each language ?
> (that means that the maintener has to update as many .gorm file as
> there are languages supported  .. so if 8 languages are supported, he
> has to spend 8 more times to release its application !!! )
> Please, tell me I am wrong ... ;-)

I guess it depends on how the application is written and the "main"
.gorm file is created.

But, no, there really is no need to create one .gorm per language.

The way I do it is to _not_ use any real text in a .gorm file, instead I
use -awakeFromNib to set the actual description for eg. buttons:

  #define THIS_BUNDLE     \
        [NSBundle bundleForClass: [Foobar class]]

  #define Localize(key, args...)                          \
          [NSString stringWithFormat:                     \
            [THIS_BUNDLE localizedStringForKey: (key)     \
                                         value: @""       \
                                         table: nil], args]

  - (void) awakeFromNib
  {
    [...]

    [applyButton setTitle: Localize(@"Apply", nil)];
    [closeButton setTitle: Localize(@"OK", nil)];

    [...]
  }

All that's left is to create a <language>.lproj/Localizable.strings
and add the language to your makefile.

And yes, it works with multiple languages ;-)

-- 
Chris




reply via email to

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