[Top][All Lists]

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

Re: Question about gorm and Multi language support in Gnustep

From: Nicola Pero
Subject: Re: Question about gorm and Multi language support in Gnustep
Date: Fri, 30 May 2003 02:01:47 +0100 (BST)

> 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 ;-)

Ok ... yes, but it's not a particularly satisfactory solution - you're not
resizing the textfield to fit the new string.

If the translated string is longer than the original one, it won't fit in
the original textfield space and be clipped (that is, part of it
disappears).  Button text being clipped is not exactly user friendly. :-)

I suppose you can work around that by making the original button a lot
bigger than it needs to be to display the English text (say, 3 or 4 times
the required size) - hoping that it's enough big to hold all translations.  
That would make the interface quite dumb/ugly, and an autosized interface
would look much better.

Renaissance provides a solution to all those problems, but Gorm does not
support Renaissance, and if you want to use Gorm (which I quite
understand) I suppose you have not much choice at the moment.

Unfortunately my plans for a modified Gorm with Renaissance support have
been (temporarily) delayed because I haven't been able to schedule much
time for free software recently, but I hope to invert my trend at some
point soon.

For now I suppose you're stuck with what you are doing, Gorm with multiple
.gorm files, or an English .gorm and code as in your example, or
Renaissance without Gorm.

reply via email to

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