Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deprecation warnings to generated LocalizedStringResource API #93

Merged
merged 2 commits into from
Jun 9, 2024

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
6 checks passed
@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.

1 participant