-
Notifications
You must be signed in to change notification settings - Fork 231
/
my_language.go
66 lines (62 loc) · 1.94 KB
/
my_language.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package language
// MyLanguage 语言类型,注意,这里默认还是查找的是中文字幕,只不过下载的时候可能附带了其他的
type MyLanguage int
const (
Unknown MyLanguage = iota // 未知语言
ChineseSimple // 简体中文
ChineseTraditional // 繁体中文
ChineseSimpleEnglish // 简英双语字幕
ChineseTraditionalEnglish // 繁英双语字幕
English // 英文
Japanese // 日语
ChineseSimpleJapanese // 简日双语字幕
ChineseTraditionalJapanese // 繁日双语字幕
Korean // 韩语
ChineseSimpleKorean // 简韩双语字幕
ChineseTraditionalKorean // 繁韩双语字幕
)
const (
MathLangChnUnknown = "未知语言"
MatchLangDouble = "双语"
MatchLangChs = "简"
MatchLangCht = "繁"
MatchLangChsEn = "简英"
MatchLangChtEn = "繁英"
MatchLangEn = "英"
MatchLangJp = "日"
MatchLangChsJp = "简日"
MatchLangChtJp = "繁日"
MatchLangKr = "韩"
MatchLangChsKr = "简韩"
MatchLangChtKr = "繁韩"
)
func (l MyLanguage) String() string {
switch l {
case ChineseSimple:
// 简
return MatchLangChs
case ChineseTraditional:
// 繁
return MatchLangCht
case ChineseSimpleEnglish:
return MatchLangChsEn
case ChineseTraditionalEnglish:
return MatchLangChtEn
case English:
return MatchLangEn
case Japanese:
return MatchLangJp
case ChineseSimpleJapanese:
return MatchLangChsJp
case ChineseTraditionalJapanese:
return MatchLangChtJp
case Korean:
return MatchLangKr
case ChineseSimpleKorean:
return MatchLangChsKr
case ChineseTraditionalKorean:
return MatchLangChtKr
default:
return MathLangChnUnknown
}
}