Re: Localizable.strings not being read...
Re: Localizable.strings not being read...
- Subject: Re: Localizable.strings not being read...
- From: "Mr. Gecko" <email@hidden>
- Date: Thu, 3 Feb 2011 13:14:20 -0600
NSLog(@"%@", NSLocalizedStringFromTableInBundle(@"Upload File", nil, [NSBundle bundleForClass:[self class]], nil));
Just to be clear that it is in fact coming from the same bundle.
The output is Upload File
So it obviously is not reading from the Localized.strings file. I don't know why, but the same exact file in another application works. I am loading some frameworks, but I doubt it'll cause problems like this.
This is my info.plist.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSTypeIsPackage</key>
<false/>
<key>NSPersistentStoreTypeKey</key>
<string>XML</string>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string>CocoaShare</string>
<key>CFBundleIdentifier</key>
<string>com.*****.${PRODUCT_NAME:rfc1034identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
</dict>
</plist>
On Feb 3, 2011, at 12:40 PM, Uli Kusterer wrote:
> On 03.02.2011, at 19:33, Mr. Gecko wrote:
>> Hello, I'm having a problem where NSLocalizableString isn't working in one of my projects but it is working perfectly fine in a test project made just to verify it is the project. I copied the same strings from one project to the other and it all works... Has anyone experienced this problem? If so, have you found a fix? This project is complete and I don't really want to build the project file to get it working. Could it be a problem in info.plist?
>
> What kind of project is it? Application? Loadable bundle? Strings are looked up from the main bundle by default, which is the application, not the loaded bundle. That's a common issue that trips people up. You may have to explicitly specify the bundle (e.g. using bundleForClass:).
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
> http://www.zathras.de
>
>
>
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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