Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: localized string text for 5 views #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
37 changes: 37 additions & 0 deletions NutritionNest/Constants/Localization+Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,43 @@ enum Localization {
static let account = Localization.tr("Onboarding.Account", fallback: "Have an account?")
static let login = Localization.tr("Onboarding.Login", fallback: "Log In")
}
enum ViewGender {
static let iam = Localization.tr("ViewGender.Iam", fallback: "I am...")
static let male = Localization.tr("ViewGender.Male", fallback: "Male")
static let female = Localization.tr("ViewGender.Female", fallback: "Female")
static let nonbinary = Localization.tr("ViewGender.Nonbinary", fallback: "Nonbinary")
static let next = Localization.tr("ViewGender.Next", fallback: "Next")
static let skip = Localization.tr("ViewGender.Skip", fallback: "Skip")
}
enum ViewGoal {
static let mygoal = Localization.tr("ViewGoal.Mygoal", fallback: "My goals are...")
static let muloptions = Localization.tr("ViewGoal.Muloptions", fallback: "You may select multiple options")
static let maintainweight = Localization.tr("ViewGoal.Maintainweight", fallback: "Maintain weight")
static let gainweight = Localization.tr("ViewGoal.Gainweight", fallback: "Gain weight")
static let loseweight = Localization.tr("ViewGoal.Loseweight", fallback: "Lose weight")
static let comment = Localization.tr("ViewGoal.Comment", fallback: "Comment")
static let next = Localization.tr("ViewGoal.Next", fallback: "Next")
static let skip = Localization.tr("ViewGoal.Skip", fallback: "Skip")
}
enum ViewBirthday {
static let birthday = Localization.tr("ViewBirthday.Birthday", fallback: "What is your Birthdate?")
static let next = Localization.tr("ViewBirthday.Next", fallback: "Next")
static let skip = Localization.tr("ViewBirthday.Skip", fallback: "Skip")
}
enum ViewWeight {
static let weight = Localization.tr("ViewWeight.Weight", fallback: "What is your current weight?")
static let next = Localization.tr("ViewWeight.Next", fallback: "Next")
static let skip = Localization.tr("ViewWeight.Skip", fallback: "Skip")
}
enum ViewStatus {
static let status = Localization.tr("ViewStatus.Status", fallback: "How active are you?")
static let notactive = Localization.tr("ViewStatus.Notactive", fallback: "Not active")
static let lightlyactive = Localization.tr("ViewStatus.Lightlyactive", fallback: "Lightly active")
static let active = Localization.tr("ViewStatus.Active", fallback: "Active")
static let comment = Localization.tr("ViewStatus.Comment", fallback: "Comment")
static let next = Localization.tr("ViewStatus.Next", fallback: "Next")
static let skip = Localization.tr("ViewStatus.Skip", fallback: "Skip")
}
enum SignUp {
static let title = Localization.tr("SignUp.Title", fallback: "NutritionNest")
static let message = Localization.tr("SignUp.Message", fallback: "Our AI friend is excited to assist you on your health journey!")
Expand Down
8 changes: 3 additions & 5 deletions NutritionNest/Views/Onboarding/ViewBirthday.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct ViewBirthday: View {
}
}.padding(.top, -10)

Text("What is your Birthdate?").font(.custom("Inter", size: 26)).padding(.top, 25)
Text(Localization.ViewBirthday.birthday).font(CustomFonts.inter.font(size: 26)).padding(.top, 25)

