Elf*_*ros 3 xcode cocoa-touch localization objective-c ios
我想在我的应用程序中使用NSLocalizedString,但它总是失败.我做的是:
然后我使用NSLocalizedStrings如下,但它不起作用!
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
// Insert code here to initialize your application
NSString *v1 = NSLocalizedString(@"MyWindow", nil);
//NSString *v1 = [[NSBundle mainBundle] localizedStringForKey:(@"MyWindow") value:@"" table:nil];
[label setStringValue:v1];
}
Run Code Online (Sandbox Code Playgroud)
在我的3 .strings文件中,我定义了下面的键/值:"MyWindow"="Ma Fenetre";
通常,我的标签应显示"Ma Fenetre"而不是"MyWindows"您可以在此处下载示例项目并告诉我问题在哪里.
Bellow我的应用包中的Resources文件夹的内容:
DerivedData om$ find test/Build/Products/Debug/test.app/Contents/Resources/
test/Build/Products/Debug/test.app/Contents/Resources/
test/Build/Products/Debug/test.app/Contents/Resources//de.lproj
test/Build/Products/Debug/test.app/Contents/Resources//de.lproj/File.strings
test/Build/Products/Debug/test.app/Contents/Resources//en.lproj
test/Build/Products/Debug/test.app/Contents/Resources//en.lproj/File.strings
test/Build/Products/Debug/test.app/Contents/Resources//fr.lproj
test/Build/Products/Debug/test.app/Contents/Resources//fr.lproj/File.strings
test/Build/Products/Debug/test.app/Contents/Resources//MainMenu.nib
Run Code Online (Sandbox Code Playgroud)
谢谢Elfoiros
| 归档时间: |
|
| 查看次数: |
8492 次 |
| 最近记录: |