mozhi/utils/langlist-watson.go

247 lines
2.9 KiB
Go
Raw Normal View History

2023-07-22 14:20:21 +00:00
package utils
func LangListWatson(listType string) []List {
// IDs got from https://www.loc.gov/standards/iso639-2/php/code_list.php and tested to make sure they work. Exceptions fr-CA zh-CN/TW
2023-08-27 14:24:30 +00:00
ListData := []List{
{
2023-07-22 14:20:21 +00:00
Id: "ar",
Name: "Arabic",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ba",
Name: "Basque",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "bn",
Name: "Bengali",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "bs",
Name: "Bosnian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "bg",
Name: "Bulgarian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ca",
Name: "Catalan",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "zh",
Name: "Chinese (Simplified)",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "zh-TW",
Name: "Chinese (Traditional)",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "hr",
Name: "Croatian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "cs",
Name: "Czech",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "da",
Name: "Danish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "nl",
Name: "Dutch",
},
2023-08-27 14:24:30 +00:00
{
Id: "en",
Name: "English",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "et",
Name: "Estonian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "fi",
Name: "Finnish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "fr",
Name: "French",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "fr-CA",
Name: "Canadian French",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "de",
Name: "German",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "el",
Name: "Greek",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "gu",
Name: "Gujarati",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "he",
Name: "Hebrew",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "hi",
Name: "Hindi",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "hu",
Name: "Hungarian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "id",
Name: "Indonesian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ga",
Name: "Irish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "it",
Name: "Italian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ja",
Name: "Japanese",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "kn",
Name: "Kannada",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ko",
Name: "Korean",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "lv",
Name: "Latvian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "lt",
Name: "Lithuanian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ms",
Name: "Malay",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ml",
Name: "Malayalam",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "mt",
Name: "Maltese",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "mr",
Name: "Marathi",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "cnr",
Name: "Montenegrin",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ne",
Name: "Nepali",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "nb",
Name: "Norwegian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "pl",
Name: "Polish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "pt",
Name: "Portugese",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "pa",
Name: "Punjabi",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ro",
Name: "Romanian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ru",
Name: "Russian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "sr",
Name: "Serbian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "si",
Name: "Sinhalese",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "sk",
Name: "Slovak",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "sl",
Name: "Slovenian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "es",
Name: "Spanish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "sv",
Name: "Swedish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ta",
Name: "Tamil",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "te",
Name: "Telugu",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "th",
Name: "Thai",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "tr",
Name: "Turkish",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "uk",
Name: "Ukrainian",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "ur",
Name: "Urdu",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "vi",
Name: "Vietnamese",
},
2023-08-27 14:24:30 +00:00
{
2023-07-22 14:20:21 +00:00
Id: "cy",
Name: "Welsh",
},
}
2023-08-27 16:58:34 +00:00
var ListD []List
if listType == "sl" {
2023-08-27 16:58:34 +00:00
auto := []List{{
Id: "auto",
Name: "Detect Language",
2023-08-27 16:58:34 +00:00
}}
ListD = append(append([]List{}, auto...), ListData...)
2023-08-28 15:11:57 +00:00
} else {
ListD = ListData
}
2023-08-27 16:58:34 +00:00
return ListD
2023-07-22 14:20:21 +00:00
}