[NSBundle preferredLocalizationsFromArray:] Is the cold war really over?

  • I'm seeing a strange phenomenon (a.k.a probably a bug) with + [NSBundle
    preferredLocalizationsFromArray:] on Mac OS X 10.4.10.

    I have an array with only one NSString : @"Russian".

    But the return array of [NSBundle
    preferredLocalizationsFromArray:[NSArray arrayWithObject:@"Russian"]];
    is "English" or "en".

    Is this the designed behavior?
  • On Nov 23, 2007 5:44 PM, Stéphane Sudre <ssudre2...> wrote:
    > I'm seeing a strange phenomenon (a.k.a probably a bug) with + [NSBundle
    > preferredLocalizationsFromArray:] on Mac OS X 10.4.10.
    >
    > I have an array with only one NSString : @"Russian".
    >
    > But the return array of [NSBundle
    > preferredLocalizationsFromArray:[NSArray arrayWithObject:@"Russian"]];
    > is "English" or "en".
    >
    > Is this the designed behavior?

    I have two questions for you:
    1) Does your bundle's Resources directory have a Russian.lproj directory?
    2) Is Russian one of the languages selected in the International pane
    of System Preferences?

    If not, then IIRC, NSBundle falls back to English..

    --
    Clark S. Cox III
    <clarkcox3...>
  • On samedi, novembre 24, 2007, at 03:57  AM, Clark Cox wrote:

    > On Nov 23, 2007 5:44 PM, Stéphane Sudre <ssudre2...> wrote:
    >> I'm seeing a strange phenomenon (a.k.a probably a bug) with +
    >> [NSBundle
    >> preferredLocalizationsFromArray:] on Mac OS X 10.4.10.
    >>
    >> I have an array with only one NSString : @"Russian".
    >>
    >> But the return array of [NSBundle
    >> preferredLocalizationsFromArray:[NSArray arrayWithObject:@"Russian"]];
    >> is "English" or "en".
    >>
    >> Is this the designed behavior?
    >
    > I have two questions for you:
    > 1) Does your bundle's Resources directory have a Russian.lproj
    > directory?

    No. But, AFAIK, this is not related. I just have English and French
    .lproj directories and the method works fine for other language such as
    German, Dutch, Spanish, Brazilian Portuguese, Italian, etc.

    > 2) Is Russian one of the languages selected in the International pane
    > of System Preferences?

    No, as a matter of fact, Russian is not. It could be the reason but
    then it would mean that the API is not really robust because Russian is
    a perfectly valide language name and should be returned when it's the
    only one available.
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today