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

Migrate away from using the .localized string extension which could c… #735

Conversation

72A12F4E
Copy link
Contributor

@72A12F4E 72A12F4E commented Jun 29, 2024

This change removes the extension on String that aliased NSLocalizedString.

NSLocalizedString has some special magic under the hood that is mean to work specifically with static strings in the source code. By wrapping it in a computed property, a developer could inadvertently think dynamic string content was being localized.

While this was fine in the majority of cases. we did find a few where it didn't work. Notably, this was occurring in some of the localized extensions on other types, because these types' rawValue is set at runtime.

@72A12F4E
Copy link
Contributor Author

72A12F4E commented Jun 29, 2024

Conflicted on this one. Its one of those things that was fine 99% of the time and a decent enough improvement, but caused a missed translation key in a few cases and is unnecessary in others.

@72A12F4E 72A12F4E closed this Jun 29, 2024
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