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

[Customer Center] SubscriptionDetailsView gets its strings from CommonLocalizedString. #4083

Merged

Conversation

JayShortway
Copy link
Member

@JayShortway JayShortway commented Jul 18, 2024

As the title says.

  • The SubscriptionDetailsView gets its strings from CommonLocalizedString.
  • Moves the strings out of SubscriptionInformation.
    • This avoids SubscriptionInformation having to care about localization, and having to add @available annotations, since it's only available on iOS 15 and up.
    • What (text) to display for which state is arguably more of a UI/presentation concern.

@JayShortway JayShortway requested a review from a team July 18, 2024 16:18
@JayShortway JayShortway self-assigned this Jul 18, 2024
@JayShortway JayShortway marked this pull request as draft July 19, 2024 06:52
@JayShortway JayShortway marked this pull request as ready for review July 19, 2024 07:02
@JayShortway JayShortway marked this pull request as draft July 19, 2024 09:05
@JayShortway JayShortway changed the base branch from integration/customer_support_workflow to 06-17-removes_eligibility_from_reponse July 19, 2024 09:15
@JayShortway JayShortway changed the title [Customer Center] Makes SubscriptionDetailsView strings localizable [Customer Center] SubscriptionDetailsView gets its strings from CommonLocalizedString. Jul 19, 2024
@JayShortway JayShortway marked this pull request as ready for review July 19, 2024 09:46
Copy link
Contributor

@tonidero tonidero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Comment on lines 158 to 164
var explanation: String {
return subscriptionInformation.active ? (
subscriptionInformation.willRenew ?
localization.commonLocalizedString(for: .subEarliestRenewal) :
localization.commonLocalizedString(for: .subEarliestExpiration)
) : localization.commonLocalizedString(for: .subExpired)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NABD but any reason to keep this as a computed property? Or could we simplify it like this

Suggested change
var explanation: String {
return subscriptionInformation.active ? (
subscriptionInformation.willRenew ?
localization.commonLocalizedString(for: .subEarliestRenewal) :
localization.commonLocalizedString(for: .subEarliestExpiration)
) : localization.commonLocalizedString(for: .subExpired)
}
var explanation = subscriptionInformation.active ? (
subscriptionInformation.willRenew ?
localization.commonLocalizedString(for: .subEarliestRenewal) :
localization.commonLocalizedString(for: .subEarliestExpiration)
) : localization.commonLocalizedString(for: .subExpired)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason! I even asked ChatGPT if this was idiomatic SwiftUI haha. Thanks for the suggestion! Please keep em coming.

I'll do this here and for expirationString below.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now done: 2fc4bb6

Base automatically changed from 06-17-removes_eligibility_from_reponse to integration/customer_support_workflow July 19, 2024 14:30
@JayShortway JayShortway merged commit dcbfb7d into integration/customer_support_workflow Jul 22, 2024
4 checks passed
@JayShortway JayShortway deleted the current-subscription-strings branch July 22, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants