From 60296b6a81afa214b8f14ad89116594e47feb026 Mon Sep 17 00:00:00 2001 From: jonas-levente Date: Mon, 19 Feb 2018 22:07:38 +0100 Subject: [PATCH] Add support for single language localization --- Localize.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Localize.swift b/Localize.swift index 400c4f3..ec035b4 100755 --- a/Localize.swift +++ b/Localize.swift @@ -53,8 +53,10 @@ let masterLanguage = "en" */ let sanitizeFiles = true - - +/* + Determines if there are multiple localizations or not. + */ +let singleLanguage = false // MARK: - End Of Configurable Section @@ -108,7 +110,7 @@ struct LocalizationFiles { removeEmptyLinesFromFile() sortLinesAlphabetically() } - let location = "\(path)/\(name).lproj/Localizable.strings" + let location = singleLanguage ? "\(path)/Localizable.strings" : "\(path)/\(name).lproj/Localizable.strings" if let string = try? String(contentsOfFile: location, encoding: .utf8) { let lines = string.components(separatedBy: CharacterSet.newlines) keyValue = [String:String]()