Repository navigation
0.4.1
What's Changed
New in 0.4.0, dedicated support for SwiftUI has been added through extensions on Text and LocalizedStringKey 馃帀 APIs support iOS 13/macOS 10.5 and later and allow you to benefit from full SwiftUI support for features such as markdown and dynamic language overrides.
var body: some View {
Form {
TextField(.localizable(.namePlaceholder), text: $name)
Text(localizable: .footnote)
}
.navigationTitle(.localizable(.createAccountTitle))
}It is now preferred to use the LocalizedStringKey.localizable(_:) or LocalizedStringResource.localizable(_:) static methods instead of the LocalizedStringResource.localizable static property. The static property has been marked as deprecated. A warning will be emitted starting in 0.5.0 and the code will be completely removed in 1.0.0. See below for migrating your code:
- Text(.localizable.foo)
+ Text(.localizable(.foo))- String(localized: .localizable.bar)
+ String(localizable: .bar)- .navigationTitle("\(.localizable.title)")
+ .navigationTitle(.localizable(.title))Pull Requests
0.4.1
- Fix availability of LocalizedStringKey extension (iOS 14+) by @liamnichols in liamnichols/xcstrings-tool#88
- Update CI by @liamnichols in https://github.com/liamnichols/x
0.4.0
- Refactor some parts of the generator code by @liamnichols in liamnichols/xcstrings-tool#73, liamnichols/xcstrings-tool#76, liamnichols/xcstrings-tool#77, liamnichols/xcstrings-tool#78, liamnichols/xcstrings-tool#79
- Change declaration and make
LocalizedStringResource.init(localizable:)internal by @liamnichols in liamnichols/xcstrings-tool#80 - Add backwards compatible initialisers for
TextandLocalizedStringsKeyby @liamnichols in liamnichols/xcstrings-tool#82 - Use Existential
anyby @liamnichols in liamnichols/xcstrings-tool#85 - Add Sendable conformance to generated struct by @liamnichols in liamnichols/xcstrings-tool#86
- soft-deprecate old generated LocalizedStringResource extensions by @liamnichols in liamnichols/xcstrings-tool#87