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

Support iOS 15/macOS 12 #50

Merged
merged 6 commits into from
Apr 12, 2024
Merged

Support iOS 15/macOS 12 #50

merged 6 commits into from
Apr 12, 2024

Conversation

liamnichols
Copy link
Owner

@liamnichols liamnichols commented Apr 8, 2024

Bit of a WIP, but the initial draft that will allow use of xcstrings-tool on iOS 15/macOS 12.

I still need to add documentation back to the generated code, but its mostly there so can be tested out if you need it urgently.

For a strings table called Localizable with a key called foo, you can use as follows:

String(localizable: .foo) // iOS 15+ via String.init(localized:defaultValue:table:locale:bundle:)
String(localized: .localizable.foo) // iOS 16+ via LocalizedStringResource

@liamnichols liamnichols changed the title [WIP] Support iOS 15/macOS 12 Support iOS 15/macOS 12 Apr 11, 2024
@liamnichols liamnichols marked this pull request as ready for review April 11, 2024 14:24
@liamnichols
Copy link
Owner Author

Will merge this as it is complete. I want to refactor the generator code at some point, but at least we have a good base now.

I'm going to add the ability to alter the locale using the iOS 15 API in a followup Pull Request.

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.

Support macOS 12/iOS 15/etc by using String(localized:) instead of LocalizedStringResource
1 participant