bugGNUstep - Bugs: bug #30239, [NSBundle...

Group
 
 

bug #30239: [NSBundle pathForResource:ofType:inDirectory:forLocalization:] does not find Localizable.strings

Submitter:  David Wetzel <dwetzel>
Submitted:  Thu 24 Jun 2010 03:06:44 AM UTC
   
 
Category:  Base/Foundation Severity:  4 - Important
Item Group:  Bug Status:  Works For Me
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Jul 2010 03:09:28 PM UTC, comment #4: 

It seems this was tested and can be closed.

Thanks

Nicola Pero <nico>
Group Member
Fri 25 Jun 2010 07:53:04 PM UTC, comment #3: 

I tried with gsweb/trunk/Testing/DynamicElements
and it seems to work as expected :-)

David Wetzel <dwetzel>
Group Member
Fri 25 Jun 2010 04:03:35 PM UTC, comment #2: 

I changed the code to ignore the languages preference when asked for resources for a specific language.
That seems reasonable behavior.
It would still be good to have a testcaseto check this though.

Richard Frith-Macdonald <CaS>
Group Member
Fri 25 Jun 2010 10:59:48 AM UTC, comment #1: 

Please provide a simple testcase to demonstrate the problem (we can then add it to the testsuite), as it's not clear that there is a bug.
I see in the code that NSBundle mimics OSX behavior in that it only checks languages which are set in the user defaults system ... so that might be an issue.


Richard Frith-Macdonald <CaS>
Group Member
Thu 24 Jun 2010 03:06:44 AM UTC, original submission:  

The Localizable.strings file is not found.
my code works on OSX...
It seems like the bundle is is not checking the German.lproj subdirs.

There is testcode in SVN. just build gsweb, go to Testing/DynamicElements
and run the app.
then click on the image test.

dave@nbsd64>ls -l ./DynamicElements.gswa/Resources/German.lproj/
total 8
-rw-r--r--  1 dave  80  83 Jun 23 19:51 Localizable.strings



 Breakpoint 2, -[NSBundle pathForResource:ofType:inDirectory:forLocalization:] (self=0x7f7ffb5bd0f0, _cmd=0x7f7ffdcd5750,
    name=0x7f7ffaf9e390, ext=0x7f7ffaf9e3c0, subPath=0x0, localizationName=0x7f7ffb271b50) at NSBundle.m:1854
1854      CREATE_AUTORELEASE_POOL(arp);
(gdb) po localizationName
German
(gdb) next
1855      NSString      *result = nil;
(gdb)
1858      if ([ext length] == 0)
(gdb)
1866      array = [self pathsForResourcesOfType: ext
(gdb)
1870      if (array != nil)
(gdb)
1872          NSEnumerator      *enumerator = [array objectEnumerator];
(gdb) po array
()         <-------------- BUG
(gdb) po ext
strings
(gdb) po name
Localizable

David Wetzel <dwetzel>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by nico (Posted a comment)
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by dwetzel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-26 nico Open/ClosedIn Test Closed
    2010-06-25 dwetzel StatusFixed Works For Me
    2010-06-25 CaS StatusNeed Info Fixed
        Open/ClosedOpen In Test
    2010-06-25 CaS StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code