diff --git a/Shared/Models/PersonalityPackable.swift b/Shared/Models/PersonalityPackable.swift index aa9da07..4feca3a 100644 --- a/Shared/Models/PersonalityPackable.swift +++ b/Shared/Models/PersonalityPackable.swift @@ -49,7 +49,7 @@ enum PersonalityPack: Int, CaseIterable { } final class DefaultTitles: PersonalityPackable { - static var title = "Nice" + static var title = String(localized: "nice") static var notificationTitles: [String] { [ @@ -79,7 +79,7 @@ final class DefaultTitles: PersonalityPackable { } final class RudeTitles: PersonalityPackable { - static var title = "Rude" + static var title = String(localized: "rude") static var notificationTitles: [String] { [ diff --git a/Shared/views/CustomizeView/SubViews/CustomWigetView.swift b/Shared/views/CustomizeView/SubViews/CustomWigetView.swift index fcc64d2..d312fa1 100644 --- a/Shared/views/CustomizeView/SubViews/CustomWigetView.swift +++ b/Shared/views/CustomizeView/SubViews/CustomWigetView.swift @@ -45,7 +45,7 @@ struct CustomWigetView: View { .padding() .cornerRadius(10) - Text("[How to add widget](https://support.apple.com/guide/iphone/add-widgets-iphb8f1bf206/ios)") + Text("[\(String(localized: "how_to_add_widget"))](https://support.apple.com/guide/iphone/add-widgets-iphb8f1bf206/ios)") .accentColor(textColor) .padding(.bottom) } diff --git a/Shared/views/MonthView/MonthView.swift b/Shared/views/MonthView/MonthView.swift index 50f674a..53f01ec 100644 --- a/Shared/views/MonthView/MonthView.swift +++ b/Shared/views/MonthView/MonthView.swift @@ -86,7 +86,7 @@ struct MonthView: View { if iapManager.showIAP { VStack { Spacer() - PurchaseButtonView(iapManager: iapManager) + PurchaseButtonView(height: 250, iapManager: iapManager) } } else if iapManager.showIAPWarning { VStack { diff --git a/Shared/views/PurchaseButtonView.swift b/Shared/views/PurchaseButtonView.swift index 5bf02a0..7d1e16c 100644 --- a/Shared/views/PurchaseButtonView.swift +++ b/Shared/views/PurchaseButtonView.swift @@ -17,8 +17,13 @@ struct PurchaseButtonView: View { private let showCountdownTimer: Bool private let showManageSubClosure: (() -> Void)? - - public init(iapManager: IAPManager, showManageSubClosure: (() -> Void)? = nil, showCountdownTimer: Bool = false) { + private let height: CGFloat? + + public init(height: CGFloat? = nil, + iapManager: IAPManager, + showManageSubClosure: (() -> Void)? = nil, + showCountdownTimer: Bool = false) { + self.height = height self.showManageSubClosure = showManageSubClosure self.iapManager = iapManager self.showCountdownTimer = showCountdownTimer @@ -31,8 +36,14 @@ struct PurchaseButtonView: View { switch iapManager.showIAPWarning { case true: VStack { - buyOptionsView - .background(theme.currentTheme.secondaryBGColor) + if let height = self.height { + buyOptionsView + .background(theme.currentTheme.secondaryBGColor) + .frame(height: height) + } else { + buyOptionsView + .background(theme.currentTheme.secondaryBGColor) + } } case false: subscribedView @@ -122,12 +133,13 @@ struct PurchaseButtonView: View { } .frame(minWidth: 0, maxWidth: .infinity, alignment: .leading) } - - Text(String(localized: "purchase_view_current_why_subscribe")) - .font(.body) - .bold() - .foregroundColor(textColor) } + + Text(String(localized: "purchase_view_current_why_subscribe")) + .font(.body) + .bold() + .foregroundColor(textColor) + HStack { ForEach(iapManager.sortedSubscriptionKeysByPriceOptions) { product in Button(action: { diff --git a/Shared/views/YearView/YearView.swift b/Shared/views/YearView/YearView.swift index 7b65f58..f9b11e3 100644 --- a/Shared/views/YearView/YearView.swift +++ b/Shared/views/YearView/YearView.swift @@ -67,7 +67,7 @@ struct YearView: View { if iapManager.showIAP { VStack { Spacer() - PurchaseButtonView(iapManager: iapManager) + PurchaseButtonView(height: 250, iapManager: iapManager) } } else if iapManager.showIAPWarning { VStack { diff --git a/en.lproj/Localizable.strings b/en.lproj/Localizable.strings index 7b14e88..33cf724 100644 --- a/en.lproj/Localizable.strings +++ b/en.lproj/Localizable.strings @@ -138,4 +138,9 @@ "share_view_month_moods_total_template_title" = "Total Entries for %@ - %d"; "share_view_current_streak_template_title" = "Last 10 Days"; "share_view_longest_streak_template_title" = "Longest consecutive days I was %@"; + +"how_to_add_widget" = "How to Add Widget"; +"nice" = "Nice"; +"rude" = "Rude"; + /* end not used */