MCPcopy
hub / github.com/syncthing/syncthing / reformatLanguageCode

Function reformatLanguageCode

script/weblatedl.go:99–116  ·  view source on GitHub ↗
(origCode string)

Source from the content-addressed store, hash-verified

97}
98
99func reformatLanguageCode(origCode string) string {
100 switch origCode {
101 case "ko":
102 return "ko-KR"
103 case "nb_NO":
104 return "nb"
105 case "ro":
106 return "ro-RO"
107 case "zh_Hans":
108 return "zh-CN"
109 case "zh_Hant":
110 return "zh-TW"
111 case "zh_Hant_HK":
112 return "zh-HK"
113 default:
114 return strings.Replace(origCode, "_", "-", 1)
115 }
116}
117
118func saveValidLangs(langs []string) {
119 slices.Sort(langs)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected