Skip to content

Commit

Permalink
localizable with crowndin
Browse files Browse the repository at this point in the history
  • Loading branch information
xqsadness committed Sep 15, 2023
1 parent 31a62e2 commit 505b2be
Show file tree
Hide file tree
Showing 43 changed files with 111 additions and 114 deletions.
8 changes: 0 additions & 8 deletions DefaultProject.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@
DDA494552A87192D003814F1 /* congralutions.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = DDA494542A87192D003814F1 /* congralutions.mp3 */; };
DDA4945C2A871C8A003814F1 /* congralutions.json in Resources */ = {isa = PBXBuildFile; fileRef = DDA4945B2A871C8A003814F1 /* congralutions.json */; };
DDA4945E2A8721C4003814F1 /* faild.json in Resources */ = {isa = PBXBuildFile; fileRef = DDA4945D2A8721C4003814F1 /* faild.json */; };
DDA494602A8725FC003814F1 /* QuizDefault.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA4945F2A8725FC003814F1 /* QuizDefault.swift */; };
DDA494622A872DDF003814F1 /* ListeningView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDA494612A872DDF003814F1 /* ListeningView.swift */; };
DDC5F3542A85CBD90096AAA0 /* Question.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDC5F3532A85CBD90096AAA0 /* Question.swift */; };
DDCC6D692A8DC4FB0085D950 /* underline.json in Resources */ = {isa = PBXBuildFile; fileRef = DDCC6D682A8DC4FB0085D950 /* underline.json */; };
DDCC6D6C2A8DCE100085D950 /* QuestionResultWritingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCC6D6B2A8DCE100085D950 /* QuestionResultWritingView.swift */; };
DDCC6D6E2A8DCF2F0085D950 /* QuizWritingContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDCC6D6D2A8DCF2F0085D950 /* QuizWritingContentView.swift */; };
Expand Down Expand Up @@ -272,9 +270,7 @@
DDA494542A87192D003814F1 /* congralutions.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = congralutions.mp3; sourceTree = "<group>"; };
DDA4945B2A871C8A003814F1 /* congralutions.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = congralutions.json; sourceTree = "<group>"; };
DDA4945D2A8721C4003814F1 /* faild.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = faild.json; sourceTree = "<group>"; };
DDA4945F2A8725FC003814F1 /* QuizDefault.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuizDefault.swift; sourceTree = "<group>"; };
DDA494612A872DDF003814F1 /* ListeningView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListeningView.swift; sourceTree = "<group>"; };
DDC5F3532A85CBD90096AAA0 /* Question.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Question.swift; sourceTree = "<group>"; };
DDCC6D682A8DC4FB0085D950 /* underline.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = underline.json; sourceTree = "<group>"; };
DDCC6D6B2A8DCE100085D950 /* QuestionResultWritingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestionResultWritingView.swift; sourceTree = "<group>"; };
DDCC6D6D2A8DCF2F0085D950 /* QuizWritingContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuizWritingContentView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -643,8 +639,6 @@
isa = PBXGroup;
children = (
DD72E2352A8A1D38006AB647 /* PoinRealm.swift */,
DDA4945F2A8725FC003814F1 /* QuizDefault.swift */,
DDC5F3532A85CBD90096AAA0 /* Question.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -865,7 +859,6 @@
DD3B1B8D2A8B8C910047F43B /* ColorView.swift in Sources */,
CA2223472A2BB329005164BB /* DefaultProjectApp.swift in Sources */,
CA2223AB2A2BB34A005164BB /* CONSTANT.swift in Sources */,
DDC5F3542A85CBD90096AAA0 /* Question.swift in Sources */,
DDCC6D6C2A8DCE100085D950 /* QuestionResultWritingView.swift in Sources */,
DD7F61062A8F0D480030E044 /* ColorSubmitNextButtonsView.swift in Sources */,
DDCC6D7B2A8E1A420085D950 /* HistoryContentView.swift in Sources */,
Expand Down Expand Up @@ -913,7 +906,6 @@
CA2223962A2BB34A005164BB /* IAPHandler.swift in Sources */,
CA2223C62A2BB34A005164BB /* Font.swift in Sources */,
CA2223C72A2BB34A005164BB /* UIApplication.swift in Sources */,
DDA494602A8725FC003814F1 /* QuizDefault.swift in Sources */,
DD7F61122A8F14260030E044 /* SectionMathView.swift in Sources */,
CA2223CA2A2BB34A005164BB /* TimeInterval.swift in Sources */,
CA2223C12A2BB34A005164BB /* SlimRectangle.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
language = "vi"
language = "ru"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>
Binary file not shown.
2 changes: 1 addition & 1 deletion DefaultProject/View/ChooseLanguageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct ChooseLanguageView: SwiftUI.View {
Image(systemName: "chevron.left")
.imageScale(.large)
.foregroundColor(Color.background)
Text("Languages".localizedLanguage(language: language))
Text("Languages".cw_localized)
.font(.bold(size: 24))
.foregroundColor(Color.background)
}
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Color/ColorContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct ColorContentView: View {
let quiz = CONSTANT.SHARED.DATA_COLOR[index]

VStack{
Text("\(quiz.question.localizedLanguage(language: language))")
Text("\(quiz.question.cw_localized)")
.font(.regular(size: 20))
.foregroundColor(.background)
.frame(maxWidth: .infinity, alignment: .leading)
Expand Down Expand Up @@ -57,7 +57,7 @@ struct ColorContentView: View {
@ViewBuilder
func answerView(question: String, isCorrect: Bool) -> some View {
HStack{
Text(question.localizedLanguage(language: language))
Text(question.cw_localized)
.font(.regular(size: 18))
.foregroundColor(.background)
.frame(height: 55)
Expand Down
2 changes: 1 addition & 1 deletion DefaultProject/View/Color/ColorInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct ColorInfoView: View {
var body: some View {
HStack{
VStack{
Text("\(selectedTab + 1) \("of".localizedLanguage(language: language)) \(CONSTANT.SHARED.DATA_COLOR.count)")
Text("\(selectedTab + 1) \("of".cw_localized) \(CONSTANT.SHARED.DATA_COLOR.count)")
.font(.bold(size: 16))
.foregroundColor(Color.background)
ProgressView(value: min(max(progress, 0), Double(CONSTANT.SHARED.DATA_COLOR.count - 1)), total: Double(CONSTANT.SHARED.DATA_COLOR.count - 1))
Expand Down
6 changes: 3 additions & 3 deletions DefaultProject/View/Color/ColorSubmitNextButtonsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct ColorSubmitNextButtonsView: View {
Button{
isSubmit = true

if selectedAnswer.lowercased().localizedLanguage(language: language) == answerCorrect.lowercased().localizedLanguage(language: language){
if selectedAnswer.lowercased().cw_localized == answerCorrect.lowercased().cw_localized{
loadAudio(nameSound: "correct")
isCorrect = true
countCorrect += 1
Expand All @@ -39,7 +39,7 @@ struct ColorSubmitNextButtonsView: View {
countWrong += 1
}
} label: {
Text("Submit".localizedLanguage(language: language))
Text("Submit".cw_localized)
.foregroundColor(.text)
.padding()
.frame(height: 50)
Expand Down Expand Up @@ -77,7 +77,7 @@ struct ColorSubmitNextButtonsView: View {
Point.updatePointColor(point: countCorrect)
// }
}label: {
Text(selectedTab < CONSTANT.SHARED.DATA_COLOR.count - 1 ? "Next".localizedLanguage(language: language) : "Done".localizedLanguage(language: language))
Text(selectedTab < CONSTANT.SHARED.DATA_COLOR.count - 1 ? "Next".cw_localized : "Done".cw_localized)
.foregroundColor(.text)
.padding()
.frame(height: 50)
Expand Down
2 changes: 1 addition & 1 deletion DefaultProject/View/Color/ColorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct ColorView: View {
Image(systemName: "chevron.left")
.imageScale(.large)
.foregroundColor(Color.background)
Text("Color".localizedLanguage(language: language))
Text("Color".cw_localized)
.font(.bold(size: 24))
.foregroundColor(Color.background)
}
Expand Down
8 changes: 4 additions & 4 deletions DefaultProject/View/CreateUsernameView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ struct CreateUsernameView: View {
.foregroundColor(Color.text)

VStack{
Text("Welcome".localizedLanguage(language: language))
Text("Welcome".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.padding(.bottom, 10)
Text("Please enter your name".localizedLanguage(language: language))
Text("Please enter your name".cw_localized)
.font(.bold(size: 12))
.foregroundColor(Color.text2)
.padding(.bottom, 15)

HStack{
Text(name.isEmpty ? "Enter your name".localizedLanguage(language: language) : "")
Text(name.isEmpty ? "Enter your name".cw_localized : "")
.font(Font.medium(size: 16))
.foregroundColor(.text2)
.hAlign(.leading)
Expand All @@ -52,7 +52,7 @@ struct CreateUsernameView: View {
Button {
USERNAME = name
} label: {
Text("START".localizedLanguage(language: language))
Text("START".cw_localized)
.font(.bold(size: 18))
.foregroundColor(Color.text)
.padding(.vertical, 10)
Expand Down
8 changes: 4 additions & 4 deletions DefaultProject/View/History/HistoryContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ struct HistoryContentView: View {
VStack (spacing: 0) {
let quiz = CONSTANT.SHARED.DATA_HISTORY[index]

Text("Select an answer".localizedLanguage(language: language))
Text("Select an answer".cw_localized)
.font(.bold(size: 14))
.foregroundColor(Color.text2)
.hAlign(.leading)
.padding(.top)
.padding(.horizontal)

VStack{
Text(quiz.question.localizedLanguage(language: language))
Text(quiz.question.cw_localized)
.font(.regular(size: 20))
.foregroundColor(.background)
.hAlign(.leading)
Expand All @@ -44,7 +44,7 @@ struct HistoryContentView: View {
.padding()
.onTapGesture {
if !synthesizer.isSpeaking{
speakText(textToSpeak: quiz.question.localizedLanguage(language: language))
speakText(textToSpeak: quiz.question.cw_localized)
}else{
synthesizer.stopSpeaking(at: .immediate)
}
Expand All @@ -66,7 +66,7 @@ struct HistoryContentView: View {
@ViewBuilder
func answerView(question: String, isCorrect: Bool) -> some View {
HStack{
Text(question.localizedLanguage(language: language))
Text(question.cw_localized)
.font(.regular(size: 15))
.foregroundColor(.background)
.frame(height: 55)
Expand Down
2 changes: 1 addition & 1 deletion DefaultProject/View/History/HistoryInfoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct HistoryInfoView: View {
var body: some View {
HStack{
VStack{
Text("\(selectedTab + 1) \("of".localizedLanguage(language: language)) \(CONSTANT.SHARED.DATA_HISTORY.count)")
Text("\(selectedTab + 1) \("of".cw_localized) \(CONSTANT.SHARED.DATA_HISTORY.count)")
.font(.bold(size: 16))
.foregroundColor(Color.background)
ProgressView(value: min(max(progress, 0), Double(CONSTANT.SHARED.DATA_HISTORY.count - 1)), total: Double(CONSTANT.SHARED.DATA_HISTORY.count - 1))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct HistorySubmitNextButtonsView: View {
countWrong += 1
}
}label: {
Text("Submit".localizedLanguage(language: language))
Text("Submit".cw_localized)
.foregroundColor(.text)
.padding()
.frame(height: 50)
Expand Down Expand Up @@ -78,7 +78,7 @@ struct HistorySubmitNextButtonsView: View {
Point.updatePointHistory(newPointHistory: countCorrect)
// }
}label: {
Text(selectedTab < CONSTANT.SHARED.DATA_HISTORY.count - 1 ? "Next".localizedLanguage(language: language) : "Done".localizedLanguage(language: language))
Text(selectedTab < CONSTANT.SHARED.DATA_HISTORY.count - 1 ? "Next".cw_localized : "Done".cw_localized)
.foregroundColor(.text)
.padding()
.frame(height: 50)
Expand Down
2 changes: 1 addition & 1 deletion DefaultProject/View/History/HistoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct HistoryView: View {
Image(systemName: "chevron.left")
.imageScale(.large)
.foregroundColor(Color.background)
Text("History".localizedLanguage(language: language))
Text("History".cw_localized)
.font(.bold(size: 24))
.foregroundColor(Color.background)
}
Expand Down
2 changes: 1 addition & 1 deletion DefaultProject/View/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ struct HomeView: View {
var body: some View {
VStack {
HStack{
Text("\("Hi".localizedLanguage(language: language)), \(USERNAME)")
Text("\("Hi".cw_localized), \(USERNAME)")
.font(.bold(size: 20))
.foregroundColor(Color.background)
.hAlign(.leading)
Expand Down
2 changes: 1 addition & 1 deletion DefaultProject/View/Home/SectionColorView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct SectionColorView: View {
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_COLOR.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_COLOR.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Home/SectionHistoryView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ struct SectionHistoryView: View {
.padding(.leading)

VStack(spacing: 5) {
Text("History".localizedLanguage(language: language))
Text("History".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_HISTORY.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_HISTORY.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Home/SectionListenAndRPView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ struct SectionListenAndRPView: View {
.frame(width: 80)

VStack(spacing: 5) {
Text("Listen And Repeat".localizedLanguage(language: language))
Text("Listen And Repeat".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_LISTEN_AND_REPEAT.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_LISTEN_AND_REPEAT.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Home/SectionListeningView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ struct SectionListeningView: View {
.padding(.leading)

VStack(spacing: 5) {
Text("Listen".localizedLanguage(language: language))
Text("Listen".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_LISTEN.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_LISTEN.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Home/SectionMathView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ struct SectionMathView: View {
.padding(.leading)

VStack(spacing: 5) {
Text("Math".localizedLanguage(language: language))
Text("Math".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_MATH.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_MATH.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Home/SectionSurroundingObjectView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ struct SectionSurroundingObjectView: View {
.padding(.leading)

VStack(spacing: 5){
Text("Surrounding objects".localizedLanguage(language: language))
Text("Surrounding objects".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_SURROUNDING.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_SURROUNDING.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
4 changes: 2 additions & 2 deletions DefaultProject/View/Home/SectionWritingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ struct SectionWritingView: View {
.padding(.leading)

VStack(spacing: 5) {
Text("Writing".localizedLanguage(language: language))
Text("Writing".cw_localized)
.font(.bold(size: 16))
.foregroundColor(Color.background)
.hAlign(.leading)
Text("\(CONSTANT.SHARED.DATA_WRITING.count) \("questions".localizedLanguage(language: language))")
Text("\(CONSTANT.SHARED.DATA_WRITING.count) \("questions".cw_localized)")
.font(.bold(size: 14))
.foregroundColor(Color.text)
.hAlign(.leading)
Expand Down
Loading

0 comments on commit 505b2be

Please sign in to comment.