Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6343209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:23:36+00:00 2026-05-24T20:23:36+00:00

We might have a need for loading a nib using the results of [NSBundle

  • 0

We might have a need for loading a nib using the results of

[NSBundle -pathForResource:ofType:inDirectory:forLocalization:]

I thought this would be possible, but all the methods I can find only want the name not leading path info.

We are exploring a way to provide both fr-Fr and fr-CA through one code base. Our client wants a fr-CA translation and we’re afraid we might have another customer that wants a fr-Fr translation. I was thinking we could path to correct nib based on the selected language.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T20:23:39+00:00Added an answer on May 24, 2026 at 8:23 pm

    The path lookup takes into account the user’s locale preferences. If you provide the proper localization directories (.lproj), the right nib should be loaded by the system.

    Per Apple’s documentation:

    The method first looks for a matching resource file in the non-localized resource directory of the specified bundle. (In Mac OS X, this directory is typically called Resources but in iOS, it is the main bundle directory.) If a matching resource file is not found, it then looks in the top level of any available language-specific “.lproj” directories. (The search order for the language-specific directories corresponds to the user’s preferences.) It does not recurse through other subdirectories at any of these locations. For more details see Internationalization Programming Topics.

    Unfortunately, Apple’s documentation is self-contradictory and incomplete. If you look at “Internationalization and Programming Topics”, section “Language and Locale Designations”, you will find under “Language and Locale IDs” this gem:

    Important: In iOS, the bundle interfaces do not take dialect or script information into account when looking for localized resources; only the language designator code is considered. Therefore if your project includes language-specific project directories with both a language and region designator, those directories are ignored. The bundle interfaces in Mac OS X do support region designators in language-specific project directories.

    This is not entirely true. If you look at Apple’s own applications, you will see that iOS does support some region designations, but only the ones Apple cares about. See for example the list of .lproj directories in a recent Mobile Safari:

    $ ls -d *.lproj
    Dutch.lproj/    el.lproj/       pt_PT.lproj/
    English.lproj/  en_GB.lproj/    ro.lproj/
    French.lproj/   fi.lproj/       ru.lproj/
    German.lproj/   he.lproj/       sk.lproj/
    Italian.lproj/  hr.lproj/       sv.lproj/
    Japanese.lproj/ hu.lproj/       th.lproj/
    Spanish.lproj/  id.lproj/       tr.lproj/
    ar.lproj/       ko.lproj/       uk.lproj/
    ca.lproj/       no.lproj/       vi.lproj/
    cs.lproj/       pl.lproj/       zh_CN.lproj/
    da.lproj/       pt.lproj/       zh_TW.lproj/
    

    Notice that two Chinese regions, a British English region, and a Portugal Portuguese region are supported. But none of these solves the problem of fr_CA versus fr_FR.

    For that, let’s look at MobileSafari again. It must implement its own smart lookup, because it has plenty of more finely distinguished StaticBookmarks-xx_YY.plist files.

    So, that’s the solution: Use the locale functions that are still available, and do your own lookup accordingly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I thought this might be simple but i guess it's not, i have like
curious if anyone might have some insight in how I would do the following
I wondered if someone might have some insight into this. jqGrid is quite happy
I believe this question might have been previously attempted in 2006 on a different
I have already added delay loading to my project, using the instructions in http://msdn.microsoft.com/en-us/library/151kt790.aspx
You might have a set of properties that is used on the developer machine,
I might have wandered into wrong direction so please help. I have a page
You might have seen video through you tube in iPhone. Normal MPMoviePlayerController has previous,
I have a situation where I might have multiple instances of a program running
We have some ancient Delphi code (might have even originated as Turbo Pascal code)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.