你能使用SwiftGen从Localizable.strings中的注释而不是键生成属性吗



有没有一种方法可以从注释生成属性,而不是使用SwiftGen生成本地化密钥?

这里有一个例子可以更好地说明我的意思:

Lozalizable.strings:

...
/* file_detail.button.download */
"T00014" = "Download";
...

Strings+Generated.swift:

internal enum L10n {
internal enum FileDetail {
internal enum Button {
/// Download
internal static let download = L10n.tr("Localizable", "T00014")
}
}
}

您可以为此编写一个自行编写的解决方案。如果你想使用注释而不是键,请为此编写你的.模具,并在SwiftGen中使用。几天前,我写了我的本地化解决方案,在那里我写了一个.sticket文件,你可以查看它的灵感。

https://github.com/idapgroup/xcode-localization-parser

最新更新