Mercurial > public > simoleon
comparison Simoleon/Settings.swift @ 29:c52966834f83
Add localised strings
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Thu, 22 Jul 2021 22:30:54 +0100 |
parents | 4f862c618b44 |
children | 41a905e591e4 |
comparison
equal
deleted
inserted
replaced
28:4f862c618b44 | 29:c52966834f83 |
---|---|
18 | 18 |
19 let currencyPairs: [String] = parseJson("CurrencyPairs.json") | 19 let currencyPairs: [String] = parseJson("CurrencyPairs.json") |
20 | 20 |
21 var body: some View { | 21 var body: some View { |
22 List { | 22 List { |
23 Section(header: Text("Subscription")) { | 23 Section(header: Text("Subscription", comment: "Section header in settings")) { |
24 NavigationLink("Information", destination: SubscriberInfo()) | 24 if subscriptionController.isActive { |
25 if !subscriptionController.isActive { | 25 NavigationLink(destination: SubscriberInfo()) { |
26 Text("Subscribe") | 26 Text("Information", comment: "Button to show subscription information in settings") |
27 } | |
28 } else { | |
29 Text("Subscribe", comment: "Button to suscribe in settings") | |
27 .onTapGesture { showingSubscriptionPaywall = true } | 30 .onTapGesture { showingSubscriptionPaywall = true } |
28 } | 31 } |
29 } | 32 } |
30 | 33 |
31 Section(header: Text("Preferences")) { | 34 Section(header: Text("Preferences", comment: "Section header in settings")) { |
32 if subscriptionController.isActive { | 35 if subscriptionController.isActive { |
33 Picker("Default currency", selection: $selectedDefaultCurrency) { | 36 Picker(selection: $selectedDefaultCurrency, label: Text("Default currency", comment: "Picker to select default currency"), content: { |
34 ForEach(currencyPairs.sorted(), id: \.self) { currencyPair in | 37 ForEach(currencyPairs.sorted(), id: \.self) { currencyPair in |
35 Text(currencyPair) | 38 Text(currencyPair) |
36 } | 39 } |
37 } | 40 }) |
38 } else { | 41 } else { |
39 LockedCurrencyPicker() | 42 LockedCurrencyPicker() |
40 .contentShape(Rectangle()) | 43 .contentShape(Rectangle()) |
41 .onTapGesture { showingSubscriptionPaywall = true } | 44 .onTapGesture { showingSubscriptionPaywall = true } |
42 } | 45 } |
43 } | 46 } |
44 | 47 |
45 Section(header: Text("Stay in touch")) { | 48 Section(header: Text("Stay in touch", comment: "Section header in settings")) { |
46 Link(destination: URL(string: "https://itunes.apple.com/app/id1576390953?action=write-review")!) { | 49 Link(destination: URL(string: "https://itunes.apple.com/app/id1576390953?action=write-review")!) { |
47 HStack { | 50 HStack { |
48 Image(systemName: "heart.fill") | 51 Image(systemName: "heart.fill") |
49 .foregroundColor(Color(.systemRed)) | 52 .foregroundColor(Color(.systemRed)) |
50 .imageScale(.large) | 53 .imageScale(.large) |
51 | 54 |
52 Text("Rate Simoleon") | 55 Text("Rate Simoleon", comment: "Button to rate app in Settings") |
53 } | 56 } |
54 } | 57 } |
55 | 58 |
56 Link(destination: URL(string: "https://twitter.com/dennisconcep")!) { | 59 Link(destination: URL(string: "https://twitter.com/dennisconcep")!) { |
57 HStack { | 60 HStack { |
58 Image("TwitterLogo") | 61 Image("TwitterLogo") |
59 .resizable() | 62 .resizable() |
60 .frame(width: 30, height: 30) | 63 .frame(width: 30, height: 30) |
61 | 64 |
62 Text("Developer's Twitter") | 65 Text("Developer's Twitter", comment: "Button to go to Twitter in Settings") |
63 } | 66 } |
64 } | 67 } |
65 | 68 |
66 Link(destination: URL(string: "https://dennistech.io/contact")!) { | 69 Link(destination: URL(string: "https://dennistech.io/contact")!) { |
67 HStack { | 70 HStack { |
68 Image(systemName: "envelope.circle.fill") | 71 Image(systemName: "envelope.circle.fill") |
69 .renderingMode(.original) | 72 .renderingMode(.original) |
70 .imageScale(.large) | 73 .imageScale(.large) |
71 | 74 |
72 Text("Contact") | 75 Text("Contact", comment: "Button to contact in Settings") |
73 } | 76 } |
74 } | 77 } |
75 } | 78 } |
76 | 79 |
77 Section(header: Text("About")) { | 80 Section(header: Text("About")) { |
78 Link("Website", destination: URL(string: "https://dennistech.io")!) | 81 Link(destination: URL(string: "https://dennistech.io")!) { |
79 Link("Privacy Policy", destination: URL(string: "https://dennistech.io")!) | 82 Text("Website", comment: "Button to go to Dennis Tech website") |
83 } | |
84 | |
85 Link(destination: URL(string: "https://dennistech.io")!) { | |
86 Text("Privacy Policy", comment: "Button to go to app privacy policy") | |
87 } | |
80 } | 88 } |
81 } | 89 } |
82 .onAppear(perform: onAppear) | 90 .onAppear(perform: onAppear) |
83 .listStyle(InsetGroupedListStyle()) | 91 .listStyle(InsetGroupedListStyle()) |
84 .navigationTitle("Settings") | 92 .navigationTitle(Text("Settings", comment: "Navigation title")) |
85 .sheet(isPresented: $showingSubscriptionPaywall) { | 93 .sheet(isPresented: $showingSubscriptionPaywall) { |
86 Subscription(showingSubscriptionPaywall: $showingSubscriptionPaywall) | 94 Subscription(showingSubscriptionPaywall: $showingSubscriptionPaywall) |
87 .environmentObject(subscriptionController) | 95 .environmentObject(subscriptionController) |
88 } | 96 } |
89 .if(UIDevice.current.userInterfaceIdiom == .phone) { content in | 97 .if(UIDevice.current.userInterfaceIdiom == .phone) { content in |