localize main app
This commit is contained in:
@@ -19,17 +19,17 @@ enum Mood: Int {
|
||||
var strValue: String {
|
||||
switch self {
|
||||
case .horrible:
|
||||
return "Horrible"
|
||||
return String(localized: "mood_value_horrible")
|
||||
case .bad:
|
||||
return "Bad"
|
||||
return String(localized: "mood_value_bad")
|
||||
case .average:
|
||||
return "Average"
|
||||
return String(localized: "mood_value_average")
|
||||
case .good:
|
||||
return "Good"
|
||||
return String(localized: "mood_value_good")
|
||||
case .great:
|
||||
return "Great"
|
||||
return String(localized: "mood_value_great")
|
||||
case .missing:
|
||||
return "Missing"
|
||||
return String(localized: "mood_value_missing")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,9 +7,19 @@
|
||||
|
||||
import SwiftUI
|
||||
|
||||
enum DayOptions: String, CaseIterable, RawRepresentable, Codable {
|
||||
case Today = "Same Day"
|
||||
case Previous = "Previous Day"
|
||||
enum DayOptions: Int, CaseIterable, RawRepresentable, Codable {
|
||||
case Today
|
||||
case Previous
|
||||
|
||||
var localizedValue: String {
|
||||
switch self {
|
||||
|
||||
case .Today:
|
||||
return String(localized: "onboarding_day_options_today")
|
||||
case .Previous:
|
||||
return String(localized: "onboarding_day_options_yesterday")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct OnboardingDay: View {
|
||||
@@ -18,9 +28,9 @@ struct OnboardingDay: View {
|
||||
var previewText: String {
|
||||
switch onboardingData.inputDay {
|
||||
case .Today:
|
||||
return "Example: If you pick on a Tuesday, the value will be recorded for Tuesday"
|
||||
return String(localized: "onboarding_day_preview_text_today")
|
||||
case .Previous:
|
||||
return "Example: If you pick on a Tuesday, the value will be recorded for Monday, the day before"
|
||||
return String(localized: "onboarding_day_preview_text_yesterday")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +45,7 @@ struct OnboardingDay: View {
|
||||
|
||||
ScrollView {
|
||||
VStack{
|
||||
Text("Will this rating be for current day or previous day")
|
||||
Text(String(localized: "onboarding_day_title"))
|
||||
.font(.title)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.trailing, .leading], 55)
|
||||
@@ -44,7 +54,7 @@ struct OnboardingDay: View {
|
||||
Picker(selection: $onboardingData.inputDay,
|
||||
label: Text("")) {
|
||||
ForEach(DayOptions.allCases, id: \.self) { day in
|
||||
Text(day.rawValue)
|
||||
Text(day.localizedValue)
|
||||
}
|
||||
}
|
||||
.padding()
|
||||
@@ -52,7 +62,7 @@ struct OnboardingDay: View {
|
||||
.padding([.trailing, .leading], 55)
|
||||
.pickerStyle(SegmentedPickerStyle())
|
||||
|
||||
Text("When you vote your vote will be for the \(onboardingData.inputDay.rawValue)")
|
||||
Text(String(localized: "onboarding_day_body"))
|
||||
.font(.body)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.trailing, .leading], 75)
|
||||
|
||||
@@ -26,7 +26,7 @@ struct OnboardingTime: View {
|
||||
|
||||
ScrollView {
|
||||
VStack {
|
||||
Text("What time do you want to unlock your rating")
|
||||
Text(String(localized: "onboarding_time_title"))
|
||||
.font(.title)
|
||||
.padding([.trailing, .leading], 55)
|
||||
.padding([.top], 25)
|
||||
@@ -41,7 +41,8 @@ struct OnboardingTime: View {
|
||||
.padding([.top, .bottom], 25)
|
||||
.colorScheme(.dark)
|
||||
|
||||
Text("Your shit will be unlocked at \(formatter.string(from: onboardingData.date)) daily")
|
||||
Text(String(format: String(localized: "onboarding_time_body"),
|
||||
formatter.string(from: onboardingData.date)))
|
||||
.font(.body)
|
||||
.padding([.top], 15)
|
||||
.padding([.trailing, .leading], 55)
|
||||
|
||||
@@ -9,9 +9,9 @@ import SwiftUI
|
||||
|
||||
struct OnboardingTitle: View {
|
||||
static let titleOptions = [
|
||||
"Its time to select.",
|
||||
"Pick your shit!",
|
||||
"How was your day?"]
|
||||
String(localized: "onboarding_title_title_option_1"),
|
||||
String(localized: "onboarding_title_title_option_2"),
|
||||
String(localized: "onboarding_title_title_option_3")]
|
||||
|
||||
@ObservedObject var onboardingData: OnboardingData
|
||||
|
||||
@@ -26,7 +26,7 @@ struct OnboardingTitle: View {
|
||||
|
||||
ScrollView {
|
||||
VStack{
|
||||
Text("What would you like the reminder to say?")
|
||||
Text(String(localized: "onboarding_title_title"))
|
||||
.font(.title)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.trailing, .leading], 55)
|
||||
@@ -48,7 +48,7 @@ struct OnboardingTitle: View {
|
||||
.padding([.top], 10)
|
||||
}
|
||||
|
||||
Text("-- or type your own--")
|
||||
Text(String(localized: "onboarding_title_type_your_own"))
|
||||
.font(.body)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.top], 25)
|
||||
|
||||
@@ -31,7 +31,7 @@ struct OnboardingWrapup: View {
|
||||
VStack {
|
||||
Spacer()
|
||||
|
||||
Text("At")
|
||||
Text(String(localized: "onboarding_wrap_up_1"))
|
||||
.font(.title)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.trailing, .leading], 55)
|
||||
@@ -44,7 +44,7 @@ struct OnboardingWrapup: View {
|
||||
.padding([.trailing, .leading], 55)
|
||||
.padding([.top], 15)
|
||||
|
||||
Text("aou will get notified that")
|
||||
Text(String(localized: "onboarding_wrap_up_2"))
|
||||
.font(.title)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.trailing, .leading], 55)
|
||||
@@ -57,13 +57,13 @@ struct OnboardingWrapup: View {
|
||||
.padding([.trailing, .leading], 55)
|
||||
.padding([.top], 15)
|
||||
|
||||
Text("and when you vote it will be counted for the")
|
||||
Text(String(localized: "onboarding_wrap_up_3"))
|
||||
.font(.title)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
.padding([.trailing, .leading], 55)
|
||||
.padding([.top], 15)
|
||||
|
||||
Text(onboardingData.inputDay.rawValue)
|
||||
Text(onboardingData.inputDay.localizedValue)
|
||||
.font(.title)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(Color(UIColor.white))
|
||||
@@ -73,7 +73,7 @@ struct OnboardingWrapup: View {
|
||||
Button(action: {
|
||||
completionClosure(onboardingData)
|
||||
}, label: {
|
||||
Text("Complete")
|
||||
Text(String(localized: "onboarding_wrap_up_complete_button"))
|
||||
.font(.title)
|
||||
.fontWeight(.bold)
|
||||
.foregroundColor(.yellow)
|
||||
|
||||
@@ -53,9 +53,9 @@ struct AddMoodHeaderView: View {
|
||||
switch savedOnboardingData.inputDay {
|
||||
|
||||
case .Today:
|
||||
return "How is today?"
|
||||
return String(localized: "add_mood_header_view_title_today")
|
||||
case .Previous:
|
||||
return "How was yesterday?"
|
||||
return String(localized: "add_mood_header_view_title_yesterday")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,17 +26,17 @@ struct ContentView: View {
|
||||
TabView {
|
||||
mainView
|
||||
.tabItem {
|
||||
Label("Main", systemImage: "list.dash")
|
||||
Label(String(localized: "content_view_tab_main"), systemImage: "list.dash")
|
||||
}
|
||||
|
||||
FilterView()
|
||||
.tabItem {
|
||||
Label("Filter", systemImage: "calendar.circle")
|
||||
Label(String(localized: "content_view_tab_filter"), systemImage: "calendar.circle")
|
||||
}
|
||||
|
||||
GraphView()
|
||||
.tabItem {
|
||||
Label("Stats", systemImage: "chart.line.uptrend.xyaxis")
|
||||
Label(String(localized: "content_view_tab_stats"), systemImage: "chart.line.uptrend.xyaxis")
|
||||
}
|
||||
}.sheet(isPresented: $needsOnboarding, onDismiss: {
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ struct FilterView: View {
|
||||
.cornerRadius(25)
|
||||
.padding([.leading, .trailing])
|
||||
|
||||
Text("Total: \(self.viewModel.numberOfRatings)")
|
||||
Text(String(localized: "filter_view_total") + ": \(self.viewModel.numberOfRatings)")
|
||||
.font(.title2)
|
||||
|
||||
if showFilter {
|
||||
@@ -71,7 +71,7 @@ struct FilterView: View {
|
||||
showFilter.toggle()
|
||||
}
|
||||
}, label: {
|
||||
Text(showFilter ? "Close Filters" : "Show Filters")
|
||||
Text(showFilter ? String(localized: "filter_view_hide_filters") : String(localized: "filter_view_show_filters"))
|
||||
.frame(maxWidth: .infinity)
|
||||
.frame(height: 44)
|
||||
.foregroundColor(Color(UIColor.label))
|
||||
@@ -117,7 +117,7 @@ struct FilterView: View {
|
||||
ZStack {
|
||||
Color(UIColor.secondarySystemBackground)
|
||||
DatePicker(
|
||||
"Start Date",
|
||||
String(localized: "filter_view_begin_date"),
|
||||
selection: $viewModel.entryStartDate,
|
||||
displayedComponents: [.date]
|
||||
).onChange(of: viewModel.entryStartDate, perform: { value in
|
||||
@@ -132,7 +132,7 @@ struct FilterView: View {
|
||||
ZStack {
|
||||
Color(UIColor.secondarySystemBackground)
|
||||
DatePicker(
|
||||
"End Date",
|
||||
String(localized: "filter_view_end_date"),
|
||||
selection: $viewModel.entryEndDate,
|
||||
displayedComponents: [.date]
|
||||
).onChange(of: viewModel.entryStartDate, perform: { value in
|
||||
|
||||
@@ -46,7 +46,7 @@ struct SettingsView: View {
|
||||
Button(action: {
|
||||
dismiss()
|
||||
}, label: {
|
||||
Text("Exit")
|
||||
Text(String(localized: "settings_view_exit"))
|
||||
.font(.body)
|
||||
.foregroundColor(Color(UIColor.systemBlue))
|
||||
})
|
||||
@@ -60,7 +60,7 @@ struct SettingsView: View {
|
||||
Button(action: {
|
||||
|
||||
}, label: {
|
||||
Text("Special thanks to")
|
||||
Text(String(localized: "settings_view_special_thanks_to"))
|
||||
})
|
||||
.padding()
|
||||
}
|
||||
@@ -102,7 +102,7 @@ struct SettingsView: View {
|
||||
private var whyBackgroundMode: some View {
|
||||
ZStack {
|
||||
Color(UIColor.systemBackground)
|
||||
Text("we do bg mode b/c we can")
|
||||
Text(String(localized: "settings_view_why_bg_mode"))
|
||||
.padding()
|
||||
}
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
@@ -118,7 +118,7 @@ struct SettingsView: View {
|
||||
ZStack {
|
||||
Color(UIColor.systemBackground)
|
||||
VStack {
|
||||
Text("Change Icon")
|
||||
Text(String(localized: "settings_view_change_icon"))
|
||||
HStack {
|
||||
|
||||
Button(action: {
|
||||
@@ -157,7 +157,7 @@ struct SettingsView: View {
|
||||
Button(action: {
|
||||
showOnboarding.toggle()
|
||||
}, label: {
|
||||
Text("Show Onboarding")
|
||||
Text(String(localized: "settings_view_show_onboarding"))
|
||||
})
|
||||
.padding()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user