ZStack {
RoundedRectangle(cornerRadius: 20).fill(Color.blue).frame(width: 310, height: 35)
Expand Down Expand Up @@ -107,8 +107,7 @@ struct ViewBirthday: View {

} label: {

Text("Next")
.font(.custom("Inter", size: 25)).bold()
Text(Localization.ViewBirthday.next).font(CustomFonts.inter.font(size: 25)).bold()
.padding(EdgeInsets(top: 20, leading: 140, bottom: 20, trailing: 140))
.background(Color.accentColor)
.foregroundColor(.white)
Expand All @@ -120,8 +119,7 @@ struct ViewBirthday: View {

} label: {

Text("Skip")
.font(.custom("Inter", size: 18)).bold()
Text(Localization.ViewBirthday.skip).font(CustomFonts.inter.font(size: 18)).bold()
.padding(.top, 25)

}
Expand Down
19 changes: 6 additions & 13 deletions NutritionNest/Views/Onboarding/ViewGender.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ struct ViewGender: View {
}
}.padding(.top, 30)

Text("I am...").font(.custom("Inter", size: 26)).padding()

Text(Localization.ViewGender.iam).font(CustomFonts.inter.font(size: 26)).padding()
Button {
if selectedGender == "Male" {
selectedGender = nil
Expand All @@ -64,9 +63,7 @@ struct ViewGender: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Male")
.font(.custom("Inter", size: 18))
.frame(width: 250, height: 85)
Text(Localization.ViewGender.male).font(CustomFonts.inter.font(size: 18)).frame(width: 250, height: 85)
.foregroundColor(selectedGender == "Male" ? .white : .black)
}
}.padding(.top, 60)
Expand All @@ -87,8 +84,7 @@ struct ViewGender: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Female")
.font(.custom("Inter", size: 18))
Text(Localization.ViewGender.female).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedGender == "Female" ? .white : .black)
}
Expand All @@ -110,8 +106,7 @@ struct ViewGender: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Nonbinary")
.font(.custom("Inter", size: 18))
Text(Localization.ViewGender.nonbinary).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedGender == "Nonbinary" ? .white : .black)
}
Expand All @@ -121,8 +116,7 @@ struct ViewGender: View {

} label: {

Text("Next")
.font(.custom("Inter", size: 25)).bold()
Text(Localization.ViewGender.next).font(CustomFonts.inter.font(size: 25)).bold()
.padding(EdgeInsets(top: 20, leading: 140, bottom: 20, trailing: 140))
.background(Color.accentColor)
.foregroundColor(.white)
Expand All @@ -134,8 +128,7 @@ struct ViewGender: View {

} label: {

Text("Skip")
.font(.custom("Inter", size: 18)).bold()
Text(Localization.ViewGender.skip).font(CustomFonts.inter.font(size: 18)).bold()
.padding(.top, 25)

}
Expand Down
24 changes: 9 additions & 15 deletions NutritionNest/Views/Onboarding/ViewGoal.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ struct ViewGoal: View {
}
}.padding(.top, 30)

Text("My goals are...").font(.custom("Inter", size: 30)).padding()
Text("You may select multiple options").font(.custom("Inter", size: 18)).foregroundColor(.gray)
Text(Localization.ViewGoal.mygoal).font(CustomFonts.inter.font(size: 30)).padding()

Text(Localization.ViewGoal.muloptions).font(CustomFonts.inter.font(size: 18)).foregroundColor(.gray)
.padding(.top, -10)

Button {
if selectedGoal == "Maintain weight" {
selectedGoal = nil
Expand All @@ -68,8 +68,7 @@ struct ViewGoal: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Maintain weight")
.font(.custom("Inter", size: 18))
Text(Localization.ViewGoal.maintainweight).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedGoal == "Maintain weight" ? .white : .black)
}
Expand All @@ -91,8 +90,7 @@ struct ViewGoal: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Gain weight")
.font(.custom("Inter", size: 18))
Text(Localization.ViewGoal.gainweight).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedGoal == "Gain weight" ? .white : .black)
}
Expand All @@ -114,8 +112,7 @@ struct ViewGoal: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Lose weight")
.font(.custom("Inter", size: 18))
Text(Localization.ViewGoal.loseweight).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedGoal == "Lose weight" ? .white : .black)
}
Expand All @@ -127,8 +124,7 @@ struct ViewGoal: View {
.stroke(Color.gray, lineWidth: 1)
.frame(width: 250, height: 120)

Text("Comment")
.font(.custom("Inter", size: 18))
Text(Localization.ViewGoal.comment).font(CustomFonts.inter.font(size: 18))
.foregroundColor(.black)
.offset(x: 20, y: 20)
}
Expand All @@ -147,8 +143,7 @@ struct ViewGoal: View {

} label: {

Text("Next")
.font(.custom("Inter", size: 25)).bold()
Text(Localization.ViewGoal.next).font(CustomFonts.inter.font(size: 25)).bold()
.padding(EdgeInsets(top: 20, leading: 140, bottom: 20, trailing: 140))
.background(Color.accentColor)
.foregroundColor(.white)
Expand All @@ -160,8 +155,7 @@ struct ViewGoal: View {

} label: {

Text("Skip")
.font(.custom("Inter", size: 18)).bold()
Text(Localization.ViewGoal.skip).font(CustomFonts.inter.font(size: 18)).bold()
.padding(.top, 25)

}
Expand Down
20 changes: 7 additions & 13 deletions NutritionNest/Views/Onboarding/ViewStatus.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ViewStatus: View {
}
}.padding(.top, 30)

