Commit 6ce5a0fa authored by Grigor Aghabalyan's avatar Grigor Aghabalyan
Browse files

Feat: add languages

parent 82affefa
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
C5356A2C242FA06000EFD310 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = C5356A2E242FA06000EFD310 /* Localizable.strings */; };
C5356A34242FBAF800EFD310 /* SettingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A32242FBAF800EFD310 /* SettingsViewController.swift */; };
C5356A35242FBAF800EFD310 /* SettingsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5356A33242FBAF800EFD310 /* SettingsViewController.xib */; };
C5356A39242FC1F900EFD310 /* LanguageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A37242FC1F900EFD310 /* LanguageViewController.swift */; };
C5356A3A242FC1F900EFD310 /* LanguageViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5356A38242FC1F900EFD310 /* LanguageViewController.xib */; };
C5356A3D242FC9F900EFD310 /* Language.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A3C242FC9F900EFD310 /* Language.swift */; };
C5356A41242FCB4700EFD310 /* LanguageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5356A3F242FCB4600EFD310 /* LanguageCell.swift */; };
C5356A42242FCB4700EFD310 /* LanguageCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = C5356A40242FCB4600EFD310 /* LanguageCell.xib */; };
C5D2A725242B077100825031 /* FormsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A724242B077100825031 /* FormsService.swift */; }; C5D2A725242B077100825031 /* FormsService.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A724242B077100825031 /* FormsService.swift */; };
C5D2A727242B0A2300825031 /* FormsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A726242B0A2300825031 /* FormsResponse.swift */; }; C5D2A727242B0A2300825031 /* FormsResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A726242B0A2300825031 /* FormsResponse.swift */; };
C5D2A729242B12F200825031 /* FormResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A728242B12F200825031 /* FormResponse.swift */; }; C5D2A729242B12F200825031 /* FormResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5D2A728242B12F200825031 /* FormResponse.swift */; };
...@@ -55,6 +63,20 @@ ...@@ -55,6 +63,20 @@
57DE28D9ACEB4E61AAE67E58 /* Pods-App16.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App16.debug.xcconfig"; path = "Target Support Files/Pods-App16/Pods-App16.debug.xcconfig"; sourceTree = "<group>"; }; 57DE28D9ACEB4E61AAE67E58 /* Pods-App16.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App16.debug.xcconfig"; path = "Target Support Files/Pods-App16/Pods-App16.debug.xcconfig"; sourceTree = "<group>"; };
AC947C811CE3C096F8981C77 /* Pods_App16.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App16.framework; sourceTree = BUILT_PRODUCTS_DIR; }; AC947C811CE3C096F8981C77 /* Pods_App16.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_App16.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AF4BB414838A78D615C7E656 /* Pods-App16.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App16.release.xcconfig"; path = "Target Support Files/Pods-App16/Pods-App16.release.xcconfig"; sourceTree = "<group>"; }; AF4BB414838A78D615C7E656 /* Pods-App16.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-App16.release.xcconfig"; path = "Target Support Files/Pods-App16/Pods-App16.release.xcconfig"; sourceTree = "<group>"; };
C5356A28242FA03000EFD310 /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/Main.strings; sourceTree = "<group>"; };
C5356A29242FA03000EFD310 /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
C5356A2A242FA05100EFD310 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Main.strings; sourceTree = "<group>"; };
C5356A2B242FA05100EFD310 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
C5356A2D242FA06000EFD310 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
C5356A2F242FA06D00EFD310 /* hy */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = hy; path = hy.lproj/Localizable.strings; sourceTree = "<group>"; };
C5356A30242FA07000EFD310 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = ru.lproj/Localizable.strings; sourceTree = "<group>"; };
C5356A32242FBAF800EFD310 /* SettingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewController.swift; sourceTree = "<group>"; };
C5356A33242FBAF800EFD310 /* SettingsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = SettingsViewController.xib; sourceTree = "<group>"; };
C5356A37242FC1F900EFD310 /* LanguageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageViewController.swift; sourceTree = "<group>"; };
C5356A38242FC1F900EFD310 /* LanguageViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LanguageViewController.xib; sourceTree = "<group>"; };
C5356A3C242FC9F900EFD310 /* Language.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Language.swift; sourceTree = "<group>"; };
C5356A3F242FCB4600EFD310 /* LanguageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageCell.swift; sourceTree = "<group>"; };
C5356A40242FCB4600EFD310 /* LanguageCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = LanguageCell.xib; sourceTree = "<group>"; };
C5D2A724242B077100825031 /* FormsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsService.swift; sourceTree = "<group>"; }; C5D2A724242B077100825031 /* FormsService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsService.swift; sourceTree = "<group>"; };
C5D2A726242B0A2300825031 /* FormsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsResponse.swift; sourceTree = "<group>"; }; C5D2A726242B0A2300825031 /* FormsResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormsResponse.swift; sourceTree = "<group>"; };
C5D2A728242B12F200825031 /* FormResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormResponse.swift; sourceTree = "<group>"; }; C5D2A728242B12F200825031 /* FormResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FormResponse.swift; sourceTree = "<group>"; };
...@@ -129,6 +151,51 @@ ...@@ -129,6 +151,51 @@
path = Pods; path = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C5356A23242F9ED300EFD310 /* Resources */ = {
isa = PBXGroup;
children = (
C5356A2E242FA06000EFD310 /* Localizable.strings */,
);
path = Resources;
sourceTree = "<group>";
};
C5356A31242FBADB00EFD310 /* Settings */ = {
isa = PBXGroup;
children = (
C5356A32242FBAF800EFD310 /* SettingsViewController.swift */,
C5356A33242FBAF800EFD310 /* SettingsViewController.xib */,
);
path = Settings;
sourceTree = "<group>";
};
C5356A36242FC1E600EFD310 /* Language */ = {
isa = PBXGroup;
children = (
C5356A3E242FCB3000EFD310 /* Cells */,
C5356A3B242FC9E700EFD310 /* Models */,
C5356A37242FC1F900EFD310 /* LanguageViewController.swift */,
C5356A38242FC1F900EFD310 /* LanguageViewController.xib */,
);
path = Language;
sourceTree = "<group>";
};
C5356A3B242FC9E700EFD310 /* Models */ = {
isa = PBXGroup;
children = (
C5356A3C242FC9F900EFD310 /* Language.swift */,
);
path = Models;
sourceTree = "<group>";
};
C5356A3E242FCB3000EFD310 /* Cells */ = {
isa = PBXGroup;
children = (
C5356A3F242FCB4600EFD310 /* LanguageCell.swift */,
C5356A40242FCB4600EFD310 /* LanguageCell.xib */,
);
path = Cells;
sourceTree = "<group>";
};
C5D69141242AA091004268C3 = { C5D69141242AA091004268C3 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -150,6 +217,7 @@ ...@@ -150,6 +217,7 @@
C5D6914C242AA091004268C3 /* App16 */ = { C5D6914C242AA091004268C3 /* App16 */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C5356A23242F9ED300EFD310 /* Resources */,
C5D691A2242AAEFA004268C3 /* Extensions */, C5D691A2242AAEFA004268C3 /* Extensions */,
C5D69165242AA3F7004268C3 /* Settings */, C5D69165242AA3F7004268C3 /* Settings */,
C5D69166242AA405004268C3 /* Config */, C5D69166242AA405004268C3 /* Config */,
...@@ -226,6 +294,8 @@ ...@@ -226,6 +294,8 @@
C5D6916C242AA460004268C3 /* Views */ = { C5D6916C242AA460004268C3 /* Views */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C5356A36242FC1E600EFD310 /* Language */,
C5356A31242FBADB00EFD310 /* Settings */,
C5D691CD242AFEB0004268C3 /* DatePicker */, C5D691CD242AFEB0004268C3 /* DatePicker */,
C5D691B1242AD26C004268C3 /* Qr */, C5D691B1242AD26C004268C3 /* Qr */,
C5D6919B242AADBD004268C3 /* Main */, C5D6919B242AADBD004268C3 /* Main */,
...@@ -392,6 +462,8 @@ ...@@ -392,6 +462,8 @@
knownRegions = ( knownRegions = (
en, en,
Base, Base,
hy,
ru,
); );
mainGroup = C5D69141242AA091004268C3; mainGroup = C5D69141242AA091004268C3;
productRefGroup = C5D6914B242AA091004268C3 /* Products */; productRefGroup = C5D6914B242AA091004268C3 /* Products */;
...@@ -409,11 +481,15 @@ ...@@ -409,11 +481,15 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
C5D69185242AABD2004268C3 /* LoginViewController.xib in Resources */, C5D69185242AABD2004268C3 /* LoginViewController.xib in Resources */,
C5356A3A242FC1F900EFD310 /* LanguageViewController.xib in Resources */,
C5D6915A242AA094004268C3 /* LaunchScreen.storyboard in Resources */, C5D6915A242AA094004268C3 /* LaunchScreen.storyboard in Resources */,
C5356A42242FCB4700EFD310 /* LanguageCell.xib in Resources */,
C5356A2C242FA06000EFD310 /* Localizable.strings in Resources */,
C5D6919A242AAD3F004268C3 /* FormCreateViewController.xib in Resources */, C5D6919A242AAD3F004268C3 /* FormCreateViewController.xib in Resources */,
C5D691B5242AD290004268C3 /* QrViewController.xib in Resources */, C5D691B5242AD290004268C3 /* QrViewController.xib in Resources */,
C5D691D1242AFEB0004268C3 /* DatePickerViewController.xib in Resources */, C5D691D1242AFEB0004268C3 /* DatePickerViewController.xib in Resources */,
C5D69190242AAC86004268C3 /* FormListViewController.xib in Resources */, C5D69190242AAC86004268C3 /* FormListViewController.xib in Resources */,
C5356A35242FBAF800EFD310 /* SettingsViewController.xib in Resources */,
C5D691B0242AC607004268C3 /* WelcomeViewController.xib in Resources */, C5D691B0242AC607004268C3 /* WelcomeViewController.xib in Resources */,
C5D69157242AA094004268C3 /* Assets.xcassets in Resources */, C5D69157242AA094004268C3 /* Assets.xcassets in Resources */,
C5D69155242AA091004268C3 /* Main.storyboard in Resources */, C5D69155242AA091004268C3 /* Main.storyboard in Resources */,
...@@ -477,6 +553,8 @@ ...@@ -477,6 +553,8 @@
C5D691C0242AE5E2004268C3 /* FormCreateResponse.swift in Sources */, C5D691C0242AE5E2004268C3 /* FormCreateResponse.swift in Sources */,
C5D69199242AAD3F004268C3 /* FormCreateViewController.swift in Sources */, C5D69199242AAD3F004268C3 /* FormCreateViewController.swift in Sources */,
C5D6917F242AA5D9004268C3 /* CheckBaseHelper.swift in Sources */, C5D6917F242AA5D9004268C3 /* CheckBaseHelper.swift in Sources */,
C5356A34242FBAF800EFD310 /* SettingsViewController.swift in Sources */,
C5356A39242FC1F900EFD310 /* LanguageViewController.swift in Sources */,
C5D6914E242AA091004268C3 /* AppDelegate.swift in Sources */, C5D6914E242AA091004268C3 /* AppDelegate.swift in Sources */,
C5D6918F242AAC86004268C3 /* FormListViewController.swift in Sources */, C5D6918F242AAC86004268C3 /* FormListViewController.swift in Sources */,
C5D69173242AA539004268C3 /* BaseService.swift in Sources */, C5D69173242AA539004268C3 /* BaseService.swift in Sources */,
...@@ -493,6 +571,7 @@ ...@@ -493,6 +571,7 @@
C5D691B4242AD290004268C3 /* QrViewController.swift in Sources */, C5D691B4242AD290004268C3 /* QrViewController.swift in Sources */,
C5D691AB242AC17D004268C3 /* UIView+Extensions.swift in Sources */, C5D691AB242AC17D004268C3 /* UIView+Extensions.swift in Sources */,
C5D69177242AA573004268C3 /* ValidationError.swift in Sources */, C5D69177242AA573004268C3 /* ValidationError.swift in Sources */,
C5356A3D242FC9F900EFD310 /* Language.swift in Sources */,
C5D2A72B242B20AC00825031 /* FormFinishService.swift in Sources */, C5D2A72B242B20AC00825031 /* FormFinishService.swift in Sources */,
C5D6917D242AA5BE004268C3 /* UserDefaultsHelper.swift in Sources */, C5D6917D242AA5BE004268C3 /* UserDefaultsHelper.swift in Sources */,
C5D691BC242AE1F8004268C3 /* FormCreateRequestForm.swift in Sources */, C5D691BC242AE1F8004268C3 /* FormCreateRequestForm.swift in Sources */,
...@@ -500,6 +579,7 @@ ...@@ -500,6 +579,7 @@
C5D6917B242AA5AA004268C3 /* DateFormat.swift in Sources */, C5D6917B242AA5AA004268C3 /* DateFormat.swift in Sources */,
C5D69181242AA5EB004268C3 /* AlertControllerHelper.swift in Sources */, C5D69181242AA5EB004268C3 /* AlertControllerHelper.swift in Sources */,
C5D69175242AA55A004268C3 /* BaseState.swift in Sources */, C5D69175242AA55A004268C3 /* BaseState.swift in Sources */,
C5356A41242FCB4700EFD310 /* LanguageCell.swift in Sources */,
C5D691B8242AD62A004268C3 /* FormListCell.swift in Sources */, C5D691B8242AD62A004268C3 /* FormListCell.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -507,10 +587,22 @@ ...@@ -507,10 +587,22 @@
/* End PBXSourcesBuildPhase section */ /* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */ /* Begin PBXVariantGroup section */
C5356A2E242FA06000EFD310 /* Localizable.strings */ = {
isa = PBXVariantGroup;
children = (
C5356A2D242FA06000EFD310 /* en */,
C5356A2F242FA06D00EFD310 /* hy */,
C5356A30242FA07000EFD310 /* ru */,
);
name = Localizable.strings;
sourceTree = "<group>";
};
C5D69153242AA091004268C3 /* Main.storyboard */ = { C5D69153242AA091004268C3 /* Main.storyboard */ = {
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
C5D69154242AA091004268C3 /* Base */, C5D69154242AA091004268C3 /* Base */,
C5356A28242FA03000EFD310 /* hy */,
C5356A2A242FA05100EFD310 /* ru */,
); );
name = Main.storyboard; name = Main.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -519,6 +611,8 @@ ...@@ -519,6 +611,8 @@
isa = PBXVariantGroup; isa = PBXVariantGroup;
children = ( children = (
C5D69159242AA094004268C3 /* Base */, C5D69159242AA094004268C3 /* Base */,
C5356A29242FA03000EFD310 /* hy */,
C5356A2B242FA05100EFD310 /* ru */,
); );
name = LaunchScreen.storyboard; name = LaunchScreen.storyboard;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -530,6 +624,7 @@ ...@@ -530,6 +624,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
...@@ -590,6 +685,7 @@ ...@@ -590,6 +685,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
......
...@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -35,7 +35,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
IQKeyboardManager.shared.enable = true IQKeyboardManager.shared.enable = true
setDefaultLanguage()
return true return true
} }
...@@ -80,4 +80,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -80,4 +80,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions. // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
// Use this method to release any resources that were specific to the discarded scenes, as they will not return. // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
} }
private func setDefaultLanguage() {
if UserDefaultsHelper.getString(for: .locale) == nil {
Settings.changeLanguage(Settings.Languages.Armenian.rawValue, langauge: "Հայերեն")
}
}
} }
{
"images" : [
{
"filename" : "icons8-checkmark.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
{
"images" : [
{
"filename" : "settings.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
...@@ -24,3 +24,20 @@ extension Date { ...@@ -24,3 +24,20 @@ extension Date {
return dateFormatter.string(from: self) return dateFormatter.string(from: self)
} }
} }
extension Bundle {
class var applicationVersionNumber: String {
if let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String {
return version
}
return "Version Number Not Available"
}
class var applicationBuildNumber: String {
if let build = Bundle.main.infoDictionary?["CFBundleVersion"] as? String {
return build
}
return "Build Number Not Available"
}
}
...@@ -15,6 +15,8 @@ enum UDAliases: String { ...@@ -15,6 +15,8 @@ enum UDAliases: String {
case lstName case lstName
case middleName case middleName
case deviceToken case deviceToken
case locale = "hy"
case langauge = "Հայերեն"
} }
class UserDefaultsHelper { class UserDefaultsHelper {
......
/*
Localizable.strings
App16
Created by Grigor Aghabalyan on 3/28/20.
Copyright © 2020 X-TECH. All rights reserved.
*/
"FIRST_NAME" = "Fist name";
"LAST_NAME" = "Last name";
"MIDDLE_NAME" = "Middle name";
"NEXT" = "Next";
"WELCOME" = "Welcome";
"HISTORY" = "History";
"CREATE_FORM" = "Create Form";
"CREATE" = "Create";
"FORM" = "Form";
"FINISH" = "Finish";
"OUT_ADDRESS" = "Out address";
"OUT_DATETIME" = "Out datetime";
"Estimated Return Time" = "Estimated Return Time";
"Address of the place of visit/Title" = "Address of the place of visit/Title";
"Purpose of the visit" = "Purpose of the visit";
"APP_VERSION" = "App version";
"SETTINGS" = "Settings";
"LANGUAGE" = "Language";
"LANGUAGES" = "Languages";
"CANCEL" = "Cancel";
/*
Localizable.strings
App16
Created by Grigor Aghabalyan on 3/28/20.
Copyright © 2020 X-TECH. All rights reserved.
*/
"FIRST_NAME" = "Անուն";
"LAST_NAME" = "Ազգանուն";
"MIDDLE_NAME" = "հայրանուն";
"NEXT" = "Հաջորդը";
"WELCOME" = "Բարի գալուստ";
"HISTORY" = "Պատմություն";
"CREATE_FORM" = "Ստեղծել ձևաթուղթ";
"CREATE" = "Ստեղծել";
"FOMR" = "Ձևաթուղթ";
"FINISH" = "Ավարտել";
"OUT_ADDRESS" = "Ելքի ժամ";
"OUT_DATETIME" = "Ելքի հասցե";
"Estimated Return Time" = "Վերադարձի ակնկալվող ժամը";
"Address of the place of visit/title" = "Այցելության վայրի հասցե/անվանում";
"Purpose of the visit" = "Այցելության նպատակը";
"APP_VERSION" = "Հավելվածի տարբերակ";
"SETTINGS" = "Կարգավորումներ";
"LANGUAGE" = "Լեզու";
"LANGUAGES" = "Լեզուներ";
"CANCEL" = "Չեղարկել";
/*
Localizable.strings
App16
Created by Grigor Aghabalyan on 3/28/20.
Copyright © 2020 X-TECH. All rights reserved.
*/
"FIRST_NAME" = "Имя";
"LAST_NAME" = "Фамилия";
"MIDDLE_NAME" = "Отчество";
"NEXT" = "Следующий";
"WELCOME" = "Добро пожаловать";
"HISTORY" = "История";
"CREATE_FORM" = "Создать форму";
"CREATE" = "Создать";
"FORM" = "Форма";
"FINISH" = "Закончить";
"OUT_ADDRESS" = "Время выхода";
"OUT_DATETIME" = "Адрес выхода";
"Estimated Return Time" = "Ожидаемое время возврата/название";
"Address of the place of visit/Title" = "Адрес места посещения";
"Purpose of the visit" = "Цель визита";
"APP_VERSION" = "Версия приложения";
"SETTINGS" = "Настройки";
"LANGUAGE" = "Язык";
"LANGUAGES" = "Языки";
"CANCEL" = "Отменить";
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
import Foundation import Foundation
import CoreLocation import CoreLocation
import Localize_Swift
struct Settings { struct Settings {
...@@ -15,4 +16,33 @@ struct Settings { ...@@ -15,4 +16,33 @@ struct Settings {
case latitude = 40.178576 case latitude = 40.178576
case longitude = 44.511739 case longitude = 44.511739
} }
enum Languages: String {
case Armenian = "hy"
case English = "en"
case Russian = "ru"
}
static func changeLanguage(_ code: String, langauge: String) {
Settings.language = code
Localize.setCurrentLanguage(Settings.language)
UserDefaultsHelper.set(alias: .locale, value: code)
UserDefaultsHelper.set(alias: .langauge, value: langauge)
UserDefaults.standard.set(code, forKey: "language")
UserDefaults.standard.synchronize()
}
static var language: String! {
set(token) {
let defaults = Foundation.UserDefaults.standard
defaults.set(token, forKey: "User.Language")
}
get {
let defaults = Foundation.UserDefaults.standard
let lang = defaults.object(forKey: "User.Language") as? String
return lang
}
}
} }
...@@ -25,8 +25,8 @@ class FormCreateViewController: UIViewController { ...@@ -25,8 +25,8 @@ class FormCreateViewController: UIViewController {
@IBOutlet weak var outAddressTextFiled: UITextField! @IBOutlet weak var outAddressTextFiled: UITextField!
@IBOutlet weak var destinationAddressTextField: UITextField! @IBOutlet weak var destinationAddressTextField: UITextField!
@IBOutlet weak var planneDateTimeTextField: UITextField! @IBOutlet weak var planneDateTimeTextField: UITextField!
@IBOutlet weak var destinationTypeTextField: UITextField! @IBOutlet weak var destinationTypeTextField: UITextField!
@IBOutlet weak var createButton: UIButton! @IBOutlet weak var createButton: UIButton!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView! @IBOutlet weak var activityIndicator: UIActivityIndicatorView!
...@@ -34,6 +34,12 @@ class FormCreateViewController: UIViewController { ...@@ -34,6 +34,12 @@ class FormCreateViewController: UIViewController {
@IBOutlet weak var planneDateTimeButton: UIButton! @IBOutlet weak var planneDateTimeButton: UIButton!
@IBOutlet weak var nameLabel: UILabel! @IBOutlet weak var nameLabel: UILabel!
@IBOutlet weak var outDateTimeTextLabel: UILabel!
@IBOutlet weak var outAddressTextLabel: UILabel!
@IBOutlet weak var destinationAddressTextLabel: UILabel!
@IBOutlet weak var planneDateTimeTextLabel: UILabel!
@IBOutlet weak var destinationTypeTextLabel: UILabel!
// MARK: - Variables // MARK: - Variables
var data: FormResponse! var data: FormResponse!
var formViewType: FormViewType = .creta var formViewType: FormViewType = .creta
...@@ -43,20 +49,22 @@ class FormCreateViewController: UIViewController { ...@@ -43,20 +49,22 @@ class FormCreateViewController: UIViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
setUI()
switch formViewType { switch formViewType {
case .creta: case .creta:
createButton.isHidden = false createButton.isHidden = false
self.title = "Ստեղծել ձևաթուղթ" self.title = "CREATE_FORM".localized()
curentDate.text = date curentDate.text = date
case .viewFromList: case .viewFromList:
self.title = "Ձևաթուղթ" self.title = "FORM".localized()
createButton.isHidden = true createButton.isHidden = true
setData(response: data) setData(response: data)