diff --git a/MiniScanner/Extensions/String+StringKeys.swift b/MiniScanner/Extensions/String+StringKeys.swift index 2ee2fb15b69213aa910974057986c6f70c7456cd..409746f91b4f3dd0359728d5f4ca6d161c74d5d4 100644 --- a/MiniScanner/Extensions/String+StringKeys.swift +++ b/MiniScanner/Extensions/String+StringKeys.swift @@ -71,4 +71,14 @@ extension String { static let deviceTheme = "device_theme" static let darkMode = "dark_mode" static let lightMode = "light_mode" + + static let Continue = "continue" + static let back = "back" + + static let alert = "alert" + static let discardChangesMsg = "discard_changes_msg" + static let discardChangesAndContinueMsg = "discard_changes_and_continue_msg" + + static let deleteImageMsg = "delete_image_msg" + static let ok = "ok" } diff --git a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift index 92e213294317d03e14160a2b611cf0f9ec3bb3b4..971599f474f0181fbffb536004d407b56f4e82e6 100644 --- a/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift +++ b/MiniScanner/Modules/Documents/Customs/CustomViews/KNAlert/KNAlertViewController.swift @@ -208,7 +208,7 @@ extension KNAlertViewController { buttonsView_trailing.constant = buttonsView_Spacing confirmationButton.isHidden = false - confirmationButton.setTitle("OK", for: .normal) + confirmationButton.set(localized: .ok) buttonsView_height.constant = BUTTON_HEIGHT case .decision: @@ -220,8 +220,7 @@ extension KNAlertViewController { destructiveButton.isHidden = false confirmationButton.isHidden = false - - confirmationButton.setTitle("Yes", for: .normal) + confirmationButton.set(localized: .yes) buttonsView_height.constant = BUTTON_HEIGHT diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index dc4aa68a9caf89d4a48604c3fab82893df19cb11..ad407225186c6ca8e483e401966d9fdc8a688689 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -70,13 +70,13 @@ public class EditViewController: UIViewController { view.addSubview(activityIndicator) continueButton.backgroundColor = .mainBlue - continueButton.setTitle("Continue", for: .normal) + continueButton.set(localized: .Continue) continueButton.setTitleColor(.white, for: .normal) continueButton.layer.cornerRadius = 10 localFileManager = LocalFileManager() options = ImageScannerOptions() configImageEditor() - let backButton = UIBarButtonItem(title: "Back", style: .plain, target: self, action: #selector(backTapped)) + let backButton = UIBarButtonItem(title: .back.localized, style: .plain, target: self, action: #selector(backTapped)) self.navigationItem.leftBarButtonItem = backButton } @@ -105,9 +105,9 @@ public class EditViewController: UIViewController { if self.navigationItem.rightBarButtonItem == nil { self.navigationController?.popViewController(animated: true) } else { - let alertController = UIAlertController(title: "Alert", message: "Do you want to discard the changes you've made?", preferredStyle: .alert) + let alertController = UIAlertController(title: .alert.localized, message: .discardChangesMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Discard", style: .destructive) { (action) in + let okAction = UIAlertAction(title: .discard.localized, style: .destructive) { (action) in self.dismiss(animated: true) { if let items = self.scanSession?.scannedItems { @@ -267,9 +267,9 @@ public class EditViewController: UIViewController { let bottomSheetController = NBBottomSheetController(configuration: configuration) bottomSheetController.present(popup, on: self) } else { - let alertController = UIAlertController(title: "Alert", message: "Do you want to discard the changes you've made and continue?", preferredStyle: .alert) + let alertController = UIAlertController(title: .alert.localized, message: .discardChangesAndContinueMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Yes", style: .destructive) { (action) in + let okAction = UIAlertAction(title: .yes.localized, style: .destructive) { (action) in self.dismiss(animated: true) { if let items = self.scanSession?.scannedItems { @@ -433,9 +433,9 @@ extension EditViewController: BannerViewDelegate { } func delete(index: Int) { - let alertController = UIAlertController(title: "Alert", message: "Are you sure you want to delete this image?", preferredStyle: .alert) + let alertController = UIAlertController(title: .alert.localized, message: .deleteImageMsg.localized, preferredStyle: .alert) - let okAction = UIAlertAction(title: "Yes", style: .default) { (action) in + let okAction = UIAlertAction(title: .yes.localized, style: .default) { (action) in self.scanSession?.remove(index: index) if index != 0 { self.selectedIndex = index - 1 diff --git a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift index 1f837cae4fbbcc6d5e14f622ad8396b51f273518..bb59a13e38cb45382a7e5926289cc1927308a67b 100644 --- a/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift +++ b/MiniScanner/Supporting Files/Frameworks/CustomWeScan/Scan/ScannerViewController.swift @@ -532,7 +532,7 @@ extension ScannerViewController: CustomTabBarViewDelegate { if multipageSession.scannedItems.isEmpty { self.navigationController?.popViewController(animated: false) } else { - let alertController = UIAlertController(title: "Alert", + let alertController = UIAlertController(title: .alert.localized, message: .discardScannerMsg.localized, preferredStyle: .alert) let okAction = UIAlertAction(title: .discard.localized, style: .destructive, handler: { [weak self] action in diff --git a/MiniScanner/Supporting Files/Localization/Localizable.xcstrings b/MiniScanner/Supporting Files/Localization/Localizable.xcstrings index 768326edd369f0484044dd055e6c74d11277a274..7088675674472d687ae617cb1e06b5c5174d128f 100644 --- a/MiniScanner/Supporting Files/Localization/Localizable.xcstrings +++ b/MiniScanner/Supporting Files/Localization/Localizable.xcstrings @@ -35,6 +35,17 @@ } } }, + "alert" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Alert" + } + } + } + }, "app_theme" : { "extractionState" : "manual", "localizations" : { @@ -80,6 +91,23 @@ } } }, + "back" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "رجوع" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Back" + } + } + } + }, "camera" : { "extractionState" : "manual", "localizations" : { @@ -114,6 +142,17 @@ } } }, + "continue" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Continue" + } + } + } + }, "current_page" : { "extractionState" : "manual", "localizations" : { @@ -199,6 +238,17 @@ } } }, + "delete_image_msg" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Are you sure you want to delete this image?" + } + } + } + }, "device_language" : { "extractionState" : "manual", "localizations" : { @@ -244,6 +294,20 @@ } } }, + "discard_changes_and_continue_msg" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Do you want to discard the changes you've made and continue?." + } + } + } + }, + "discard_changes_msg" : { + "extractionState" : "manual" + }, "discard_scanner_msg" : { "extractionState" : "manual", "localizations" : { @@ -510,6 +574,17 @@ } } }, + "ok" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Ok" + } + } + } + }, "preview" : { "extractionState" : "manual", "localizations" : {