locales.go 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package discordgo
  2. // Locale represents the accepted languages for Discord.
  3. // https://discord.com/developers/docs/reference#locales
  4. type Locale string
  5. // String returns the human-readable string of the locale
  6. func (l Locale) String() string {
  7. if name, ok := Locales[l]; ok {
  8. return name
  9. }
  10. return Unknown.String()
  11. }
  12. // All defined locales in Discord
  13. const (
  14. EnglishUS Locale = "en-US"
  15. EnglishGB Locale = "en-GB"
  16. Bulgarian Locale = "bg"
  17. ChineseCN Locale = "zh-CN"
  18. ChineseTW Locale = "zh-TW"
  19. Croatian Locale = "hr"
  20. Czech Locale = "cs"
  21. Danish Locale = "da"
  22. Dutch Locale = "nl"
  23. Finnish Locale = "fi"
  24. French Locale = "fr"
  25. German Locale = "de"
  26. Greek Locale = "el"
  27. Hindi Locale = "hi"
  28. Hungarian Locale = "hu"
  29. Italian Locale = "it"
  30. Japanese Locale = "ja"
  31. Korean Locale = "ko"
  32. Lithuanian Locale = "lt"
  33. Norwegian Locale = "no"
  34. Polish Locale = "pl"
  35. PortugueseBR Locale = "pt-BR"
  36. Romanian Locale = "ro"
  37. Russian Locale = "ru"
  38. SpanishES Locale = "es-ES"
  39. Swedish Locale = "sv-SE"
  40. Thai Locale = "th"
  41. Turkish Locale = "tr"
  42. Ukrainian Locale = "uk"
  43. Vietnamese Locale = "vi"
  44. Unknown Locale = ""
  45. )
  46. // Locales is a map of all the languages codes to their names.
  47. var Locales = map[Locale]string{
  48. EnglishUS: "English (United States)",
  49. EnglishGB: "English (Great Britain)",
  50. Bulgarian: "Bulgarian",
  51. ChineseCN: "Chinese (China)",
  52. ChineseTW: "Chinese (Taiwan)",
  53. Croatian: "Croatian",
  54. Czech: "Czech",
  55. Danish: "Danish",
  56. Dutch: "Dutch",
  57. Finnish: "Finnish",
  58. French: "French",
  59. German: "German",
  60. Greek: "Greek",
  61. Hindi: "Hindi",
  62. Hungarian: "Hungarian",
  63. Italian: "Italian",
  64. Japanese: "Japanese",
  65. Korean: "Korean",
  66. Lithuanian: "Lithuanian",
  67. Norwegian: "Norwegian",
  68. Polish: "Polish",
  69. PortugueseBR: "Portuguese (Brazil)",
  70. Romanian: "Romanian",
  71. Russian: "Russian",
  72. SpanishES: "Spanish (Spain)",
  73. Swedish: "Swedish",
  74. Thai: "Thai",
  75. Turkish: "Turkish",
  76. Ukrainian: "Ukrainian",
  77. Vietnamese: "Vietnamese",
  78. Unknown: "unknown",
  79. }