我有一个 Cocoa 应用程序。这与 OSX 服务菜单挂钩。我创建了三个ServicesMenu.strings
用于本地化服务菜单标题的en.lproj
和zh-Hans.lproj
。问题是 OSX 似乎确实在使用本地化文本。hi-IN.lproj
Info.plist(相关部分)
<key>NSServices</key>
<array>
<dict>
<key>NSKeyEquivalent</key>
<key>NSMenuItem</key>
<dict>
<key>default</key>
<string>CreateHere</string>
</dict>
<key>NSMessage</key>
<string>createHere</string>
<key>NSPortName</key>
<string>CreateHereFilesService</string>
<key>NSRequiredContext</key>
<dict>
<key>NSApplicationIdentifier</key>
<string>com.apple.finder</string>
</dict>
<key>NSSendFileTypes</key>
<array>
<string>public.folder</string>
</array>
<key>NSUserData</key>
<string>create</string>
</dict>
</array>
ServicesMenu.strings (en.lproj)
/*
ServicesMenu.strings
*/
/* default */
"CreateHere" = "Create File Here";
在服务菜单上,我可以看到选项CreateHere
而不是Create File Here
.
更新
如果这有帮助。这是输出/System/Library/CoreServices/pbs -dump_pboard
{
CFPrincipalLocalizations = (
English
);
CFVendedServices = (
{
NSBundleIdentifier = "com.applegrew.apple.service.CreateHereFiles";
NSBundlePath = "/Users/applegrew/Library/Services/CreateHereFiles.app";
NSMenuItem = {
default = CreateHere;
};
NSMessage = createHere;
NSPortName = CreateHereFilesService;
NSRequiredContext = {
NSApplicationIdentifier = "com.apple.finder";
};
NSSendFileTypes = (
"public.folder"
);
NSUUID = <199fd7c0 cdd146fb 9a564a93 231b23f9>;
NSUserData = create;
}
);
CFVersion = 2;
}
不像其他服务(上面未显示)NSMenuItem
没有任何条目English
。这与我没有English.lproj
,而是我有有什么关系en.lproj
吗?