Skip to content

Commit

Permalink
Update Easydict/Feature/Service/Caiyun/CaiyunService.swift
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle <[email protected]>
  • Loading branch information
tisfeng and Kyle-Ye authored Nov 14, 2023
1 parent d9de4e4 commit ed454b0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Easydict/Feature/Service/Caiyun/CaiyunService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,14 @@ public final class CaiyunService: QueryService {
override public func supportLanguagesDictionary() -> MMOrderedDictionary<AnyObject, AnyObject> {
// TODO: Replace MMOrderedDictionary in the API
let orderedDict = MMOrderedDictionary<AnyObject, AnyObject>()
let keys = ["auto", "zh", "en", "ja"]
let values = [Language.auto, Language.simplifiedChinese, Language.english, Language.japanese]
for (index, key) in keys.enumerated() {
orderedDict.setObject(key as NSString, forKey: values[index].rawValue as NSString)
let dic: [Language: String] = [
.auto: "auto",
.simplifiedChinese: "zh",
.english: "en",
.japanese: "ja",
]
dic.forEach { key, value in
orderedDict.setObject(value as NSString, forKey: key.rawValue as NSString)
}
return orderedDict
}
Expand Down

0 comments on commit ed454b0

Please sign in to comment.