*: run go fmt

This commit is contained in:
Alexey Yerin 2021-05-11 11:33:29 +03:00
parent c792f7f570
commit b0c5f2c81d
2 changed files with 108 additions and 108 deletions

View File

@ -1,111 +1,111 @@
// Language code to name map lifted from py-googletrans: https://github.com/ssut/py-googletrans // Language code to name map lifted from py-googletrans: https://github.com/ssut/py-googletrans
package main package main
var Languages = map[string]string { var Languages = map[string]string{
"af": "afrikaans", "af": "afrikaans",
"sq": "albanian", "sq": "albanian",
"am": "amharic", "am": "amharic",
"ar": "arabic", "ar": "arabic",
"hy": "armenian", "hy": "armenian",
"az": "azerbaijani", "az": "azerbaijani",
"eu": "basque", "eu": "basque",
"be": "belarusian", "be": "belarusian",
"bn": "bengali", "bn": "bengali",
"bs": "bosnian", "bs": "bosnian",
"bg": "bulgarian", "bg": "bulgarian",
"ca": "catalan", "ca": "catalan",
"ceb": "cebuano", "ceb": "cebuano",
"ny": "chichewa", "ny": "chichewa",
"zh-CN": "chinese (simplified)", "zh-CN": "chinese (simplified)",
"co": "corsican", "co": "corsican",
"hr": "croatian", "hr": "croatian",
"cs": "czech", "cs": "czech",
"da": "danish", "da": "danish",
"nl": "dutch", "nl": "dutch",
"en": "english", "en": "english",
"eo": "esperanto", "eo": "esperanto",
"et": "estonian", "et": "estonian",
"tl": "filipino", "tl": "filipino",
"fi": "finnish", "fi": "finnish",
"fr": "french", "fr": "french",
"fy": "frisian", "fy": "frisian",
"gl": "galician", "gl": "galician",
"ka": "georgian", "ka": "georgian",
"de": "german", "de": "german",
"el": "greek", "el": "greek",
"gu": "gujarati", "gu": "gujarati",
"ht": "haitian creole", "ht": "haitian creole",
"ha": "hausa", "ha": "hausa",
"haw": "hawaiian", "haw": "hawaiian",
"iw": "hebrew", "iw": "hebrew",
"he": "hebrew", "he": "hebrew",
"hi": "hindi", "hi": "hindi",
"hmn": "hmong", "hmn": "hmong",
"hu": "hungarian", "hu": "hungarian",
"is": "icelandic", "is": "icelandic",
"ig": "igbo", "ig": "igbo",
"id": "indonesian", "id": "indonesian",
"ga": "irish", "ga": "irish",
"it": "italian", "it": "italian",
"ja": "japanese", "ja": "japanese",
"jw": "javanese", "jw": "javanese",
"kn": "kannada", "kn": "kannada",
"kk": "kazakh", "kk": "kazakh",
"km": "khmer", "km": "khmer",
"ko": "korean", "ko": "korean",
"ku": "kurdish (kurmanji)", "ku": "kurdish (kurmanji)",
"ky": "kyrgyz", "ky": "kyrgyz",
"lo": "lao", "lo": "lao",
"la": "latin", "la": "latin",
"lv": "latvian", "lv": "latvian",
"lt": "lithuanian", "lt": "lithuanian",
"lb": "luxembourgish", "lb": "luxembourgish",
"mk": "macedonian", "mk": "macedonian",
"mg": "malagasy", "mg": "malagasy",
"ms": "malay", "ms": "malay",
"ml": "malayalam", "ml": "malayalam",
"mt": "maltese", "mt": "maltese",
"mi": "maori", "mi": "maori",
"mr": "marathi", "mr": "marathi",
"mn": "mongolian", "mn": "mongolian",
"my": "myanmar (burmese)", "my": "myanmar (burmese)",
"ne": "nepali", "ne": "nepali",
"no": "norwegian", "no": "norwegian",
"or": "odia", "or": "odia",
"ps": "pashto", "ps": "pashto",
"fa": "persian", "fa": "persian",
"pl": "polish", "pl": "polish",
"pt": "portuguese", "pt": "portuguese",
"pa": "punjabi", "pa": "punjabi",
"ro": "romanian", "ro": "romanian",
"ru": "russian", "ru": "russian",
"sm": "samoan", "sm": "samoan",
"gd": "scots gaelic", "gd": "scots gaelic",
"sr": "serbian", "sr": "serbian",
"st": "sesotho", "st": "sesotho",
"sn": "shona", "sn": "shona",
"sd": "sindhi", "sd": "sindhi",
"si": "sinhala", "si": "sinhala",
"sk": "slovak", "sk": "slovak",
"sl": "slovenian", "sl": "slovenian",
"so": "somali", "so": "somali",
"es": "spanish", "es": "spanish",
"su": "sundanese", "su": "sundanese",
"sw": "swahili", "sw": "swahili",
"sv": "swedish", "sv": "swedish",
"tg": "tajik", "tg": "tajik",
"ta": "tamil", "ta": "tamil",
"te": "telugu", "te": "telugu",
"th": "thai", "th": "thai",
"tr": "turkish", "tr": "turkish",
"uk": "ukrainian", "uk": "ukrainian",
"ur": "urdu", "ur": "urdu",
"ug": "uyghur", "ug": "uyghur",
"uz": "uzbek", "uz": "uzbek",
"vi": "vietnamese", "vi": "vietnamese",
"cy": "welsh", "cy": "welsh",
"xh": "xhosa", "xh": "xhosa",
"yi": "yiddish", "yi": "yiddish",
"yo": "yoruba", "yo": "yoruba",
"zu": "zulu", "zu": "zulu",
} }

2
web.go
View File

@ -33,7 +33,7 @@ func CreateWebHandler(tmpl *template.Template, settings *TranslateSettings) func
translation, err := Translate(settings, from, to, text) translation, err := Translate(settings, from, to, text)
if err != nil { if err != nil {
w.WriteHeader(500) w.WriteHeader(500)
tmpl.ExecuteTemplate(w, "error", err); tmpl.ExecuteTemplate(w, "error", err)
return return
} }