diff --git a/Sources/Camera/CameraView.swift b/Sources/Camera/CameraView.swift index 2b223c63..08376675 100644 --- a/Sources/Camera/CameraView.swift +++ b/Sources/Camera/CameraView.swift @@ -174,9 +174,9 @@ class CameraView: UIView, UIGestureRecognizerDelegate { func makeFlashButton() -> TripleButton { let states: [TripleButton.ButtonState] = [ - TripleButton.ButtonState(title: "Gallery.Camera.Flash.Off".g_localize(fallback: "OFF"), image: GalleryBundle.image("gallery_camera_flash_off")!), - TripleButton.ButtonState(title: "Gallery.Camera.Flash.On".g_localize(fallback: "ON"), image: GalleryBundle.image("gallery_camera_flash_on")!), - TripleButton.ButtonState(title: "Gallery.Camera.Flash.Auto".g_localize(fallback: "AUTO"), image: GalleryBundle.image("gallery_camera_flash_auto")!) + TripleButton.ButtonState(title: Config.TextsConfig.cameraFlashOff, image: GalleryBundle.image("gallery_camera_flash_off")!), + TripleButton.ButtonState(title: Config.TextsConfig.cameraFlashOn, image: GalleryBundle.image("gallery_camera_flash_on")!), + TripleButton.ButtonState(title: Config.TextsConfig.cameraFlashAuto, image: GalleryBundle.image("gallery_camera_flash_auto")!) ] let button = TripleButton(states: states) @@ -223,7 +223,7 @@ class CameraView: UIView, UIGestureRecognizerDelegate { button.setTitleColor(UIColor.white, for: UIControl.State()) button.setTitleColor(UIColor.lightGray, for: .disabled) button.titleLabel?.font = Config.Font.Text.regular.withSize(16) - button.setTitle("Gallery.Done".g_localize(fallback: "Done"), for: UIControl.State()) + button.setTitle(Config.TextsConfig.doneButton, for: UIControl.State()) return button } diff --git a/Sources/Gallery/GalleryController.swift b/Sources/Gallery/GalleryController.swift index f442b066..02637ef7 100644 --- a/Sources/Gallery/GalleryController.swift +++ b/Sources/Gallery/GalleryController.swift @@ -48,21 +48,21 @@ public class GalleryController: UIViewController, PermissionControllerDelegate { func makeImagesController() -> ImagesController { let controller = ImagesController(cart: cart) - controller.title = "Gallery.Images.Title".g_localize(fallback: "PHOTOS") + controller.title = Config.TextsConfig.imagesTitle return controller } func makeCameraController() -> CameraController { let controller = CameraController(cart: cart) - controller.title = "Gallery.Camera.Title".g_localize(fallback: "CAMERA") + controller.title = Config.TextsConfig.cameraTitle return controller } func makeVideosController() -> VideosController { let controller = VideosController(cart: cart) - controller.title = "Gallery.Videos.Title".g_localize(fallback: "VIDEOS") + controller.title = Config.TextsConfig.videoTitle return controller } diff --git a/Sources/Utils/Config.swift b/Sources/Utils/Config.swift index 07dbc955..97ab99a3 100644 --- a/Sources/Utils/Config.swift +++ b/Sources/Utils/Config.swift @@ -115,4 +115,19 @@ public struct Config { public static var portraitSize: CGSize = CGSize(width: 360, height: 640) public static var landscapeSize: CGSize = CGSize(width: 640, height: 360) } + + public struct TextsConfig { + public static var cameraFlashOff = "Gallery.Camera.Flash.Off".g_localize(fallback: "OFF") + public static var cameraFlashOn = "Gallery.Camera.Flash.On".g_localize(fallback: "ON") + public static var cameraFlashAuto = "Gallery.Camera.Flash.Auto".g_localize(fallback: "AUTO") + public static var doneButton = "Gallery.Done".g_localize(fallback: "Done") + public static var imagesTitle = "Gallery.Images.Title".g_localize(fallback: "PHOTOS") + public static var cameraTitle = "Gallery.Camera.Title".g_localize(fallback: "CAMERA") + public static var videoTitle = "Gallery.Videos.Title".g_localize(fallback: "VIDEOS") + public static var cameraAndGalleryPermission = "GalleryAndCamera.Permission.Info".g_localize(fallback: "Please grant access to photos and the camera.") + public static var galleryPermission = "Gallery.Permission.Info".g_localize(fallback: "Please grant access to photos.") + public static var permisionButton = "Gallery.Permission.Button".g_localize(fallback: "Go to Settings") + public static var emptyView = "Gallery.EmptyView.Text".g_localize(fallback: "Nothing to show") + public static var allVideos = "Gallery.AllVideos".g_localize(fallback: "ALL VIDEOS") + } } diff --git a/Sources/Utils/Permission/PermissionView.swift b/Sources/Utils/Permission/PermissionView.swift index 1a9598c4..b56872e9 100644 --- a/Sources/Utils/Permission/PermissionView.swift +++ b/Sources/Utils/Permission/PermissionView.swift @@ -49,9 +49,9 @@ class PermissionView: UIView { label.textColor = Config.Permission.textColor label.font = Config.Font.Text.regular.withSize(14) if Permission.Camera.needsPermission { - label.text = "GalleryAndCamera.Permission.Info".g_localize(fallback: "Please grant access to photos and the camera.") + label.text = Config.TextsConfig.cameraAndGalleryPermission } else { - label.text = "Gallery.Permission.Info".g_localize(fallback: "Please grant access to photos.") + label.text = Config.TextsConfig.galleryPermission } label.textAlignment = .center label.numberOfLines = 0 @@ -62,7 +62,7 @@ class PermissionView: UIView { func makeSettingButton() -> UIButton { let button = UIButton(type: .custom) - button.setTitle("Gallery.Permission.Button".g_localize(fallback: "Go to Settings").uppercased(), + button.setTitle(Config.TextsConfig.permisionButton.uppercased(), for: UIControl.State()) button.backgroundColor = Config.Permission.Button.backgroundColor button.titleLabel?.font = Config.Font.Main.medium.withSize(16) diff --git a/Sources/Utils/View/EmptyView.swift b/Sources/Utils/View/EmptyView.swift index 9b6bb6eb..474abdd7 100644 --- a/Sources/Utils/View/EmptyView.swift +++ b/Sources/Utils/View/EmptyView.swift @@ -35,7 +35,7 @@ class EmptyView: UIView { let label = UILabel() label.textColor = Config.EmptyView.textColor label.font = Config.Font.Text.regular.withSize(14) - label.text = "Gallery.EmptyView.Text".g_localize(fallback: "Nothing to show") + label.text = Config.TextsConfig.emptyView return label } diff --git a/Sources/Utils/View/GridView.swift b/Sources/Utils/View/GridView.swift index d9bc11a9..f2c096d8 100644 --- a/Sources/Utils/View/GridView.swift +++ b/Sources/Utils/View/GridView.swift @@ -130,7 +130,7 @@ class GridView: UIView { button.setTitleColor(UIColor.white, for: UIControl.State()) button.setTitleColor(UIColor.lightGray, for: .disabled) button.titleLabel?.font = Config.Font.Text.regular.withSize(16) - button.setTitle("Gallery.Done".g_localize(fallback: "Done"), for: UIControl.State()) + button.setTitle(Config.TextsConfig.doneButton, for: UIControl.State()) return button } diff --git a/Sources/Videos/VideosController.swift b/Sources/Videos/VideosController.swift index f056f41d..cc467f9b 100644 --- a/Sources/Videos/VideosController.swift +++ b/Sources/Videos/VideosController.swift @@ -60,7 +60,7 @@ class VideosController: UIViewController { gridView.collectionView.delegate = self gridView.collectionView.register(VideoCell.self, forCellWithReuseIdentifier: String(describing: VideoCell.self)) - gridView.arrowButton.updateText("Gallery.AllVideos".g_localize(fallback: "ALL VIDEOS")) + gridView.arrowButton.updateText(Config.TextsConfig.allVideos) gridView.arrowButton.arrow.isHidden = true }