Re: Bindings and localization
Re: Bindings and localization
- Subject: Re: Bindings and localization
- From: Larry Gerndt <email@hidden>
- Date: Thu, 11 Nov 2004 17:42:26 -0800
>> Has anyone thought of a way to use bindings to localize resources
>> automatically?
>>
> Yes...
>
>> If there is no way, would this be a good enhancement request?
>>
> Yes.
>
>> For example, currently the bindings allow you to bind to either: File's
>> Owner Shared User Defaults Shared Application Would it make sense to
>> provide a fourth binding called "Localized Strings", such that an object so
>> bound would retrieve its text value automatically by keying into
>> Localizable.string using the english value as the key?
>>
> Rather than constraining the developer to Localizable.strings it would be
> better to be able also to specify a strings table (default would be
> "Localizable").
>
> All that said, it's not clear just how much value bindings per se would be in
> many localisation tasks. Part of the effort is typically ensuring that the
> user interface is satisfactorily laid out. Using bindings, or any other
> mechanism (in the absence of any other tools support), to dynamically localise
> the interface at runtime makes it more difficult for translators and for
> designers.
This is true, but with careful UI design, it might be possible to make the
buttons and fields large enough to accommodate the string in any language.
And if that be the case, then the translator's job becomes *much* easier
because he only has to edit the strings files.
> Where common cases where the user interface is dynamically generated (error
> strings presented in standard panels, for example), a simple value transformer
> will generally suffice:
>
> - (id)transformedValue:(id)localizationKey { NSString *localizedString =
> [[NSBundle mainBundle] localizedStringForKey: localizationKey value:@"No
> translation" table:nil]; return localizedString; }
[snip]
> mmalc
I thought about the value transformer, but I think the problem there is,
you'd have to bind each text field to a specific string (the key) in File's
Owner, which would bloat that class with accessors for every single string
key, or am I misunderstanding something? I want the text field's current
value (as entered in IB) to be the key, but I see no way of passing that to
the transformer.
--
Larry Gerndt
AIM Handle: SonOfTheSonOfMan
Let the truth be told though the heavens fall -- James Garrison
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden