Skip to content

Conversation

@liamnichols
Copy link
Owner

@liamnichols liamnichols commented Jun 9, 2024

In 0.4.0, we introduced LocalizedStringResource.localized(_:) to match the same method added to LocalizedStringKey and as a result, we deprecated the original generated code on the LocalizedStringResource type.

In 0.4.0 however, a warning was not omitted. In 0.5.0, I am now omitting a warning because this code will be removed from an upcoming release:

Screenshot 2024-06-09 at 13 38 15

Please see the following from the 0.4.0 release notes:

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))

@liamnichols liamnichols self-assigned this Jun 9, 2024
@liamnichols liamnichols merged commit f49794c into main Jun 9, 2024
@liamnichols liamnichols deleted the ln/add-deprecation-warnings branch June 9, 2024 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants