-
Notifications
You must be signed in to change notification settings - Fork 319
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
Paywall Components Localized Strings #4237
Paywall Components Localized Strings #4237
Conversation
# Conflicts: # Sources/Paywalls/Components/PaywallComponentBases.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just some small nitpicks but will leave to others to approve.
Tests/TestingApps/PaywallsTester/PaywallsTester/Extensions/ArrayExtensions.swift
Outdated
Show resolved
Hide resolved
Sources/Paywalls/Components/PaywallComponentPropertyTypes.swift
Outdated
Show resolved
Hide resolved
@RCGitBot please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small things but real close! This localization handling looks 🔥
RevenueCatUI/Templates/Components/TemplateComponentsView+extensions.swift
Outdated
Show resolved
Hide resolved
Tests/TestingApps/PaywallsTester/PaywallsTester/UI/Views/SamplePaywallsList.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! 👍
Changing labels from |
- Adds localized string support to paywall components -This is primarily done in `TemplateComponentsView`'s static function `chooseLocalization`. - Validates that promised localized strings are actually available. -This is done as component view models are created (see `TextComponentViewModel`), by throwing if an expected key is not present: `self.text = try localizedStrings.string(key: component.textLid)` -This pattern should be followed for every property that represents a localized string id, which ensures a non-nil value for every value.
Adds localized string support to paywall components
-This is primarily done in
TemplateComponentsView
's static functionchooseLocalization
.Validates that promised localized strings are actually available.
-This is done as component view models are created (see
TextComponentViewModel
), by throwing if an expected key is not present:self.text = try localizedStrings.string(key: component.textLid)
-This pattern should be followed for every property that represents a localized string id, which ensures a non-nil value for every value.
Simulator.Screen.Recording.-.iPhone.15.Pro.-.2024-09-03.at.17.39.47.mov