Skip to content

Commit

Permalink
only send two digit ISO language code even if longer version is avail…
Browse files Browse the repository at this point in the history
…able (server double checks this as well for all clients)
  • Loading branch information
hburgund committed Feb 2, 2018
1 parent b3d7c24 commit 487c19c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion RWFramework/RWFramework/RWFramework.swift
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,12 @@ private lazy var __once: () = { () -> Void in

/// Return the preferred language of the device
func preferredLanguage() -> String {
return Locale.preferredLanguages[0]
let preferredLanguage = Locale.preferredLanguages[0] as String
let arr = preferredLanguage.components(separatedBy: "-")
if let deviceLanguage = arr.first {
return deviceLanguage
}
return "en"
}

/// Convert a Double to a String but return an empty string if the Double is 0
Expand Down

0 comments on commit 487c19c

Please sign in to comment.