Re: Language names in UI
Re: Language names in UI
- Subject: Re: Language names in UI
- From: Dustin Voss <email@hidden>
- Date: Thu, 9 Oct 2003 17:51:07 -0700
On Tuesday, October 7, 2003, at 09:20 AM, Darrin Cardani wrote:
In my application, the user can enter data in different languages.
(Thanks to everyone who had suggestions for how to allow that. It
worked!) Now I'm wondering about something related. I have a QuickTime
movie, and I want to add a track that is associated with each
language. I can do that by calling QuickTime's SetMediaLanguage ().
However, the code I have to pass it is one of the script codes from
Script.h, like these:
enum {
langEnglish = 0, /* smRoman script*/
langFrench = 1, /* smRoman script*/
... etc.
Is there any way to translate what the user typed as the name of the
language (possibly in English, possibly in any other language) into a
script code? This will also be an issue when I attempt to save the
document data, as I was hoping to be able to use XML and use the
proper language code there, too.
I wouldn't do it this way. Who knows how the user will spell the
language? Maybe they are using a dialect where the spelling is
different, or a synonym, or maybe they type "British English" instead
of "English".
Are there other ways to do what I'm trying to do? I thought of
presenting a list of languages to the user, and making them pick one,
but that seems really cumbersome. (Plus, would it be in English, or in
all the different languages? If it's in different languages would
users understand the sorting of the language names? etc.)
Do it this way. You can get displayable strings for a language code
(e.g. langEnglish) with Locale Utilities' LocaleRefFromLangOrRegionCode
and LocaleGetName functions. You can get that string in the language of
your choice.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.