对使用参数的每次调用都使用命令行时出现Bad entry in file
错误genstrings
NSLocalizedString
tableName
尝试生成本地化字符串时请参阅以下示例(来自Firefox-iOS)
find . -name *.swift | xargs genstrings -o en.lproj
文件 ./StorageTests/TestSQLiteHistory.swift 中的错误条目(行 = 100):参数不是文字字符串。
文件 ./StorageTests/TestSQLiteHistory.swift 中的错误条目(行 = 101):参数不是文字字符串。
文件 ./StorageTests/TestSQLiteHistory.swift 中的错误条目(行 = 102):参数不是文字字符串。
文件 ./StorageTests/TestSQLiteHistory.swift 中的错误条目(行 = 103):参数不是文字字符串。参数不是文字字符串。
这是这些行的代码
let titleMobile = NSLocalizedString("Mobile Bookmarks", tableName: "Storage", comment: "The title of the folder that contains mobile bookmarks. This should match bookmarks.folder.mobile.label on Android.")
let titleMenu = NSLocalizedString("Bookmarks Menu", tableName: "Storage", comment: "The name of the folder that contains desktop bookmarks in the menu. This should match bookmarks.folder.menu.label on Android.")
let titleToolbar = NSLocalizedString("Bookmarks Toolbar", tableName: "Storage", comment: "The name of the folder that contains desktop bookmarks in the toolbar. This should match bookmarks.folder.toolbar.label on Android.")
let titleUnsorted = NSLocalizedString("Unsorted Bookmarks", tableName: "Storage", comment: "The name of the folder that contains unsorted desktop bookmarks. This should match bookmarks.folder.unfiled.label on Android.")
当我搜索解决方案时,我发现了这个用于生成和合并本地化字符串的工具。它适用于这种情况,生成本地化字符串并将其合并到Localizable.strings
,但在运行时应用程序不显示本地化标题,因为它尝试从名称Storage.strings
不是来自的文件中加载本地化字符串Localizable.strings
是否有任何解决方案可以自动生成这些文件而不是手动生成?