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

Bring support to all OS versions #70

Merged
merged 5 commits into from
May 16, 2024

Conversation

liamnichols
Copy link
Owner

In #50, we extended support to iOS 15+ by using String.init(localized:defaultValue:table:bundle:locale:), but it turned out that there was no advantage to using this initialiser over using the original String.init(format:locale:arguments:) combined with Bundle.localizedString(forKey:value:table:).

I thought that there was originally because I thought that the newer init allowed you to override the language with the locale argument, but it turned out that the locale is only used for formatting arguments (i.e decimals) and nothing else.

As a result, I have switched the generated code to use String.init(format:locale:arguments:), which means that it will work across all OS versions now 🚀

The only version constrained code is the use of LocalizedStringResource

@liamnichols liamnichols self-assigned this May 16, 2024
@liamnichols liamnichols changed the title Make generated code support all OS versions Bring support to all OS versions May 16, 2024
@liamnichols liamnichols merged commit 6e50766 into main May 16, 2024
4 checks passed
@liamnichols liamnichols deleted the ln/better-backwards-compatibility branch May 16, 2024 21:27
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