diff --git a/MiniScanner/Extensions/String+StringKeys.swift b/MiniScanner/Extensions/String+StringKeys.swift index 1a44af29dd90d962ad8ddfb813de5c68ec04aab9..6615d5f7b2541e984afa8a52a1cfeee98daa70a3 100644 --- a/MiniScanner/Extensions/String+StringKeys.swift +++ b/MiniScanner/Extensions/String+StringKeys.swift @@ -89,4 +89,10 @@ extension String { static let edit = "edit" static let exportText = "export_text" static let signature = "signature" + + static let copy = "copy" + static let copiedToClipboard = "copied_to_clipboard" + static let signMsg = "sign_msg" + static let allDocument = "all_document" + static let add = "add" } diff --git a/MiniScanner/Modules/EditViewController/EditViewController.swift b/MiniScanner/Modules/EditViewController/EditViewController.swift index 71931283f90f8eb38b4139a7d103df49852fc8c5..94c30b2aec647458bef9a54c8972cbfb57328664 100644 --- a/MiniScanner/Modules/EditViewController/EditViewController.swift +++ b/MiniScanner/Modules/EditViewController/EditViewController.swift @@ -138,7 +138,7 @@ public class EditViewController: UIViewController { } } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.dismiss(animated: true) } @@ -308,7 +308,7 @@ public class EditViewController: UIViewController { } } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.dismiss(animated: true) } @@ -381,7 +381,7 @@ public class EditViewController: UIViewController { } } isCropping = true - let cropButton = UIBarButtonItem(title: "Crop", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let cropButton = UIBarButtonItem(title: .crop.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = cropButton @@ -465,7 +465,7 @@ extension EditViewController: BannerViewDelegate { self.dismiss(animated: true) } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.dismiss(animated: true) } @@ -569,9 +569,9 @@ extension EditViewController: EPSignatureDelegate { self.banner.isEditing = true self.signatureImage = signatureImage if (self.scanSession?.scannedItems.count ?? 0) > 1 { - let alertController = UIAlertController(title: "", message: "Do you want to sign:", preferredStyle: .alert) + let alertController = UIAlertController(title: "", message: .signMsg.localized, preferredStyle: .alert) - let allAction = UIAlertAction(title: "All document", style: .default) { (action) in + let allAction = UIAlertAction(title: .allDocument, style: .default) { (action) in if let items = self.scanSession?.scannedItems { for (index, _) in items.enumerated() { @@ -584,13 +584,13 @@ extension EditViewController: EPSignatureDelegate { self.banner.pagerView.reloadData() } - let addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let addButton = UIBarButtonItem(title: .add.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = addButton self.dismiss(animated: true) } - let currentAction = UIAlertAction(title: "Current page", style: .default) { (action) in + let currentAction = UIAlertAction(title: .currentPage.localized, style: .default) { (action) in if let items = self.scanSession?.scannedItems { for (index, _) in items.enumerated() { if index == self.banner.pagerView.currentIndex { @@ -604,11 +604,11 @@ extension EditViewController: EPSignatureDelegate { self.banner.pagerView.reloadData() } - let addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let addButton = UIBarButtonItem(title: .add.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = addButton self.dismiss(animated: true) } - let cancelAction = UIAlertAction(title: "Cancel", style: .cancel) { (action) in + let cancelAction = UIAlertAction(title: .cancel.localized, style: .cancel) { (action) in self.banner.isEditing = false self.dismiss(animated: true) } @@ -632,7 +632,7 @@ extension EditViewController: EPSignatureDelegate { self.banner.pagerView.reloadData() } - let addButton = UIBarButtonItem(title: "Add", style: .plain, target: self, action: #selector(self.onTouchDoneButton)) + let addButton = UIBarButtonItem(title: .add.localized, style: .plain, target: self, action: #selector(self.onTouchDoneButton)) self.navigationItem.rightBarButtonItem = addButton self.dismiss(animated: true) } diff --git a/MiniScanner/Modules/OCRViewController/OCRViewController.swift b/MiniScanner/Modules/OCRViewController/OCRViewController.swift index 7bc835835f363ff11c4889b9cea9687711fd6780..98990c3f9d565cda309dbe238d9ae2a1d0ed159a 100644 --- a/MiniScanner/Modules/OCRViewController/OCRViewController.swift +++ b/MiniScanner/Modules/OCRViewController/OCRViewController.swift @@ -26,7 +26,7 @@ class OCRViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() recognizeText() - let co = UIBarButtonItem(title: "Copy", style: .plain, target: self, action: #selector(copyText)) + let co = UIBarButtonItem(title: .copy.localized, style: .plain, target: self, action: #selector(copyText)) self.navigationItem.rightBarButtonItem = co let handler = VNImageRequestHandler(cgImage: ocrImage.cgImage!, options: [:]) @@ -39,7 +39,7 @@ class OCRViewController: UIViewController { @objc func copyText() { UIPasteboard.general.string = self.ocrTextView.text - self.view.makeToast("Copied to clipboard!") + self.view.makeToast(.copiedToClipboard.localized) } diff --git a/MiniScanner/Supporting Files/Localization/Localizable.xcstrings b/MiniScanner/Supporting Files/Localization/Localizable.xcstrings index b2b50f1d019419c3172c0d0117af3c87141f65af..610bda2eda8ce498abeb7ce34103e23c67d4f89e 100644 --- a/MiniScanner/Supporting Files/Localization/Localizable.xcstrings +++ b/MiniScanner/Supporting Files/Localization/Localizable.xcstrings @@ -72,6 +72,23 @@ } } }, + "add" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "إضافة" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Add" + } + } + } + }, "add_folder" : { "extractionState" : "manual", "localizations" : { @@ -109,6 +126,12 @@ "alert" : { "extractionState" : "manual", "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "تنبيه" + } + }, "en" : { "stringUnit" : { "state" : "translated", @@ -117,6 +140,23 @@ } } }, + "all_document" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "كامل المستند" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "All document" + } + } + } + }, "app_theme" : { "extractionState" : "manual", "localizations" : { @@ -230,6 +270,34 @@ } } }, + "copied_to_clipboard" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Copied to clipboard!" + } + } + } + }, + "copy" : { + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "نسخ" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Copy" + } + } + } + }, "crop" : { "extractionState" : "manual", "localizations" : { @@ -335,6 +403,12 @@ "delete_image_msg" : { "extractionState" : "manual", "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل أنت متأكد أنك تريد حذف هذه الصورة؟" + } + }, "en" : { "stringUnit" : { "state" : "translated", @@ -408,6 +482,12 @@ "discard_changes_and_continue_msg" : { "extractionState" : "manual", "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل تريد تجاهل التعديلات التي قمت بها والمتابعة؟" + } + }, "en" : { "stringUnit" : { "state" : "translated", @@ -417,7 +497,21 @@ } }, "discard_changes_msg" : { - "extractionState" : "manual" + "extractionState" : "manual", + "localizations" : { + "ar" : { + "stringUnit" : { + "state" : "translated", + "value" : "هل تريد تجاهل التعديلات التي قمت بها؟" + } + }, + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Do you want to discard the changes you've made?" + } + } + } }, "discard_scanner_msg" : { "extractionState" : "manual", @@ -826,6 +920,17 @@ } } }, + "sign_msg" : { + "extractionState" : "manual", + "localizations" : { + "en" : { + "stringUnit" : { + "state" : "translated", + "value" : "Do you want to sign:" + } + } + } + }, "signature" : { "extractionState" : "manual", "localizations" : {