0.4.0
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), $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
- Refactor some parts of the generator code by @liamnichols in #73
- Significant refactor of
StringGenerator
by @liamnichols in #76 - Refactoring PlaceholderType usage in StringGenerator by @liamnichols in #77
- Refactor generated code to use less extensions by @liamnichols in #78
- Generate source code with trailing newline by @liamnichols in #79
- Change declaration and make
LocalizedStringResource.init(localizable:)
internal by @liamnichols in #80 - Add backwards compatible initialisers for
Text
andLocalizedStringsKey
by @liamnichols in #82 - Rename Version module to XCStringsToolConstants by @liamnichols in #84
- Use Existential
any
by @liamnichols in #85 - Add Sendable conformance to generated struct by @liamnichols in #86
- soft-deprecate old generated LocalizedStringResource extensions by @liamnichols in #87
Full Changelog: 0.3.0...0.4.0
SHA for xcstrings-tool.artifactbundle.zip: 08ed23abb733f5cabc6627be696e497972870ec6cfec8a5c284de310349dd0ed