Skip to content

Commit

Permalink
Merge pull request #10 from ezisazis/singleLanguage
Browse files Browse the repository at this point in the history
Add support for single language localization
  • Loading branch information
s4cha authored Feb 19, 2018
2 parents 97282ec + 60296b6 commit c33dfbd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Localize.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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]()
Expand Down

0 comments on commit c33dfbd

Please sign in to comment.