Skip to content

Commit

Permalink
Paywalls: improved variable warning (#2984)
Browse files Browse the repository at this point in the history
  • Loading branch information
NachoSoto committed Aug 17, 2023
1 parent 3a5f7e8 commit 8721b28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions RevenueCatUI/Data/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ enum Strings {

case package_not_subscription(Package)
case found_multiple_packages_of_same_identifier(String)
case could_not_find_content_for_variable(variableName: String)
case unrecognized_variable_name(variableName: String)

case determining_whether_to_display_paywall
case displaying_paywall
Expand All @@ -33,8 +33,9 @@ extension Strings: CustomStringConvertible {
case let .found_multiple_packages_of_same_identifier(identifier):
return "Found multiple packages with same identifier '\(identifier)'. Will use the first one."

case let .could_not_find_content_for_variable(variableName):
return "Couldn't find content for variable '\(variableName)'"
case let .unrecognized_variable_name(variableName):
return "Found an unrecognized variable '\(variableName)'. It will be replaced with an empty string.\n" +
"See the docs for more information: https://www.revenuecat.com/docs/paywalls#variables"

case .determining_whether_to_display_paywall:
return "Determining whether to display paywall"
Expand Down
2 changes: 1 addition & 1 deletion RevenueCatUI/Data/Variables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private extension VariableDataProvider {
case "sub_offer_price": return self.localizedIntroductoryOfferPrice ?? ""

default:
Logger.warning(Strings.could_not_find_content_for_variable(variableName: variableName))
Logger.warning(Strings.unrecognized_variable_name(variableName: variableName))
return ""
}
}
Expand Down

0 comments on commit 8721b28

Please sign in to comment.