Skip to content

Commit

Permalink
perf: optimize MMOrderedDictionary logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Jerry23011 committed Nov 29, 2023
1 parent 6049ca6 commit 5e36d46
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions Easydict/Feature/Service/Tencent/TencentService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,7 @@ public final class TencentService: QueryService {
override public func supportLanguagesDictionary() -> MMOrderedDictionary<AnyObject, AnyObject> {
// TODO: Replace MMOrderedDictionary in the API
let orderedDict = MMOrderedDictionary<AnyObject, AnyObject>()
let dic: [Language: String] = [
.auto: "auto",
.simplifiedChinese: "zh",
.traditionalChinese: "zh-TW",
.english: "en",
.japanese: "ja",
.korean: "ko",
.french: "fr",
.spanish: "es",
.italian: "it",
.german: "de",
.turkish: "tr",
.russian: "ru",
.portuguese: "pt",
.vietnamese: "vi",
.indonesian: "id",
.thai: "th",
.malay: "ms",
.arabic: "ar",
.hindi: "hi",
]
dic.forEach { key, value in
TencentTranslateType.supportLanguagesDictionary.forEach { key, value in
orderedDict.setObject(value as NSString, forKey: key.rawValue as NSString)
}
return orderedDict
Expand Down

0 comments on commit 5e36d46

Please sign in to comment.