translate.sh 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. display_help(){
  4. echo "Abkhazian ab"
  5. echo "Afar aa"
  6. echo "Afrikaans af"
  7. echo "Akan ak"
  8. echo "Albanian sq"
  9. echo "Amharic am"
  10. echo "Arabic ar"
  11. echo "Aragonese an"
  12. echo "Armenian hy"
  13. echo "Assamese as"
  14. echo "Avaric av"
  15. echo "Avestan ae"
  16. echo "Aymara ay"
  17. echo "Azerbaijani az"
  18. echo "Bambara bm"
  19. echo "Bashkir ba"
  20. echo "Basque eu"
  21. echo "Belarusian be"
  22. echo "Bengali bn"
  23. echo "Bislama bi"
  24. echo "Bosnian bs"
  25. echo "Breton br"
  26. echo "Bulgarian bg"
  27. echo "Burmese my"
  28. echo "Catalan, Valencian ca"
  29. echo "Chamorro ch"
  30. echo "Chechen ce"
  31. echo "Chichewa, Chewa, Nyanja ny"
  32. echo "Chinese zh"
  33. echo "Church Slavic, Old Slavonic, Church Slavonic, Old Bulgarian, Old Church Slavonic cu"
  34. echo "Chuvash cv"
  35. echo "Cornish kw"
  36. echo "Corsican co"
  37. echo "Cree cr"
  38. echo "Croatian hr"
  39. echo "Czech cs"
  40. echo "Danish da"
  41. echo "Divehi, Dhivehi, Maldivian dv"
  42. echo "Dutch, Flemish nl"
  43. echo "Dzongkha dz"
  44. echo "English en"
  45. echo "Esperanto eo"
  46. echo "Estonian et"
  47. echo "Ewe ee"
  48. echo "Faroese fo"
  49. echo "Fijian fj"
  50. echo "Finnish fi"
  51. echo "French fr"
  52. echo "Western Frisian fy"
  53. echo "Fulah ff"
  54. echo "Gaelic, Scottish Gaelic gd"
  55. echo "Galician gl"
  56. echo "Ganda lg"
  57. echo "Georgian ka"
  58. echo "German de"
  59. echo "Greek, Modern (1453–) el"
  60. echo "Kalaallisut, Greenlandic kl"
  61. echo "Guarani gn"
  62. echo "Gujarati gu"
  63. echo "Haitian, Haitian Creole ht"
  64. echo "Hausa ha"
  65. echo "Hebrew he"
  66. echo "Herero hz"
  67. echo "Hindi hi"
  68. echo "Hiri Motu ho"
  69. echo "Hungarian hu"
  70. echo "Icelandic is"
  71. echo "Ido io"
  72. echo "Igbo ig"
  73. echo "Indonesian id"
  74. echo "Interlingua (International Auxiliary Language Association) ia"
  75. echo "Interlingue, Occidental ie"
  76. echo "Inuktitut iu"
  77. echo "Inupiaq ik"
  78. echo "Irish ga"
  79. echo "Italian it"
  80. echo "Japanese ja"
  81. echo "Javanese jv"
  82. echo "Kannada kn"
  83. echo "Kanuri kr"
  84. echo "Kashmiri ks"
  85. echo "Kazakh kk"
  86. echo "Central Khmer km"
  87. echo "Kikuyu, Gikuyu ki"
  88. echo "Kinyarwanda rw"
  89. echo "Kirghiz, Kyrgyz ky"
  90. echo "Komi kv"
  91. echo "Kongo kg"
  92. echo "Korean ko"
  93. echo "Kuanyama, Kwanyama kj"
  94. echo "Kurdish ku"
  95. echo "Lao lo"
  96. echo "Latin la"
  97. echo "Latvian lv"
  98. echo "Limburgan, Limburger, Limburgish li"
  99. echo "Lingala ln"
  100. echo "Lithuanian lt"
  101. echo "Luba-Katanga lu"
  102. echo "Luxembourgish, Letzeburgesch lb"
  103. echo "Macedonian mk"
  104. echo "Malagasy mg"
  105. echo "Malay ms"
  106. echo "Malayalam ml"
  107. echo "Maltese mt"
  108. echo "Manx gv"
  109. echo "Maori mi"
  110. echo "Marathi mr"
  111. echo "Marshallese mh"
  112. echo "Mongolian mn"
  113. echo "Nauru na"
  114. echo "Navajo, Navaho nv"
  115. echo "North Ndebele nd"
  116. echo "South Ndebele nr"
  117. echo "Ndonga ng"
  118. echo "Nepali ne"
  119. echo "Norwegian no"
  120. echo "Norwegian Bokmål nb"
  121. echo "Norwegian Nynorsk nn"
  122. echo "Sichuan Yi, Nuosu ii"
  123. echo "Occitan oc"
  124. echo "Ojibwa oj"
  125. echo "Oriya or"
  126. echo "Oromo om"
  127. echo "Ossetian, Ossetic os"
  128. echo "Pali pi"
  129. echo "Pashto, Pushto ps"
  130. echo "Persian fa"
  131. echo "Polish pl"
  132. echo "Portuguese pt"
  133. echo "Punjabi, Panjabi pa"
  134. echo "Quechua qu"
  135. echo "Romanian, Moldavian, Moldovan ro"
  136. echo "Romansh rm"
  137. echo "Rundi rn"
  138. echo "Russian ru"
  139. echo "Northern Sami se"
  140. echo "Samoan sm"
  141. echo "Sango sg"
  142. echo "Sanskrit sa"
  143. echo "Sardinian sc"
  144. echo "Serbian sr"
  145. echo "Shona sn"
  146. echo "Sindhi sd"
  147. echo "Sinhala, Sinhalese si"
  148. echo "Slovak sk"
  149. echo "Slovenian sl"
  150. echo "Somali so"
  151. echo "Southern Sotho st"
  152. echo "Spanish, Castilian es"
  153. echo "Sundanese su"
  154. echo "Swahili sw"
  155. echo "Swati ss"
  156. echo "Swedish sv"
  157. echo "Tagalog tl"
  158. echo "Tahitian ty"
  159. echo "Tajik tg"
  160. echo "Tamil ta"
  161. echo "Tatar tt"
  162. echo "Telugu te"
  163. echo "Thai th"
  164. echo "Tibetan bo"
  165. echo "Tigrinya ti"
  166. echo "Tonga (Tonga Islands) to"
  167. echo "Tsonga ts"
  168. echo "Tswana tn"
  169. echo "Turkish tr"
  170. echo "Turkmen tk"
  171. echo "Twi tw"
  172. echo "Uighur, Uyghur ug"
  173. echo "Ukrainian uk"
  174. echo "Urdu ur"
  175. echo "Uzbek uz"
  176. echo "Venda ve"
  177. echo "Vietnamese vi"
  178. echo "Volapük vo"
  179. echo "Walloon wa"
  180. echo "Welsh cy"
  181. echo "Wolof wo"
  182. echo "Xhosa xh"
  183. echo "Yiddish yi"
  184. echo "Yoruba yo"
  185. echo "Zhuang, Chuang za"
  186. echo "Zulu zu"
  187. exit 2
  188. }
  189. [[ $# -lt 2 ]] && display_help
  190. from=""
  191. to="$1"
  192. trans -no-ansi -no-auto -brief "${from}:${to}" "${*:2}"