Text("How active are you?").font(.custom("Inter", size: 30)).padding()
Text(Localization.ViewStatus.status).font(CustomFonts.inter.font(size: 30)).padding()

Button {
if selectedStatus == "Not active" {
Expand All @@ -66,8 +66,7 @@ struct ViewStatus: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Not active")
.font(.custom("Inter", size: 18))
Text(Localization.ViewStatus.notactive).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedStatus == "Not active" ? .white : .black)
}
Expand All @@ -89,8 +88,7 @@ struct ViewStatus: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Lightly active")
.font(.custom("Inter", size: 18))
Text(Localization.ViewStatus.lightlyactive).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedStatus == "Lightly active" ? .white : .black)
}
Expand All @@ -112,8 +110,7 @@ struct ViewStatus: View {
.stroke(Color.gray, lineWidth: 1)
)

Text("Active")
.font(.custom("Inter", size: 18))
Text(Localization.ViewStatus.active).font(CustomFonts.inter.font(size: 18))
.frame(width: 250, height: 85)
.foregroundColor(selectedStatus == "Active" ? .white : .black)
}
Expand All @@ -125,8 +122,7 @@ struct ViewStatus: View {
.stroke(Color.gray, lineWidth: 1)
.frame(width: 250, height: 120)

Text("Comment")
.font(.custom("Inter", size: 18))
Text(Localization.ViewStatus.comment).font(CustomFonts.inter.font(size: 18))
.foregroundColor(.black)
.offset(x: 20, y: 20)
}
Expand All @@ -146,8 +142,7 @@ struct ViewStatus: View {

} label: {

Text("Next")
.font(.custom("Inter", size: 25)).bold()
Text(Localization.ViewStatus.next).font(CustomFonts.inter.font(size: 25)).bold()
.padding(EdgeInsets(top: 20, leading: 140, bottom: 20, trailing: 140))
.background(Color.accentColor)
.foregroundColor(.white)
Expand All @@ -159,8 +154,7 @@ struct ViewStatus: View {

} label: {

Text("Skip")
.font(.custom("Inter", size: 18)).bold()
Text(Localization.ViewStatus.skip).font(CustomFonts.inter.font(size: 18)).bold()
.padding(.top, 15)

}
Expand Down
8 changes: 3 additions & 5 deletions NutritionNest/Views/Onboarding/ViewWeight.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct ViewWeight: View {
}
}.padding(.top, -10)

Text("What is your current weight?").font(.custom("Inter", size: 25)).padding(.top, 25)
Text(Localization.ViewWeight.weight).font(CustomFonts.inter.font(size: 25)).padding(.top, 25)

ZStack {
RoundedRectangle(cornerRadius: 20).fill(Color.blue).frame(width: 310, height: 35)
Expand Down Expand Up @@ -108,8 +108,7 @@ struct ViewWeight: View {

} label: {

Text("Next")
.font(.custom("Inter", size: 25)).bold()
Text(Localization.ViewWeight.next).font(CustomFonts.inter.font(size: 25)).bold()
.padding(EdgeInsets(top: 20, leading: 140, bottom: 20, trailing: 140))
.background(Color.accentColor)
.foregroundColor(.white)
Expand All @@ -121,8 +120,7 @@ struct ViewWeight: View {

} label: {

Text("Skip")
.font(.custom("Inter", size: 18)).bold()
Text(Localization.ViewWeight.skip).font(CustomFonts.inter.font(size: 18)).bold()
.padding(.top, 25)

}
Expand Down