• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: loading French strings being in English language
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loading French strings being in English language


  • Subject: Re: loading French strings being in English language
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 23 Jul 2010 10:27:11 -0700

On Jul 23, 2010, at 10:24 AM, Matt Neuburg wrote:

> On Thu, 22 Jul 2010 11:19:32 +0200, Giacomo Tufano <email@hidden> said:
>> Il giorno 22/lug/2010, alle ore 11.15, cocoa learner ha scritto:
>>
>>> I have localized my app in English and French languages.
>>> But I want to load French strings being in English language based on radio
>>> button input (English and French).
>>>
>>> Is it possible?
>>> Is there any cocoa way of doing this?
>>
>> I tried the same (and asked this very list some months ago) but had no luck. I
> resorted writing some code to load the "right" localization (and not using
> NSLocalizedString() and friends). But I'm still interested in knowing if a
> "blessed" way to do that exists. My problem was on iPhoneOS but AFAIK there
> should be no differences with OS X in localization support.

You can fairly easily obtain any particular resource or set of resources from a given localization, using -pathForResource:ofType:inDirectory:forLocalization: et al. Obtaining strings from .strings files is a matter of a few lines of code--locate the file using -pathForResource:ofType:inDirectory:forLocalization:, load it using any of the standard property-list methods (e.g. dictionaryWithContentsOfFile: or propertyListFromData:mutabilityOption:format:errorDescription:) and look up the key in the resulting dictionary (the .strings file format is a variant property list format and readable by the property list APIs).

Douglas Davidson

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: loading French strings being in English language
      • From: cocoa learner <email@hidden>
References: 
 >Re: loading French strings being in English language (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: loading French strings being in English language
  • Next by Date: NSBox with a NSPopUpButton
  • Previous by thread: Re: loading French strings being in English language
  • Next by thread: Re: loading French strings being in English language
  • Index(es):
    • Date
    • Thread