Skip to content

Commit

Permalink
Preserve order of generated keys in stringsdict plurals file
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Krasnocka committed Apr 11, 2023
1 parent c85924d commit d7152c2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion LocsUtil/LocsGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class LocsGenerator: NSObject {
var xlsxReader: XlsxReader
let langRowIndex = 0 // Language definitions - row index in XSLSX document
let keyColumnId = "A" // Key definitions - column index in XSLSX document
let version = "2.46"
let version = "2.47"

override init() {
// csvReader = CsvReader()
Expand Down
4 changes: 3 additions & 1 deletion LocsUtil/PluralsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ func computePlurals(pluralKeyValues: [String: String]) -> [Plural] {
print("Skipping plural for \(pluralKey) key")
}
}
return plurals
return plurals.sorted { pl1, pl2 in
pl1.key < pl2.key
}
}

func generatePluralsFile(pluralKeyValues: [String: String]) -> String? {
Expand Down

0 comments on commit d7152c2

Please sign in to comment.