创建本地化的 Mac 帮助手册文件 (.help)



我已经在一个文件夹中用一种语言为我的应用程序创建了帮助,并且它起作用了。我尝试过本地化此内容并添加西班牙语翻译,但失败了。

我对 Apples 创建帮助手册指南的理解是,我需要创建一个 .help 包才能进行本地化。我已经这样做了,但是我收到一条错误消息,指出"所选主题当前不可用"。有几次我认为它有效,但它只是显示了我拥有的预本地化内容。清空帮助查看器缓存似乎可以阻止这种情况,但随后我又回到了获取不可用内容错误消息。

在我的应用程序的 AppName-Info.plist 文件中,我有以下与帮助相关的条目:

<key>CFBundleHelpBookFolder</key>
<string>AppName.help</string>
<key>CFBundleHelpBookName</key>
<string>garsonix.appname.help</string>

我的 AppName.help 文件具有以下结构:

AppName.help
    Contents
        Info.plist
        Resources
            English.lproj
                index.html
                search.helpindex
            Spanish.lproj
                index.html
                search.helpindex
            shrd
                logo.png

AppName.help 中的 Info.plist 文件具有以下键:

<key>CFBundleDevelopmentRegion</key>
<string>en_GB</string>
<key>CFBundleIdentifier</key>
<string>garsonix.appname.help</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>AppName</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.13</string>
<key>CFBundleSignature</key>
<string>hbwr</string>
<key>CFBundleVersion</key>
<string>1.13</string>
<key>HPDBookAccessPath</key>
<string>index.html</string>
<key>HPDBookIconPath</key>
<string>shrd/logo.png</string>
<key>HPDBookKBProduct</key>
<string>GAppName</string>
<key>HPDBookKBURL</key>
<string>http://www.garsonix.co.uk/</string>
<key>HPDBookRemoteURL</key>
<string>http://www.garsonix.co.uk/</string>
<key>HPDBookTitle</key>
<string>AppName Help</string>
<key>HPDBookType</key>
<string>3</string>
<key>HPDBookIndexPath</key>
<string>search.helpindex</string>

有谁知道我做错了什么,或者知道制作 .help 文件的好教程?

我终于得到了这个工作,但我不得不放弃 .help 文件格式。

相反,我

保留了旧的简单帮助文件夹,我为每种语言复制了该文件夹。然后,将每个帮助文件夹与本地化的 nib 文件一起放入主应用包的现有本地化文件夹中。

我发现本文中的说明非常有帮助:https://web.archive.org/web/20150421040211/https://www.icalamus.net/ioda/howto_applehelpbook.php?lan=en

我仍然想知道如何让 .help 格式工作,但这已经解决了我的问题,而且看起来简单得多。唯一的轻微缺点是无法共享资源,例如不需要本地化的图像。

在本地化帮助手册资源后,应本地化某些 Info.plist 键。

CFBundleNameHPDBookTitle应使用 InfoPlist.string 文件进行本地化。

最新更新