admin管理员组文章数量:1435085
I have a SwiftUI framework that's i want to implement Localizable Strings for English and Brazilian Portuguese, here is my project, code and github repo:
My HomeLocalizable.swift:
enum HomeLocalizable {
// MARK: - Home -
enum Home {
static let title = HomeLocalizable.tr("Localizable", "home.title", fallback: "Financial Control")
}
}
// MARK: - Implementation Details -
extension HomeLocalizable {
private static func tr(_ table: String, _ key: String, _ args: CVarArg..., fallback value: String = "") -> String {
let format = BundleToken.bundle.localizedString(forKey: key, value: value, table: table)
return String(format: format, locale: Locale.current, arguments: args)
}
}
private final class BundleToken {
static let bundle: Bundle = {
#if SWIFT_PACKAGE
return Bundle.module
#else
return Bundle(for: BundleToken.self)
#endif
}()
}
String files: String file 1 String file 2
Github project:
I tried using Localizable in Text()
view, the example above, and i couldn't get the translated value, only the keys or fallback
本文标签: iosCould not Localize strings in my xcframeworkStack Overflow
版权声明:本文标题:ios - Could not Localize strings in my xcframework - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745646271a2668156.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论