Navigation Menu

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

Allow main let to not be generated by providing omit-main-let flag #809

Merged

Conversation

jimmya
Copy link
Contributor

@jimmya jimmya commented Feb 15, 2023

The app I'm working in is translated dynamically. So I'm relying on preferredLanguages to ensure the correct translations are loaded for the selected language.

However, since the main let (let R = _R(bundle: Bundle(for: BundleFinder.self))) is always generated and available for everyone to use, it's quite hard to police proper usage of the custom definitions.

This non breaking PR adds a flag to omit the generation of the main let. This allows a custom let R to be defined with the customisation required. And will prevent accidental usage of the main let without customisations.

@jimmya
Copy link
Contributor Author

jimmya commented Feb 28, 2023

@mac-cain13 @tomlokhorst sorry to bother you but do you perhaps have time to take a look at this? It's sort of blocking us from migrating to 7.x at the moment.

@tomlokhorst
Copy link
Collaborator

Thanks for this PR! This looks like a good feature for exactly this use case.

Sorry for not replying sooner, I just realised al my R.swift related emails were redirected to a different folder in my mailbox that I didn't check 🤦‍♂️

I'll merge this and will release it in a few days.

@tomlokhorst tomlokhorst merged commit fc3f02d into mac-cain13:master Mar 5, 2023
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.

None yet

2 participants