RE: Problem adding .lproj folders to xcode projecjt
RE: Problem adding .lproj folders to xcode projecjt
- Subject: RE: Problem adding .lproj folders to xcode projecjt
- From: James Bucanek <email@hidden>
- Date: Fri, 2 Sep 2005 18:08:54 -0700
Ando Sonenblick wrote on Friday, September 2, 2005:
>James,
>
>Thanks for your help, but I'm afraid I'm still stuck.
>
>What I have is my project (a bundle) and I want to add to it four sets
>of resources (project.nib and Localizable.string) for English, French,
>Japanese and German.
>
>I want to add all four sets to the project such that when I build the
>bundle I get something like this, as you would expect:
>
>productname.bundle
> Contents
> Resources
> English.lproj
> Project.nib
> Localizable.string
> German.lproj
> Project.nib
> Localizable.string
> Japanese.lproj
> Project.nib
> Localizable.string
> French.lproj
> Project.nib
> Localizable.string
>
>
>I tried following your instructions. For example, I added the two
>English resources to the project. They are added both to the "files"
>portion of the project plus to the "Copy Bundle Resources" phase of the
>target.
This is redundant, and possibly part of the problem. Localized resources should only be in the Copy Bundle Resources phase. The optional Copy Files phase is for random files and (to the best of my knowlege) knows nothing about localization. Remove them from the Copy Files phase.
>I did a "Get Info" on them. They already where said to be in
>the "English" localization.
This seems very odd, but I suspect that you added the file already in an .lproj file. I've never tried this, so I'm not sure what would happen.
When you add the first/English version of the file to the project, it should just be the single Project.nib file. It should not be in a .lproj folder yet. Just copy the file into the project folder, then add the single file/package to the project. Let Xcode create the .lproj sub-folders when you localize the file.
>If I build at this point I incorrectly get:
>
>productname.bundle
> Contents
> Resources
> Project.nib
> Localizable.string
>
>
>I do NOT get the English.lproj folder. I suppose that this layout may
>function properly, but I still wanted/expected the English.lproj folder.
I'm guessing that this is getting copied here from the Copy Files phase, which is incorrect.
>Continuing, I then add the French files. They are added similarly, and
>I Get Info on them and they already claim to be in a French
>localization.
Again, you shouldn't "add the French files" to the project. I gave you two ways of doing this. (1) Copy the French.lproj folder containing the French version of the Project.nib file into the project, then add a French localization to the Project.nib "group" in XCode. Or (2) add a French localication to the Project.nib group, which will duplicate the English version and create a French.lprof folder. Replace the copy of the file in the French.lproj folder with your version of the French Project.nib.
I just tried this on a test project and works fine.
Remember that you should not normally deal with .lproj folders or their contents (except to edit them, obviously). Let Xcode create and maintain the .lproj folders itself. You need to stick to adding or removing localizations of files. Otherwise, you're just adding un-localized files inside folders with funny names.
--
James Bucanek
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden