Skip to content

0.4.0

Compare
Choose a tag to compare
@liamnichols liamnichols released this 28 May 18:26
· 32 commits to main since this release
84db435

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

Full Changelog: 0.3.0...0.4.0

SHA for xcstrings-tool.artifactbundle.zip: 08ed23abb733f5cabc6627be696e497972870ec6cfec8a5c284de310349dd0ed