# HG changeset patch # User Dennis Concepción Martín # Date 1627042768 -3600 # Node ID f76d0e26c178673fe3cf68cddf79e751003c17e4 # Parent c52966834f8326c406524ecaf2776e3059bd204d Add localisation diff -r c52966834f83 -r f76d0e26c178 Localisation/en.xcloc/Localized Contents/en.xliff --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Localisation/en.xcloc/Localized Contents/en.xliff Fri Jul 23 13:19:28 2021 +0100 @@ -0,0 +1,251 @@ + + + +
+ +
+ + + Simoleon + Simoleon + Bundle display name + + + Simoleon + Simoleon + Bundle name + + +
+ +
+ +
+ + + %.2f + %.2f + No comment provided by engineer. + + + %1$@ (%2$@) + %1$@ (%2$@) + No comment provided by engineer. + + + - + - + No comment provided by engineer. + + + About + About + No comment provided by engineer. + + + All currencies + All currencies + Section header in currency selector + + + Cancel + Cancel + Button to dismiss currency selector + Button to dismiss paywall modal sheet + Button to stop editing textfield + + + Categories + Categories + Side bar navigation title + + + Contact + Contact + Button to contact in Settings + + + Convert + Convert + Navigation title + Tab bar button to show conversion + + + Convert your currency between cryptos, gold, and silver. + Convert your currency between cryptos, gold, and silver. + Subscription feature description + + + Cryptos and commodities + Cryptos and commodities + Subscription feature title + + + Currencies + Currencies + Navigation title + + + Default currency + Default currency + Label in locked picker + Picker to select default currency + + + Developer's Twitter + Developer's Twitter + Button to go to Twitter in Settings + + + Enter amount + Enter amount + No comment provided by engineer. + + + Expires at %@ + Expires at %@ + Subscriber information + + + Favourite currencies + Favourite currencies + Subscription feature title + + + Favourites + Favourites + Navigation title + Tab bar button to show favourites + + + From %1$@ to %2$@ + From %1$@ to %2$@ + Conversion from one currency to another + + + Have access to almost every currency of the world. + Have access to almost every currency of the world. + Subscription feature description + + + Information + Information + Button to show subscription information in settings + Navigation title + + + Latest purchase %@ + Latest purchase %@ + Subscriber information + + + Member since %@ + Member since %@ + Subscriber information + + + Ok + Ok + Button to dismiss alert + Button to stop searching in currency selector + Dismiss alert + + + Over 170 currencies + Over 170 currencies + Subscription feature title + + + Preferences + Preferences + Section header in settings + + + Privacy Policy + Privacy Policy + Button to go to app privacy policy + + + Rate Simoleon + Rate Simoleon + Button to rate app in Settings + + + Restore purchases + Restore purchases + Button to restore in-App purchases + + + Save your favourite currencies to access them quickly. + Save your favourite currencies to access them quickly. + Subscription feature description + + + Search ... + Search ... + No comment provided by engineer. + + + Settings + Settings + Navigation title + Tab bar button to show settings + + + Simoleon on all your devices + Simoleon on all your devices + Subscription feature title + + + Stay in touch + Stay in touch + Section header in settings + + + Subscribe + Subscribe + Button to suscribe in settings + + + Subscribe for %@ / month + Subscribe for %@ / month + Subscribe button + + + Subscription + Subscription + Section header in settings + + + Tap + Tap + First line when favourites are empty + + + USD/GBP + USD/GBP + Default currency in locked picker + + + Unlock all access + Unlock all access + Headline in Subscription paywall + + + Website + Website + Button to go to Dennis Tech website + + + Your settings and favourite currencies in all your devices. + Your settings and favourite currencies in all your devices. + Subscription feature description + + + to add a currency pair to favourites + to add a currency pair to favourites + Finish line when favourites are empty + + +
+
diff -r c52966834f83 -r f76d0e26c178 Localisation/en.xcloc/Source Contents/Simoleon/en.lproj/InfoPlist.strings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Localisation/en.xcloc/Source Contents/Simoleon/en.lproj/InfoPlist.strings Fri Jul 23 13:19:28 2021 +0100 @@ -0,0 +1,4 @@ +/* Bundle display name */ +"CFBundleDisplayName" = "Simoleon"; +/* Bundle name */ +"CFBundleName" = "Simoleon"; diff -r c52966834f83 -r f76d0e26c178 Localisation/en.xcloc/Source Contents/Simoleon/en.lproj/Localizable.strings Binary file Localisation/en.xcloc/Source Contents/Simoleon/en.lproj/Localizable.strings has changed diff -r c52966834f83 -r f76d0e26c178 Localisation/en.xcloc/Source Contents/Simoleon/es.lproj/InfoPlist.strings --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Localisation/en.xcloc/Source Contents/Simoleon/es.lproj/InfoPlist.strings Fri Jul 23 13:19:28 2021 +0100 @@ -0,0 +1,4 @@ +/* Bundle display name */ +"CFBundleDisplayName" = "Simoleon"; +/* Bundle name */ +"CFBundleName" = "Simoleon"; diff -r c52966834f83 -r f76d0e26c178 Localisation/en.xcloc/Source Contents/Simoleon/es.lproj/Localizable.strings Binary file Localisation/en.xcloc/Source Contents/Simoleon/es.lproj/Localizable.strings has changed diff -r c52966834f83 -r f76d0e26c178 Localisation/en.xcloc/contents.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Localisation/en.xcloc/contents.json Fri Jul 23 13:19:28 2021 +0100 @@ -0,0 +1,12 @@ +{ + "developmentRegion" : "en", + "project" : "Simoleon.xcodeproj", + "targetLocale" : "en", + "toolInfo" : { + "toolBuildNumber" : "12E507", + "toolID" : "com.apple.dt.xcode", + "toolName" : "Xcode", + "toolVersion" : "12.5.1" + }, + "version" : "1.0" +} \ No newline at end of file diff -r c52966834f83 -r f76d0e26c178 Simoleon.xcodeproj/project.pbxproj --- a/Simoleon.xcodeproj/project.pbxproj Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon.xcodeproj/project.pbxproj Fri Jul 23 13:19:28 2021 +0100 @@ -27,6 +27,10 @@ 95B54F4A26A4A450001DC0D8 /* ConversionBox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95B54F4926A4A450001DC0D8 /* ConversionBox.swift */; }; 95B54F4F26A4AC52001DC0D8 /* ContentViewPad.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95B54F4E26A4AC52001DC0D8 /* ContentViewPad.swift */; }; 95B54F5126A4ACAC001DC0D8 /* Sidebar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95B54F5026A4ACAC001DC0D8 /* Sidebar.swift */; }; + 95B5F53126AADE4B00BDCE89 /* en.xliff in Resources */ = {isa = PBXBuildFile; fileRef = 95B5F52826AADE4B00BDCE89 /* en.xliff */; }; + 95B5F53226AADE4B00BDCE89 /* contents.json in Resources */ = {isa = PBXBuildFile; fileRef = 95B5F52A26AADE4B00BDCE89 /* contents.json */; }; + 95B5F53326AADE4B00BDCE89 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 95B5F52D26AADE4B00BDCE89 /* Localizable.strings */; }; + 95B5F53426AADE4B00BDCE89 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 95B5F52F26AADE4B00BDCE89 /* InfoPlist.strings */; }; 95C5179126A5DC8E00BC2B24 /* ConditionalWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C5179026A5DC8E00BC2B24 /* ConditionalWrapper.swift */; }; 95C5179926A5EC9F00BC2B24 /* FavouriteButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C5179826A5EC9F00BC2B24 /* FavouriteButton.swift */; }; 95C5179C26A5EFBE00BC2B24 /* Favourite+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C5179A26A5EFBE00BC2B24 /* Favourite+CoreDataClass.swift */; }; @@ -41,7 +45,6 @@ 95C5B23F2697752700941585 /* SimoleonTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C5B23E2697752700941585 /* SimoleonTests.swift */; }; 95C5B24A2697752700941585 /* SimoleonUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95C5B2492697752700941585 /* SimoleonUITests.swift */; }; 95D8C8C726A95D2900BCC188 /* Subscription.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D8C8C626A95D2900BCC188 /* Subscription.swift */; }; - 95D8C8CB26A970F400BCC188 /* SubscriptionFeature.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D8C8CA26A970F400BCC188 /* SubscriptionFeature.swift */; }; 95D8C8CD26A9784500BCC188 /* SubscribeButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D8C8CC26A9784500BCC188 /* SubscribeButton.swift */; }; 95D8C8CF26A98A7900BCC188 /* RestoreButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D8C8CE26A98A7900BCC188 /* RestoreButton.swift */; }; 95D8C8D126A9BC6200BCC188 /* LockedCurrencyPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95D8C8D026A9BC6200BCC188 /* LockedCurrencyPicker.swift */; }; @@ -91,6 +94,12 @@ 95B54F4926A4A450001DC0D8 /* ConversionBox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConversionBox.swift; sourceTree = ""; }; 95B54F4E26A4AC52001DC0D8 /* ContentViewPad.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentViewPad.swift; sourceTree = ""; }; 95B54F5026A4ACAC001DC0D8 /* Sidebar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sidebar.swift; sourceTree = ""; }; + 95B5F52826AADE4B00BDCE89 /* en.xliff */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = en.xliff; sourceTree = ""; }; + 95B5F52A26AADE4B00BDCE89 /* contents.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = contents.json; sourceTree = ""; }; + 95B5F52E26AADE4B00BDCE89 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = ""; }; + 95B5F53026AADE4B00BDCE89 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; + 95B5F53526AADE5200BDCE89 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Localizable.strings; sourceTree = ""; }; + 95B5F53626AADE5500BDCE89 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; 95C5179026A5DC8E00BC2B24 /* ConditionalWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConditionalWrapper.swift; sourceTree = ""; }; 95C5179826A5EC9F00BC2B24 /* FavouriteButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FavouriteButton.swift; sourceTree = ""; }; 95C5179A26A5EFBE00BC2B24 /* Favourite+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Favourite+CoreDataClass.swift"; sourceTree = ""; }; @@ -111,7 +120,6 @@ 95C5B2492697752700941585 /* SimoleonUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimoleonUITests.swift; sourceTree = ""; }; 95C5B24B2697752700941585 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 95D8C8C626A95D2900BCC188 /* Subscription.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Subscription.swift; sourceTree = ""; }; - 95D8C8CA26A970F400BCC188 /* SubscriptionFeature.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscriptionFeature.swift; sourceTree = ""; }; 95D8C8CC26A9784500BCC188 /* SubscribeButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SubscribeButton.swift; sourceTree = ""; }; 95D8C8CE26A98A7900BCC188 /* RestoreButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreButton.swift; sourceTree = ""; }; 95D8C8D026A9BC6200BCC188 /* LockedCurrencyPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LockedCurrencyPicker.swift; sourceTree = ""; }; @@ -192,11 +200,63 @@ path = Tests; sourceTree = ""; }; + 95B5F52526AADE4B00BDCE89 /* Localisation */ = { + isa = PBXGroup; + children = ( + 95B5F52626AADE4B00BDCE89 /* en.xcloc */, + ); + path = Localisation; + sourceTree = ""; + }; + 95B5F52626AADE4B00BDCE89 /* en.xcloc */ = { + isa = PBXGroup; + children = ( + 95B5F52726AADE4B00BDCE89 /* Localized Contents */, + 95B5F52926AADE4B00BDCE89 /* Notes */, + 95B5F52A26AADE4B00BDCE89 /* contents.json */, + 95B5F52B26AADE4B00BDCE89 /* Source Contents */, + ); + path = en.xcloc; + sourceTree = ""; + }; + 95B5F52726AADE4B00BDCE89 /* Localized Contents */ = { + isa = PBXGroup; + children = ( + 95B5F52826AADE4B00BDCE89 /* en.xliff */, + ); + path = "Localized Contents"; + sourceTree = ""; + }; + 95B5F52926AADE4B00BDCE89 /* Notes */ = { + isa = PBXGroup; + children = ( + ); + path = Notes; + sourceTree = ""; + }; + 95B5F52B26AADE4B00BDCE89 /* Source Contents */ = { + isa = PBXGroup; + children = ( + 95B5F52C26AADE4B00BDCE89 /* Simoleon */, + ); + path = "Source Contents"; + sourceTree = ""; + }; + 95B5F52C26AADE4B00BDCE89 /* Simoleon */ = { + isa = PBXGroup; + children = ( + 95B5F52D26AADE4B00BDCE89 /* Localizable.strings */, + 95B5F52F26AADE4B00BDCE89 /* InfoPlist.strings */, + ); + path = Simoleon; + sourceTree = ""; + }; 95C5B21B2697752600941585 = { isa = PBXGroup; children = ( 9585BB1026A6B5ED00E3193E /* ConfigTemplate.xcconfig */, 9585BB0F26A6B58500E3193E /* Config.xcconfig */, + 95B5F52526AADE4B00BDCE89 /* Localisation */, 95C5B2262697752600941585 /* Simoleon */, 95C5B23D2697752700941585 /* SimoleonTests */, 95C5B2482697752700941585 /* SimoleonUITests */, @@ -286,7 +346,6 @@ 95C5179026A5DC8E00BC2B24 /* ConditionalWrapper.swift */, 95C5179826A5EC9F00BC2B24 /* FavouriteButton.swift */, 95C517A026A5F6C000BC2B24 /* ResignKeyboard.swift */, - 95D8C8CA26A970F400BCC188 /* SubscriptionFeature.swift */, 95D8C8CC26A9784500BCC188 /* SubscribeButton.swift */, 95D8C8CE26A98A7900BCC188 /* RestoreButton.swift */, 95D8C8D026A9BC6200BCC188 /* LockedCurrencyPicker.swift */, @@ -383,6 +442,7 @@ hasScannedForEncodings = 0; knownRegions = ( en, + es, Base, ); mainGroup = 95C5B21B2697752600941585; @@ -409,6 +469,10 @@ 95C5B22F2697752700941585 /* Preview Assets.xcassets in Resources */, 95E76436269DFC1A008E9F31 /* LaunchScreen.storyboard in Resources */, 9555933D269B0E0A000FD726 /* CurrencyMetadata.json in Resources */, + 95B5F53126AADE4B00BDCE89 /* en.xliff in Resources */, + 95B5F53326AADE4B00BDCE89 /* Localizable.strings in Resources */, + 95B5F53226AADE4B00BDCE89 /* contents.json in Resources */, + 95B5F53426AADE4B00BDCE89 /* InfoPlist.strings in Resources */, 95C5B22C2697752700941585 /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -440,7 +504,6 @@ 950A377826A820F800CAB175 /* DefaultCurrency+CoreDataClass.swift in Sources */, 95C5B2312697752700941585 /* Persistence.swift in Sources */, 9585BB1226A6B71B00E3193E /* ReadConfig.swift in Sources */, - 95D8C8CB26A970F400BCC188 /* SubscriptionFeature.swift in Sources */, 95AEBC9526A03ECB00613729 /* ContentView.swift in Sources */, 95AEBC9B26A04A4200613729 /* CurrencyMetadataModel.swift in Sources */, 95D8C8D526A9E20F00BCC188 /* SubscriberInfo.swift in Sources */, @@ -501,6 +564,27 @@ }; /* End PBXTargetDependency section */ +/* Begin PBXVariantGroup section */ + 95B5F52D26AADE4B00BDCE89 /* Localizable.strings */ = { + isa = PBXVariantGroup; + children = ( + 95B5F52E26AADE4B00BDCE89 /* en */, + 95B5F53526AADE5200BDCE89 /* es */, + ); + name = Localizable.strings; + sourceTree = ""; + }; + 95B5F52F26AADE4B00BDCE89 /* InfoPlist.strings */ = { + isa = PBXVariantGroup; + children = ( + 95B5F53026AADE4B00BDCE89 /* en */, + 95B5F53626AADE5500BDCE89 /* es */, + ); + name = InfoPlist.strings; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + /* Begin XCBuildConfiguration section */ 95C5B24C2697752700941585 /* Debug */ = { isa = XCBuildConfiguration; @@ -629,7 +713,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Simoleon/Simoleon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_ASSET_PATHS = "\"Simoleon/Preview Content\""; DEVELOPMENT_TEAM = MTX83R5H8X; ENABLE_PREVIEWS = YES; @@ -654,7 +738,7 @@ ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_ENTITLEMENTS = Simoleon/Simoleon.entitlements; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 5; + CURRENT_PROJECT_VERSION = 6; DEVELOPMENT_ASSET_PATHS = "\"Simoleon/Preview Content\""; DEVELOPMENT_TEAM = MTX83R5H8X; ENABLE_PREVIEWS = YES; diff -r c52966834f83 -r f76d0e26c178 Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Binary file Simoleon.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed diff -r c52966834f83 -r f76d0e26c178 Simoleon/ContentView.swift --- a/Simoleon/ContentView.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/ContentView.swift Fri Jul 23 13:19:28 2021 +0100 @@ -59,5 +59,6 @@ struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() + .environment(\.locale, .init(identifier: "es")) } } diff -r c52966834f83 -r f76d0e26c178 Simoleon/Conversion.swift --- a/Simoleon/Conversion.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Conversion.swift Fri Jul 23 13:19:28 2021 +0100 @@ -62,7 +62,7 @@ CurrencySelector(currencyPair: $currencyPair, showingCurrencySelector: $showingCurrencySelector) } } - .navigationTitle(Text("Conversion", comment: "Navigation title")) + .navigationTitle(Text("Convert", comment: "Navigation title")) .toolbar { ToolbarItem(placement: .cancellationAction) { if isEditing { diff -r c52966834f83 -r f76d0e26c178 Simoleon/Favourites.swift --- a/Simoleon/Favourites.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Favourites.swift Fri Jul 23 13:19:28 2021 +0100 @@ -32,6 +32,7 @@ } .onDelete(perform: removeFromFavourites) } + .listStyle(PlainListStyle()) } } .navigationTitle(Text("Favourites", comment: "Navigation title")) diff -r c52966834f83 -r f76d0e26c178 Simoleon/Helpers/RestoreButton.swift --- a/Simoleon/Helpers/RestoreButton.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Helpers/RestoreButton.swift Fri Jul 23 13:19:28 2021 +0100 @@ -12,9 +12,9 @@ @Binding var showingSubscriptionPaywall: Bool @EnvironmentObject var subscriptionController: SubscriptionController + @State private var alertTitle: LocalizedStringKey = "" + @State private var alertMessage: LocalizedStringKey = "" @State private var restoringPurchases = false - @State private var alertTitle = Text("") - @State private var alertMessage = Text("") @State private var showingAlert = false var body: some View { @@ -26,7 +26,7 @@ } } .alert(isPresented: $showingAlert) { - Alert(title: alertTitle, message: alertMessage, dismissButton: .default(Text("Ok", comment: "Button to dismiss alert"))) + Alert(title: Text(alertTitle), message: Text(alertMessage), dismissButton: .default(Text("Ok", comment: "Button to dismiss alert"))) } } @@ -38,15 +38,15 @@ subscriptionController.isActive = true showingSubscriptionPaywall = false } else { - alertTitle = Text("No subscriptions found", comment: "Alert title") - alertMessage = Text("You are not subscripted to Simoleon yet.", comment: "Alert message") + alertTitle = LocalizedStringKey("No subscriptions found") + alertMessage = LocalizedStringKey("You are not subscripted to Simoleon yet.") restoringPurchases = false showingAlert = true } if let error = error as NSError? { - alertTitle = Text(error.localizedDescription) - alertMessage = Text(error.localizedFailureReason ?? "If the problem persists send an email to dmartin@dennistech.io") + alertTitle = LocalizedStringKey(error.localizedDescription) + alertMessage = LocalizedStringKey(error.localizedFailureReason ?? "") showingAlert = true } } diff -r c52966834f83 -r f76d0e26c178 Simoleon/Helpers/SubscribeButton.swift --- a/Simoleon/Helpers/SubscribeButton.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Helpers/SubscribeButton.swift Fri Jul 23 13:19:28 2021 +0100 @@ -12,11 +12,11 @@ @Binding var showingSubscriptionPaywall: Bool @EnvironmentObject var subscriptionController: SubscriptionController - @State private var subscribeButtonText = "" - @State private var showingPrice = false + @State private var price = "" @State private var alertTitle = "" @State private var alertMessage = "" @State private var showingAlert = false + @State private var showingPrice = false var body: some View { Button(action: purchaseMonthlySubscription) { @@ -25,7 +25,7 @@ .overlay( VStack { if showingPrice { - Text(subscribeButtonText) + Text("Subscribe for \(price) / month", comment: "Subscribe button") .foregroundColor(.white) .fontWeight(.semibold) } else { @@ -43,15 +43,14 @@ private func fetchMonthlySubscription() { Purchases.shared.offerings { (offerings, error) in if let product = offerings?.current?.monthly?.product { - let price = formatCurrency(product.priceLocale, product.price) - subscribeButtonText = "Subscribe for \(price) / month" + self.price = formatCurrency(product.priceLocale, product.price) showingPrice = true } if let error = error as NSError? { alertTitle = error.localizedDescription - alertMessage = error.localizedFailureReason ?? "If the problem persists send an email to dmartin@dennistech.io" - subscribeButtonText = "-" + alertMessage = error.localizedFailureReason ?? "" + price = "-" showingPrice = true showingAlert = true } @@ -73,7 +72,7 @@ if let error = error as NSError? { alertTitle = error.localizedDescription - alertMessage = error.localizedFailureReason ?? "If the problem persists send an email to dmartin@dennistech.io" + alertMessage = error.localizedFailureReason ?? "" showingPrice = true showingAlert = true } @@ -81,7 +80,7 @@ if let error = error as NSError? { alertTitle = error.localizedDescription - alertMessage = error.localizedFailureReason ?? "If the problem persists send an email to dmartin@dennistech.io" + alertMessage = error.localizedFailureReason ?? "" showingPrice = true showingAlert = true } diff -r c52966834f83 -r f76d0e26c178 Simoleon/Helpers/SubscriberInfo.swift --- a/Simoleon/Helpers/SubscriberInfo.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Helpers/SubscriberInfo.swift Fri Jul 23 13:19:28 2021 +0100 @@ -13,8 +13,8 @@ @State private var expiration: Date? = nil @State private var latestPurchase: Date? = nil @State private var showingAlert = false - @State private var alertTitle = Text("") - @State private var alertMessage = Text("") + @State private var alertTitle = "" + @State private var alertMessage = "" var body: some View { VStack { @@ -42,7 +42,7 @@ .navigationTitle(Text("Information", comment: "Navigation title")) .onAppear(perform: getInfo) .alert(isPresented: $showingAlert) { - Alert(title: alertTitle, message: alertMessage, dismissButton: .default(Text("Ok", comment: "Dismiss alert"))) + Alert(title: Text(alertTitle), message: Text(alertMessage), dismissButton: .default(Text("Ok", comment: "Dismiss alert"))) } } @@ -53,8 +53,8 @@ self.latestPurchase = purchaserInfo?.entitlements["all"]?.latestPurchaseDate if let error = error as NSError? { - alertTitle = Text(error.localizedDescription) - alertMessage = Text(error.localizedFailureReason ?? "If the problem persists send an email to dmartin@dennistech.io") + alertTitle = error.localizedDescription + alertMessage = error.localizedFailureReason ?? "" showingAlert = true } } diff -r c52966834f83 -r f76d0e26c178 Simoleon/Helpers/SubscriptionFeature.swift --- a/Simoleon/Helpers/SubscriptionFeature.swift Thu Jul 22 22:30:54 2021 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ -// -// SubscriptionFeature.swift -// Simoleon -// -// Created by Dennis Concepción Martín on 22/07/2021. -// - -import SwiftUI - -struct SubscriptionFeature: View { - var symbol: String - var title: LocalizedStringKey - var text: LocalizedStringKey - var colour: Color - - var body: some View { - HStack(alignment:.top) { - Image(systemName: symbol) - .foregroundColor(colour) - .font(.title) - - VStack(alignment: .leading) { - Text(title, comment: "Title of subscription feature") - .font(.headline) - - Text(text, comment: "Description of subscription feature") - } - } - } -} - -struct SubscriptionFeature_Previews: PreviewProvider { - static var previews: some View { - SubscriptionFeature( - symbol: "star.circle.fill", - title: "Favourite currencies", - text: "Save your favourite currencies to access them quickly.", - colour: Color(.systemYellow) - ) - } -} diff -r c52966834f83 -r f76d0e26c178 Simoleon/Info.plist --- a/Simoleon/Info.plist Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Info.plist Fri Jul 23 13:19:28 2021 +0100 @@ -2,8 +2,6 @@ - PURCHASES_KEY - $(PURCHASES_KEY) API_KEY $(API_KEY) API_URL @@ -28,6 +26,8 @@ $(CURRENT_PROJECT_VERSION) LSRequiresIPhoneOS + PURCHASES_KEY + $(PURCHASES_KEY) UIApplicationSceneManifest UIApplicationSupportsMultipleScenes diff -r c52966834f83 -r f76d0e26c178 Simoleon/Subscription.swift --- a/Simoleon/Subscription.swift Thu Jul 22 22:30:54 2021 +0100 +++ b/Simoleon/Subscription.swift Fri Jul 23 13:19:28 2021 +0100 @@ -34,33 +34,58 @@ Divider() - SubscriptionFeature( - symbol: "star.circle.fill", - title: "Favourite currencies", - text: "Save your favourite currencies to access them quickly.", - colour: Color(.systemYellow) - ) + HStack(alignment:.top) { + Image(systemName: "star.circle.fill") + .foregroundColor(Color(.systemYellow)) + .font(.title) + + VStack(alignment: .leading) { + Text("Favourite currencies", comment: "Subscription feature title") + .font(.headline) + + Text("Save your favourite currencies to access them quickly.", comment: "Subscription feature description") + } + } - SubscriptionFeature( - symbol: "flag.circle.fill", - title: "Over 170 currencies", - text: "Have access to almost every currency of the world.", - colour: Color(.systemRed) - ) + HStack(alignment:.top) { + Image(systemName: "flag.circle.fill") + .foregroundColor(Color(.systemRed)) + .font(.title) + + VStack(alignment: .leading) { + Text("Over 170 currencies", comment: "Subscription feature title") + .font(.headline) + + Text("Have access to almost every currency of the world.", comment: "Subscription feature description") + } + } - SubscriptionFeature( - symbol: "icloud.circle.fill", - title: "Simoleon on all your devices", - text: "Your settings and favourite currencies in all your devices.", - colour: Color(.systemBlue) - ) + HStack(alignment:.top) { + Image(systemName: "icloud.circle.fill") + .foregroundColor(Color(.systemBlue)) + .font(.title) + + VStack(alignment: .leading) { + Text("Simoleon on all your devices", comment: "Subscription feature title") + .font(.headline) + + Text("Your settings and favourite currencies in all your devices.", comment: "Subscription feature description") + } + } - SubscriptionFeature( - symbol: "bitcoinsign.circle.fill", - title: "Cryptos and commodities", - text: "Convert your currency between cryptos, gold, and silver.", - colour: Color(.systemOrange) - ) + HStack(alignment:.top) { + Image(systemName: "bitcoinsign.circle.fill") + .foregroundColor(Color(.systemOrange)) + .font(.title) + + VStack(alignment: .leading) { + Text("Cryptos and commodities", comment: "Subscription feature title") + .font(.headline) + + Text("Convert your currency between cryptos, gold, and silver.", comment: "Subscription feature description") + } + } + Spacer() SubscribeButton(showingSubscriptionPaywall: $showingSubscriptionPaywall) HStack {