tranghaviet

trans.sh

May 24th, 2018
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 188.05 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. export TRANS_ENTRY="$0"
  3. if [[ ! $LANG =~ (UTF|utf)-?8$ ]]; then export LANG=en_US.UTF-8; fi
  4. read -r -d '' TRANS_PROGRAM << 'EOF'
  5. BEGIN {
  6. Name        = "Translate Shell"
  7. Description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc."
  8. Version     = "0.9.6.6"
  9. ReleaseDate = "2017-12-17"
  10. Command     = "trans"
  11. EntryPoint  = "translate.awk"
  12. EntryScript = "translate"
  13. }
  14. function initConst() {
  15. NULLSTR = ""
  16. TRUE = 1
  17. STDIN  = "/dev/stdin"
  18. STDOUT = "/dev/stdout"
  19. STDERR = "/dev/stderr"
  20. SUPOUT = " > /dev/null "
  21. SUPERR = " 2> /dev/null "
  22. PIPE = " | "
  23. }
  24. function anything(array,
  25. i) {
  26. for (i in array)
  27. if (array[i]) return 1
  28. return 0
  29. }
  30. function exists(value) {
  31. if (isarray(value))
  32. return anything(value)
  33. else
  34. return value ? 1 : 0
  35. }
  36. function belongsTo(element, array,
  37. i) {
  38. for (i in array)
  39. if (element == array[i]) return element
  40. return NULLSTR
  41. }
  42. function identical(x, y,
  43. i) {
  44. if (!isarray(x) && !isarray(y))
  45. return x == y
  46. else if (isarray(x) && isarray(y)) {
  47. if (length(x) != length(y)) return 0
  48. for (i in x)
  49. if (!identical(x[i], y[i])) return 0
  50. return 1
  51. } else
  52. return 0
  53. }
  54. function append(array, element) {
  55. array[anything(array) ? length(array) : 0] = element
  56. }
  57. function compareByIndexFields(i1, v1, i2, v2,
  58. t1, t2, tl, j) {
  59. split(i1, t1, SUBSEP)
  60. split(i2, t2, SUBSEP)
  61. tl = length(t1) < length(t2) ? length(t1) : length(t2)
  62. for (j = 1; j <= tl; j++) {
  63. if (t1[j] < t2[j])
  64. return -1
  65. else if (t1[j] > t2[j])
  66. return 1
  67. }
  68. return 0
  69. }
  70. function isnum(string) {
  71. return string == string + 0
  72. }
  73. function startsWithAny(string, substrings,
  74. i) {
  75. for (i in substrings)
  76. if (index(string, substrings[i]) == 1) return substrings[i]
  77. return NULLSTR
  78. }
  79. function matchesAny(string, patterns,
  80. i) {
  81. for (i in patterns)
  82. if (string ~ "^" patterns[i]) return patterns[i]
  83. return NULLSTR
  84. }
  85. function replicate(string, len,
  86. i, temp) {
  87. temp = NULLSTR
  88. for (i = 0; i < len; i++)
  89. temp = temp string
  90. return temp
  91. }
  92. function reverse(string,
  93. i, temp) {
  94. temp = NULLSTR
  95. for (i = length(string); i > 0; i--)
  96. temp = temp substr(string, i, 1);
  97. return temp
  98. }
  99. function join(array, separator, sortedIn, preserveNull,
  100. i, j, saveSortedIn, temp) {
  101. if (!sortedIn)
  102. sortedIn = "compareByIndexFields"
  103. temp = NULLSTR
  104. j = 0
  105. if (isarray(array)) {
  106. saveSortedIn = PROCINFO["sorted_in"]
  107. PROCINFO["sorted_in"] = sortedIn
  108. for (i in array)
  109. if (preserveNull || array[i] != NULLSTR)
  110. temp = j++ ? temp separator array[i] : array[i]
  111. PROCINFO["sorted_in"] = saveSortedIn
  112. } else
  113. temp = array
  114. return temp
  115. }
  116. function explode(string, array) {
  117. split(string, array, NULLSTR)
  118. }
  119. function escapeChar(char) {
  120. switch (char) {
  121. case "b":
  122. return "\b"
  123. case "f":
  124. return "\f"
  125. case "n":
  126. return "\n"
  127. case "r":
  128. return "\r"
  129. case "t":
  130. return "\t"
  131. case "v":
  132. return "\v"
  133. case "u0026":
  134. return "&"
  135. case "u003c":
  136. return "<"
  137. case "u003e":
  138. return ">"
  139. default:
  140. return char
  141. }
  142. }
  143. function literal(string,
  144. c, cc, escaping, i, s) {
  145. if (string !~ /^".*"$/)
  146. return string
  147. explode(string, s)
  148. string = NULLSTR
  149. escaping = 0
  150. for (i = 2; i < length(s); i++) {
  151. c = s[i]
  152. if (escaping) {
  153. if (cc) {
  154. cc = cc c
  155. if (length(cc) == 5) {
  156. string = string escapeChar(cc)
  157. escaping = 0
  158. cc = NULLSTR
  159. }
  160. } else if (c == "u") {
  161. cc = c
  162. } else {
  163. string = string escapeChar(c)
  164. escaping = 0
  165. }
  166. } else {
  167. if (c == "\\")
  168. escaping = 1
  169. else
  170. string = string c
  171. }
  172. }
  173. return string
  174. }
  175. function escape(string) {
  176. gsub(/\\/, "\\\\", string)
  177. gsub(/"/, "\\\"", string)
  178. return string
  179. }
  180. function unescape(string) {
  181. gsub(/\\\"/, "\"", string)
  182. gsub(/\\\\/, "\\", string)
  183. return string
  184. }
  185. function parameterize(string, quotationMark) {
  186. if (!quotationMark)
  187. quotationMark = "'"
  188. if (quotationMark == "'") {
  189. gsub(/'/, "'\\''", string)
  190. return "'" string "'"
  191. } else {
  192. return "\"" escape(string) "\""
  193. }
  194. }
  195. function unparameterize(string,    temp) {
  196. match(string, /^'(.*)'$/, temp)
  197. if (temp[0]) {
  198. string = temp[1]
  199. gsub(/'\\''/, "'", string)
  200. return string
  201. }
  202. match(string, /^"(.*)"$/, temp)
  203. if (temp[0]) {
  204. string = temp[1]
  205. return unescape(string)
  206. }
  207. return string
  208. }
  209. function toString(value, inline, heredoc, valOnly, numSub, level, sortedIn,
  210. i, items, j, k, p, saveSortedIn, temp, v) {
  211. if (!level) level = 0
  212. if (!sortedIn)
  213. sortedIn = "compareByIndexFields"
  214. if (isarray(value)) {
  215. saveSortedIn = PROCINFO["sorted_in"]
  216. PROCINFO["sorted_in"] = sortedIn
  217. p = 0
  218. for (i in value) {
  219. split(i, j, SUBSEP); k = join(j, ",")
  220. if (!numSub || !isnum(k)) k = parameterize(k, "\"")
  221. v = toString(value[i], inline, heredoc, valOnly, numSub, level + 1, sortedIn)
  222. if (!isarray(value[i])) v = parameterize(v, "\"")
  223. if (valOnly)
  224. items[p++] = inline ? v : (replicate("\t", level) v)
  225. else
  226. items[p++] = inline ? (k ": " v) :
  227. (replicate("\t", level) k "\t" v)
  228. }
  229. PROCINFO["sorted_in"] = saveSortedIn
  230. temp = inline ? join(items, ", ") :
  231. ("\n" join(items, "\n") "\n" replicate("\t", level))
  232. temp = valOnly ? ("[" temp "]") : ("{" temp "}")
  233. return temp
  234. } else {
  235. if (heredoc)
  236. return "'''\n" value "\n'''"
  237. else
  238. return value
  239. }
  240. }
  241. function squeeze(line, preserveIndent) {
  242. if (!preserveIndent)
  243. gsub(/^[[:space:]]+/, NULLSTR, line)
  244. gsub(/^[[:space:]]*#.*$/, NULLSTR, line)
  245. gsub(/#[^"/]*$/, NULLSTR, line)
  246. gsub(/[[:space:]]+$/, NULLSTR, line)
  247. gsub(/[[:space:]]+\\$/, "\\", line)
  248. return line
  249. }
  250. function yn(string) {
  251. return (tolower(string) ~ /^([0fn]|off)/) ? 0 : 1
  252. }
  253. function initAnsiCode() {
  254. if (ENVIRON["TERM"] == "dumb") return
  255. AnsiCode["reset"]         = AnsiCode[0] = "\33[0m"
  256. AnsiCode["bold"]          = "\33[1m"
  257. AnsiCode["underline"]     = "\33[4m"
  258. AnsiCode["negative"]      = "\33[7m"
  259. AnsiCode["no bold"]       = "\33[22m"
  260. AnsiCode["no underline"]  = "\33[24m"
  261. AnsiCode["positive"]      = "\33[27m"
  262. AnsiCode["black"]         = "\33[30m"
  263. AnsiCode["red"]           = "\33[31m"
  264. AnsiCode["green"]         = "\33[32m"
  265. AnsiCode["yellow"]        = "\33[33m"
  266. AnsiCode["blue"]          = "\33[34m"
  267. AnsiCode["magenta"]       = "\33[35m"
  268. AnsiCode["cyan"]          = "\33[36m"
  269. AnsiCode["gray"]          = "\33[37m"
  270. AnsiCode["default"]       = "\33[39m"
  271. AnsiCode["dark gray"]     = "\33[90m"
  272. AnsiCode["light red"]     = "\33[91m"
  273. AnsiCode["light green"]   = "\33[92m"
  274. AnsiCode["light yellow"]  = "\33[93m"
  275. AnsiCode["light blue"]    = "\33[94m"
  276. AnsiCode["light magenta"] = "\33[95m"
  277. AnsiCode["light cyan"]    = "\33[96m"
  278. AnsiCode["white"]         = "\33[97m"
  279. }
  280. function ansi(code, text) {
  281. switch (code) {
  282. case "bold":
  283. return AnsiCode[code] text AnsiCode["no bold"]
  284. case "underline":
  285. return AnsiCode[code] text AnsiCode["no underline"]
  286. case "negative":
  287. return AnsiCode[code] text AnsiCode["positive"]
  288. default:
  289. return AnsiCode[code] text AnsiCode[0]
  290. }
  291. }
  292. function w(text) {
  293. print ansi("yellow", text) > STDERR
  294. }
  295. function e(text) {
  296. print ansi("bold", ansi("yellow", text)) > STDERR
  297. }
  298. function wtf(text) {
  299. print ansi("bold", ansi("red", text)) > STDERR
  300. }
  301. function d(text) {
  302. print ansi("gray", text) > STDERR
  303. }
  304. function da(value, name, inline, heredoc, valOnly, numSub, sortedIn,
  305. i, j, saveSortedIn) {
  306. if (!name)
  307. name = "_"
  308. if (!sortedIn)
  309. sortedIn = "compareByIndexFields"
  310. d(name " = " toString(value, inline, heredoc, valOnly, numSub, 0, sortedIn))
  311. }
  312. function assert(x, message) {
  313. if (!message)
  314. message = "[ERROR] Assertion failed."
  315. if (x)
  316. return x
  317. else
  318. e(message)
  319. }
  320. function initUrlEncoding() {
  321. UrlEncoding["\t"] = "%09"
  322. UrlEncoding["\n"] = "%0A"
  323. UrlEncoding[" "]  = "%20"
  324. UrlEncoding["!"]  = "%21"
  325. UrlEncoding["\""] = "%22"
  326. UrlEncoding["#"]  = "%23"
  327. UrlEncoding["$"]  = "%24"
  328. UrlEncoding["%"]  = "%25"
  329. UrlEncoding["&"]  = "%26"
  330. UrlEncoding["'"]  = "%27"
  331. UrlEncoding["("]  = "%28"
  332. UrlEncoding[")"]  = "%29"
  333. UrlEncoding["*"]  = "%2A"
  334. UrlEncoding["+"]  = "%2B"
  335. UrlEncoding[","]  = "%2C"
  336. UrlEncoding["-"]  = "%2D"
  337. UrlEncoding["."]  = "%2E"
  338. UrlEncoding["/"]  = "%2F"
  339. UrlEncoding[":"]  = "%3A"
  340. UrlEncoding[";"]  = "%3B"
  341. UrlEncoding["<"]  = "%3C"
  342. UrlEncoding["="]  = "%3D"
  343. UrlEncoding[">"]  = "%3E"
  344. UrlEncoding["?"]  = "%3F"
  345. UrlEncoding["@"]  = "%40"
  346. UrlEncoding["["]  = "%5B"
  347. UrlEncoding["\\"] = "%5C"
  348. UrlEncoding["]"]  = "%5D"
  349. UrlEncoding["^"]  = "%5E"
  350. UrlEncoding["_"]  = "%5F"
  351. UrlEncoding["`"]  = "%60"
  352. UrlEncoding["{"]  = "%7B"
  353. UrlEncoding["|"]  = "%7C"
  354. UrlEncoding["}"]  = "%7D"
  355. UrlEncoding["~"]  = "%7E"
  356. }
  357. function quote(string,    i, r, s) {
  358. r = NULLSTR
  359. explode(string, s)
  360. for (i = 1; i <= length(s); i++)
  361. r = r (s[i] in UrlEncoding ? UrlEncoding[s[i]] : s[i])
  362. return r
  363. }
  364. function unquote(string,    i, k, r, s, temp) {
  365. r = NULLSTR
  366. explode(string, s)
  367. temp = NULLSTR
  368. for (i = 1; i <= length(s); i++)
  369. if (temp) {
  370. temp = temp s[i]
  371. if (length(temp) > 2) {
  372. for (k in UrlEncoding)
  373. if (temp == UrlEncoding[k]) {
  374. r = r k
  375. temp = NULLSTR
  376. break
  377. }
  378. if (temp) {
  379. r = r temp
  380. temp = NULLSTR
  381. }
  382. }
  383. } else {
  384. if (s[i] != "%")
  385. r = r s[i]
  386. else
  387. temp = s[i]
  388. }
  389. if (temp)
  390. r = r temp
  391. return r
  392. }
  393. function initUriSchemes() {
  394. UriSchemes[0] = "file://"
  395. UriSchemes[1] = "http://"
  396. UriSchemes[2] = "https://"
  397. }
  398. function readFrom(file,    line, text) {
  399. if (!file) file = "/dev/stdin"
  400. text = NULLSTR
  401. while (getline line < file)
  402. text = (text ? text "\n" : NULLSTR) line
  403. return text
  404. }
  405. function writeTo(text, file) {
  406. if (!file) file = "/dev/stdout"
  407. print text > file
  408. }
  409. function getOutput(command,    content, line) {
  410. content = NULLSTR
  411. while ((command |& getline line) > 0)
  412. content = (content ? content "\n" : NULLSTR) line
  413. return content
  414. }
  415. function fileExists(file) {
  416. return !system("test -f " parameterize(file))
  417. }
  418. function dirExists(file) {
  419. return !system("test -d " parameterize(file))
  420. }
  421. function detectProgram(prog, arg, returnOutput,    temp) {
  422. if (returnOutput) {
  423. prog " " arg SUPERR | getline temp
  424. return temp
  425. } else
  426. return (prog " " arg SUPERR | getline) ? prog : NULLSTR
  427. }
  428. function getGitHead(    line, group) {
  429. if (fileExists(".git/HEAD")) {
  430. getline line < ".git/HEAD"
  431. match(line, /^ref: (.*)$/, group)
  432. if (fileExists(".git/" group[1])) {
  433. getline line < (".git/" group[1])
  434. return substr(line, 1, 7)
  435. } else
  436. return NULLSTR
  437. } else
  438. return NULLSTR
  439. }
  440. BEGIN {
  441. initConst()
  442. initAnsiCode()
  443. initUrlEncoding()
  444. initUriSchemes()
  445. }
  446. function initGawk(    group) {
  447. Gawk = "gawk"
  448. GawkVersion = PROCINFO["version"]
  449. split(PROCINFO["version"], group, ".")
  450. if (group[1] < 4) {
  451. e("[ERROR] Oops! Your gawk (version " GawkVersion ") "\
  452. "appears to be too old.\n"\
  453. "        You need at least gawk 4.0.0 to run this program.")
  454. exit 1
  455. }
  456. }
  457. function initBiDi() {
  458. FriBidi = detectProgram("fribidi", "--version", 1)
  459. BiDiNoPad = FriBidi ? "fribidi --nopad" : "rev" SUPERR
  460. BiDi = FriBidi ? "fribidi --width %s" :
  461. "rev" SUPERR "| sed \"s/'/\\\\\\'/\" | xargs printf '%%s '"
  462. }
  463. function initRlwrap() {
  464. Rlwrap = detectProgram("rlwrap", "--version")
  465. }
  466. function initEmacs() {
  467. Emacs = detectProgram("emacs", "--version")
  468. }
  469. function initCurl() {
  470. Curl = detectProgram("curl", "--version")
  471. }
  472. function l(value, name, inline, heredoc, valOnly, numSub, sortedIn) {
  473. if (Option["debug"]) {
  474. if (name)
  475. da(value, name, inline, heredoc, valOnly, numSub, sortedIn)
  476. else
  477. d(value)
  478. }
  479. }
  480. function m(string) {
  481. if (Option["debug"])
  482. return ansi("cyan", string) RS
  483. }
  484. function newerVersion(ver1, ver2,    i, group1, group2) {
  485. split(ver1, group1, ".")
  486. split(ver2, group2, ".")
  487. for (i = 1; i <= 4; i++) {
  488. if (group1[i] + 0 > group2[i] + 0)
  489. return 1
  490. else if (group1[i] + 0 < group2[i] + 0)
  491. return 0
  492. }
  493. return 0
  494. }
  495. function rlwrapMe(    i, command) {
  496. initRlwrap()
  497. if (!Rlwrap) {
  498. l(">> not found: rlwrap")
  499. return 1
  500. }
  501. if (ENVIRON["TRANS_ENTRY"]) {
  502. command = Rlwrap " " ENVIRON["TRANS_ENTRY"] " "\
  503. parameterize("-no-rlwrap")
  504. } else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) {
  505. command = Rlwrap " sh "\
  506. parameterize(ENVIRON["TRANS_DIR"] "/" EntryScript)\
  507. " - " parameterize("-no-rlwrap")
  508. } else {
  509. l(">> not found: $TRANS_ENTRY or EntryPoint")
  510. return 1
  511. }
  512. for (i = 1; i < length(ARGV); i++)
  513. if (ARGV[i])
  514. command = command " " parameterize(ARGV[i])
  515. l(">> forking: " command)
  516. if (!system(command)) {
  517. l(">> process exited with code 0")
  518. exit ExitCode
  519. } else {
  520. l(">> process exited with non-zero return code")
  521. return 1
  522. }
  523. }
  524. function emacsMe(    i, params, el, command) {
  525. initEmacs()
  526. if (!Emacs) {
  527. l(">> not found: emacs")
  528. return 1
  529. }
  530. params = ""
  531. for (i = 1; i < length(ARGV); i++)
  532. if (ARGV[i])
  533. params = params " " parameterize(ARGV[i], "\"")
  534. if (ENVIRON["TRANS_ENTRY"]) {
  535. el = "(progn (setq explicit-shell-file-name \"" ENVIRON["TRANS_ENTRY"] "\") "\
  536. "(setq explicit-" Command "-args '(\"-I\" \"-no-rlwrap\"" params ")) "\
  537. "(command-execute 'shell) (rename-buffer \"" Name "\"))"
  538. } else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) {
  539. el = "(progn (setq explicit-shell-file-name \"" "sh" "\") "\
  540. "(setq explicit-" "sh" "-args '(\"" ENVIRON["TRANS_DIR"] "/" EntryScript "\" \"-I\" \"-no-rlwrap\"" params ")) "\
  541. "(command-execute 'shell) (rename-buffer \"" Name "\"))"
  542. } else {
  543. l(">> not found: $TRANS_ENTRY or EntryPoint")
  544. return 1
  545. }
  546. command = Emacs " --eval " parameterize(el)
  547. l(">> forking: " command)
  548. if (!system(command)) {
  549. l(">> process exited with code 0")
  550. exit ExitCode
  551. } else {
  552. l(">> process exited with non-zero return code")
  553. return 1
  554. }
  555. }
  556. function curl(url, output,    command, content, line) {
  557. initCurl()
  558. if (!Curl) {
  559. l(">> not found: curl")
  560. w("[WARNING] curl is not found.")
  561. return NULLSTR
  562. }
  563. command = Curl " --location --silent"
  564. if (Option["user-agent"])
  565. command = command " --user-agent " parameterize(Option["user-agent"])
  566. command = command " " parameterize(url)
  567. if (output) {
  568. command = command " --output " parameterize(output)
  569. system(command)
  570. return NULLSTR
  571. }
  572. content = NULLSTR
  573. while ((command |& getline line) > 0)
  574. content = (content ? content "\n" : NULLSTR) line
  575. return content
  576. }
  577. function curlPost(url, data, output,    command, content, line) {
  578. initCurl()
  579. if (!Curl) {
  580. l(">> not found: curl")
  581. w("[WARNING] curl is not found.")
  582. return NULLSTR
  583. }
  584. command = Curl " --location --silent"
  585. if (Option["user-agent"])
  586. command = command " --user-agent " parameterize(Option["user-agent"])
  587. command = command " --request POST --data " parameterize(data)
  588. command = command " " parameterize(url)
  589. if (output) {
  590. command = command " --output " parameterize(output)
  591. system(command)
  592. return NULLSTR
  593. }
  594. content = NULLSTR
  595. while ((command |& getline line) > 0)
  596. content = (content ? content "\n" : NULLSTR) line
  597. return content
  598. }
  599. function dump(text, group,    command, temp) {
  600. command = "hexdump" " -v -e'1/1 \"%03u\" \" \"'"
  601. ("echo " parameterize(text) PIPE command) | getline temp
  602. split(temp, group, " ")
  603. return length(group) - 1
  604. }
  605. function base64(text,    command, temp) {
  606. command = "base64"
  607. ("echo -n " parameterize(text) PIPE command) | getline temp
  608. return temp
  609. }
  610. function uprintf(text,    command, temp) {
  611. command = "echo -en " parameterize(text)
  612. ("bash -c " parameterize(command, "\"")) | getline temp
  613. return temp
  614. }
  615. function initLocale(    i) {
  616. Locale["af"]["name"]               = "Afrikaans"
  617. Locale["af"]["endonym"]            = "Afrikaans"
  618. Locale["af"]["translations-of"]    = "Vertalings van %s"
  619. Locale["af"]["definitions-of"]     = "Definisies van %s"
  620. Locale["af"]["synonyms"]           = "Sinonieme"
  621. Locale["af"]["examples"]           = "Voorbeelde"
  622. Locale["af"]["see-also"]           = "Sien ook"
  623. Locale["af"]["family"]             = "Indo-European"
  624. Locale["af"]["iso"]                = "afr"
  625. Locale["af"]["glotto"]             = "afri1274"
  626. Locale["af"]["script"]             = "Latn"
  627. Locale["sq"]["name"]               = "Albanian"
  628. Locale["sq"]["endonym"]            = "Shqip"
  629. Locale["sq"]["translations-of"]    = "PĆ«rkthimet e %s"
  630. Locale["sq"]["definitions-of"]     = "PĆ«rkufizime tĆ« %s"
  631. Locale["sq"]["synonyms"]           = "Sinonime"
  632. Locale["sq"]["examples"]           = "Shembuj"
  633. Locale["sq"]["see-also"]           = "Shihni gjithashtu"
  634. Locale["sq"]["family"]             = "Indo-European"
  635. Locale["sq"]["iso"]                = "sqi"
  636. Locale["sq"]["glotto"]             = "alba1267"
  637. Locale["sq"]["script"]             = "Latn"
  638. Locale["am"]["name"]               = "Amharic"
  639. Locale["am"]["endonym"]            = "įŠ įˆ›įˆ­įŠ›"
  640. Locale["am"]["translations-of"]    = "į‹Ø %s į‰µįˆ­įŒ‰įˆžį‰½"
  641. Locale["am"]["definitions-of"]     = "į‹Ø %s į‰ƒįˆ‹į‰µ įį‰½į‹Žį‰½"
  642. Locale["am"]["synonyms"]           = "į‰°įˆ˜įˆ³įˆ³į‹­ į‰ƒįˆ‹į‰µ"
  643. Locale["am"]["examples"]           = "įˆįˆ³įˆŒį‹Žį‰½"
  644. Locale["am"]["see-also"]           = "į‹ØįˆšįŠØį‰°įˆˆį‹įŠ•įˆ į‹­įˆ˜įˆįŠØį‰±"
  645. Locale["am"]["family"]             = "Afro-Asiatic"
  646. Locale["am"]["iso"]                = "amh"
  647. Locale["am"]["glotto"]             = "amha1245"
  648. Locale["am"]["script"]             = "Ethi"
  649. Locale["ar"]["name"]               = "Arabic"
  650. Locale["ar"]["endonym"]            = "Ų§Ł„Ų¹Ų±ŲØŁŠŲ©"
  651. Locale["ar"]["translations-of"]    = "ŲŖŲ±Ų¬Ł…Ų§ŲŖ %s"
  652. Locale["ar"]["definitions-of"]     = "ŲŖŲ¹Ų±ŁŠŁŲ§ŲŖ %s"
  653. Locale["ar"]["synonyms"]           = "Ł…Ų±Ų§ŲÆŁŲ§ŲŖ"
  654. Locale["ar"]["examples"]           = "Ų£Ł…Ų«Ł„Ų©"
  655. Locale["ar"]["see-also"]           = "Ų§Ł†ŲøŲ± Ų£ŁŠŲ¶Ł‹Ų§"
  656. Locale["ar"]["family"]             = "Afro-Asiatic"
  657. Locale["ar"]["iso"]                = "ara"
  658. Locale["ar"]["glotto"]             = "stan1318"
  659. Locale["ar"]["script"]             = "Arab"
  660. Locale["ar"]["rtl"]                = "true"
  661. Locale["hy"]["name"]               = "Armenian"
  662. Locale["hy"]["endonym"]            = "Õ€Õ”ÕµÕ„Ö€Õ„Õ¶"
  663. Locale["hy"]["translations-of"]    = "%s-Õ« Õ©Õ”Ö€Õ£Õ“Õ”Õ¶ÕøւթյÕøÖ‚Õ¶Õ¶Õ„Ö€ÕØ"
  664. Locale["hy"]["definitions-of"]     = "%s-Õ« Õ½Õ”Õ°Õ“Õ”Õ¶ÕøÖ‚Õ“Õ¶Õ„Ö€ÕØ"
  665. Locale["hy"]["synonyms"]           = "ՀÕøÕ“Õ”Õ¶Õ«Õ·Õ¶Õ„Ö€"
  666. Locale["hy"]["examples"]           = "Õ•Ö€Õ«Õ¶Õ”ÕÆÕ¶Õ„Ö€"
  667. Locale["hy"]["see-also"]           = "ՏՄս Õ¶Õ”Ö‡"
  668. Locale["hy"]["family"]             = "Indo-European"
  669. Locale["hy"]["iso"]                = "hye"
  670. Locale["hy"]["glotto"]             = "nucl1235"
  671. Locale["hy"]["script"]             = "Armn"
  672. Locale["az"]["name"]               = "Azerbaijani"
  673. Locale["az"]["endonym"]            = "Azərbaycanca"
  674. Locale["az"]["translations-of"]    = "%s sƶzĆ¼nĆ¼n tərcĆ¼məsi"
  675. Locale["az"]["definitions-of"]     = "%s sƶzĆ¼nĆ¼n tərifləri"
  676. Locale["az"]["synonyms"]           = "Sinonimlər"
  677. Locale["az"]["examples"]           = "NĆ¼munələr"
  678. Locale["az"]["see-also"]           = "HəmƧinin, baxın:"
  679. Locale["az"]["family"]             = "Turkic"
  680. Locale["az"]["iso"]                = "aze"
  681. Locale["az"]["glotto"]             = "nort2697"
  682. Locale["az"]["script"]             = "Latn"
  683. Locale["eu"]["name"]               = "Basque"
  684. Locale["eu"]["endonym"]            = "Euskara"
  685. Locale["eu"]["translations-of"]    = "%s esapidearen itzulpena"
  686. Locale["eu"]["definitions-of"]     = "Honen definizioak: %s"
  687. Locale["eu"]["synonyms"]           = "Sinonimoak"
  688. Locale["eu"]["examples"]           = "Adibideak"
  689. Locale["eu"]["see-also"]           = "Ikusi hauek ere"
  690. Locale["eu"]["family"]             = "Language Isolate"
  691. Locale["eu"]["iso"]                = "eus"
  692. Locale["eu"]["glotto"]             = "basq1248"
  693. Locale["eu"]["script"]             = "Latn"
  694. Locale["be"]["name"]               = "Belarusian"
  695. Locale["be"]["endonym"]            = "Š±ŠµŠ»Š°Ń€ŃƒŃŠŗŠ°Ń"
  696. Locale["be"]["translations-of"]    = "ŠŸŠµŃ€Š°ŠŗŠ»Š°Š“ы %s"
  697. Locale["be"]["definitions-of"]     = "Š’Ń‹Š·Š½Š°Ń‡ŃŠ½Š½i %s"
  698. Locale["be"]["synonyms"]           = "Š”іŠ½Š¾Š½Ń–Š¼Ń‹"
  699. Locale["be"]["examples"]           = "ŠŸŃ€Ń‹ŠŗŠ»Š°Š“ы"
  700. Locale["be"]["see-also"]           = "Š“Š». тŠ°ŠŗсŠ°Š¼Š°"
  701. Locale["be"]["family"]             = "Indo-European"
  702. Locale["be"]["iso"]                = "bel"
  703. Locale["be"]["glotto"]             = "bela1254"
  704. Locale["be"]["script"]             = "Cyrl"
  705. Locale["bn"]["name"]               = "Bengali"
  706. Locale["bn"]["endonym"]            = "ą¦¬ą¦¾ą¦‚ą¦²ą¦¾"
  707. Locale["bn"]["translations-of"]    = "%s ą¦ą¦° ą¦…ą¦Øą§ą¦¬ą¦¾ą¦¦"
  708. Locale["bn"]["definitions-of"]     = "%s ą¦ą¦° ą¦øą¦‚ą¦œą§ą¦žą¦¾"
  709. Locale["bn"]["synonyms"]           = "ą¦Ŗą§ą¦°ą¦¤ą¦æą¦¶ą¦¬ą§ą¦¦"
  710. Locale["bn"]["examples"]           = "ą¦‰ą¦¦ą¦¾ą¦¹ą¦°ą¦£"
  711. Locale["bn"]["see-also"]           = "ą¦†ą¦°ą§‹ ą¦¦ą§‡ą¦–ą§ą¦Ø"
  712. Locale["bn"]["family"]             = "Indo-European"
  713. Locale["bn"]["iso"]                = "ben"
  714. Locale["bn"]["glotto"]             = "beng1280"
  715. Locale["bn"]["script"]             = "Beng"
  716. Locale["bs"]["name"]               = "Bosnian"
  717. Locale["bs"]["endonym"]            = "Bosanski"
  718. Locale["bs"]["translations-of"]    = "Prijevod za: %s"
  719. Locale["bs"]["definitions-of"]     = "Definicije za %s"
  720. Locale["bs"]["synonyms"]           = "Sinonimi"
  721. Locale["bs"]["examples"]           = "Primjeri"
  722. Locale["bs"]["see-also"]           = "Pogledajte i"
  723. Locale["bs"]["family"]             = "Indo-European"
  724. Locale["bs"]["iso"]                = "bos"
  725. Locale["bs"]["glotto"]             = "bosn1245"
  726. Locale["bs"]["script"]             = "Latn"
  727. Locale["bg"]["name"]               = "Bulgarian"
  728. Locale["bg"]["endonym"]            = "Š±ŃŠŠ»Š³Š°Ń€ŃŠŗŠø"
  729. Locale["bg"]["translations-of"]    = "ŠŸŃ€ŠµŠ²Š¾Š“Šø Š½Š° %s"
  730. Locale["bg"]["definitions-of"]     = "Š”ŠµŃ„ŠøŠ½ŠøцŠøŠø Š·Š° %s"
  731. Locale["bg"]["synonyms"]           = "Š”ŠøŠ½Š¾Š½ŠøŠ¼Šø"
  732. Locale["bg"]["examples"]           = "ŠŸŃ€ŠøŠ¼ŠµŃ€Šø"
  733. Locale["bg"]["see-also"]           = "Š’ŠøŠ¶Ń‚Šµ същŠ¾"
  734. Locale["bg"]["family"]             = "Indo-European"
  735. Locale["bg"]["iso"]                = "bul"
  736. Locale["bg"]["glotto"]             = "bulg1262"
  737. Locale["bg"]["script"]             = "Cyrl"
  738. Locale["ca"]["name"]               = "Catalan"
  739. Locale["ca"]["endonym"]            = "CatalĆ "
  740. Locale["ca"]["translations-of"]    = "Traduccions per a %s"
  741. Locale["ca"]["definitions-of"]     = "Definicions de: %s"
  742. Locale["ca"]["synonyms"]           = "SinĆ²nims"
  743. Locale["ca"]["examples"]           = "Exemples"
  744. Locale["ca"]["see-also"]           = "Vegeu tambĆ©"
  745. Locale["ca"]["family"]             = "Indo-European"
  746. Locale["ca"]["iso"]                = "cat"
  747. Locale["ca"]["glotto"]             = "stan1289"
  748. Locale["ca"]["script"]             = "Latn"
  749. Locale["ceb"]["name"]              = "Cebuano"
  750. Locale["ceb"]["endonym"]           = "Cebuano"
  751. Locale["ceb"]["translations-of"]   = "%s Mga Paghubad sa PULONG_O_HUGPONG SA PAMULONG"
  752. Locale["ceb"]["definitions-of"]    = "Mga kahulugan sa %s"
  753. Locale["ceb"]["synonyms"]          = "Mga Kapulong"
  754. Locale["ceb"]["examples"]          = "Mga pananglitan:"
  755. Locale["ceb"]["see-also"]          = "Kitaa pag-usab"
  756. Locale["ceb"]["family"]            = "Austronesian"
  757. Locale["ceb"]["iso"]               = "ceb"
  758. Locale["ceb"]["glotto"]            = "cebu1242"
  759. Locale["ceb"]["script"]            = "Latn"
  760. Locale["ny"]["name"]               = "Chichewa"
  761. Locale["ny"]["endonym"]            = "Nyanja"
  762. Locale["ny"]["translations-of"]    = "Matanthauzidwe a %s"
  763. Locale["ny"]["definitions-of"]     = "Mamasulidwe a %s"
  764. Locale["ny"]["synonyms"]           = "Mau ofanana"
  765. Locale["ny"]["examples"]           = "Zitsanzo"
  766. Locale["ny"]["see-also"]           = "Onaninso"
  767. Locale["ny"]["family"]             = "Atlantic-Congo"
  768. Locale["ny"]["iso"]                = "nya"
  769. Locale["ny"]["glotto"]             = "nyan1308"
  770. Locale["ny"]["script"]             = "Latn"
  771. Locale["zh-CN"]["name"]            = "Chinese Simplified"
  772. Locale["zh-CN"]["endonym"]         = "ē®€ä½“äø­ę–‡"
  773. Locale["zh-CN"]["translations-of"] = "%s ēš„ēæ»čƑ"
  774. Locale["zh-CN"]["definitions-of"]  = "%sēš„定义"
  775. Locale["zh-CN"]["synonyms"]        = "同义čƍ"
  776. Locale["zh-CN"]["examples"]        = "ē¤ŗ例"
  777. Locale["zh-CN"]["see-also"]        = "另čƷ参阅"
  778. Locale["zh-CN"]["family"]          = "Sino-Tibetan"
  779. Locale["zh-CN"]["iso"]             = "zho-CN"
  780. Locale["zh-CN"]["glotto"]          = "mand1415"
  781. Locale["zh-CN"]["script"]          = "Hans"
  782. Locale["zh-CN"]["dictionary"]      = "true"
  783. Locale["zh-TW"]["name"]            = "Chinese Traditional"
  784. Locale["zh-TW"]["endonym"]         = "ę­£é«”äø­ę–‡"
  785. Locale["zh-TW"]["translations-of"] = "怌%s怍ēš„ēæ»č­Æ"
  786. Locale["zh-TW"]["definitions-of"]  = "怌%s怍ēš„定ē¾©"
  787. Locale["zh-TW"]["synonyms"]        = "同ē¾©č©ž"
  788. Locale["zh-TW"]["examples"]        = "例叄"
  789. Locale["zh-TW"]["see-also"]        = "å¦č«‹åƒé–±"
  790. Locale["zh-TW"]["family"]          = "Sino-Tibetan"
  791. Locale["zh-TW"]["iso"]             = "zho-TW"
  792. Locale["zh-TW"]["glotto"]          = "mand1415"
  793. Locale["zh-TW"]["script"]          = "Hant"
  794. Locale["zh-TW"]["dictionary"]      = "true"
  795. Locale["co"]["name"]               = "Corsican"
  796. Locale["co"]["endonym"]            = "Corsu"
  797. Locale["co"]["translations-of"]    = "Traductions de %s"
  798. Locale["co"]["definitions-of"]     = "DĆ©finitions de %s"
  799. Locale["co"]["synonyms"]           = "Synonymes"
  800. Locale["co"]["examples"]           = "Exemples"
  801. Locale["co"]["see-also"]           = "Voir aussi"
  802. Locale["co"]["family"]             = "Indo-European"
  803. Locale["co"]["iso"]                = "cos"
  804. Locale["co"]["glotto"]             = "cors1242"
  805. Locale["co"]["script"]             = "Latn"
  806. Locale["hr"]["name"]               = "Croatian"
  807. Locale["hr"]["endonym"]            = "Hrvatski"
  808. Locale["hr"]["translations-of"]    = "Prijevodi riječi ili izraza %s"
  809. Locale["hr"]["definitions-of"]     = "Definicije riječi ili izraza %s"
  810. Locale["hr"]["synonyms"]           = "Sinonimi"
  811. Locale["hr"]["examples"]           = "Primjeri"
  812. Locale["hr"]["see-also"]           = "Također pogledajte"
  813. Locale["hr"]["family"]             = "Indo-European"
  814. Locale["hr"]["iso"]                = "hrv"
  815. Locale["hr"]["glotto"]             = "croa1245"
  816. Locale["hr"]["script"]             = "Latn"
  817. Locale["cs"]["name"]               = "Czech"
  818. Locale["cs"]["endonym"]            = "ČeÅ”tina"
  819. Locale["cs"]["translations-of"]    = "Překlad vĆ½razu %s"
  820. Locale["cs"]["definitions-of"]     = "Definice vĆ½razu %s"
  821. Locale["cs"]["synonyms"]           = "Synonyma"
  822. Locale["cs"]["examples"]           = "PÅ™Ć­klady"
  823. Locale["cs"]["see-also"]           = "Viz takĆ©"
  824. Locale["cs"]["family"]             = "Indo-European"
  825. Locale["cs"]["iso"]                = "ces"
  826. Locale["cs"]["glotto"]             = "czec1258"
  827. Locale["cs"]["script"]             = "Latn"
  828. Locale["da"]["name"]               = "Danish"
  829. Locale["da"]["endonym"]            = "Dansk"
  830. Locale["da"]["translations-of"]    = "OversƦttelser af %s"
  831. Locale["da"]["definitions-of"]     = "Definitioner af %s"
  832. Locale["da"]["synonyms"]           = "Synonymer"
  833. Locale["da"]["examples"]           = "Eksempler"
  834. Locale["da"]["see-also"]           = "Se ogsĆ„"
  835. Locale["da"]["family"]             = "Indo-European"
  836. Locale["da"]["iso"]                = "dan"
  837. Locale["da"]["glotto"]             = "dani1285"
  838. Locale["da"]["script"]             = "Latn"
  839. Locale["nl"]["name"]               = "Dutch"
  840. Locale["nl"]["endonym"]            = "Nederlands"
  841. Locale["nl"]["translations-of"]    = "Vertalingen van %s"
  842. Locale["nl"]["definitions-of"]     = "Definities van %s"
  843. Locale["nl"]["synonyms"]           = "Synoniemen"
  844. Locale["nl"]["examples"]           = "Voorbeelden"
  845. Locale["nl"]["see-also"]           = "Zie ook"
  846. Locale["nl"]["family"]             = "Indo-European"
  847. Locale["nl"]["iso"]                = "nld"
  848. Locale["nl"]["glotto"]             = "dutc1256"
  849. Locale["nl"]["script"]             = "Latn"
  850. Locale["nl"]["dictionary"]         = "true"
  851. Locale["en"]["name"]               = "English"
  852. Locale["en"]["endonym"]            = "English"
  853. Locale["en"]["translations-of"]    = "Translations of %s"
  854. Locale["en"]["definitions-of"]     = "Definitions of %s"
  855. Locale["en"]["synonyms"]           = "Synonyms"
  856. Locale["en"]["examples"]           = "Examples"
  857. Locale["en"]["see-also"]           = "See also"
  858. Locale["en"]["family"]             = "Indo-European"
  859. Locale["en"]["iso"]                = "eng"
  860. Locale["en"]["glotto"]             = "stan1293"
  861. Locale["en"]["script"]             = "Latn"
  862. Locale["en"]["dictionary"]         = "true"
  863. Locale["eo"]["name"]               = "Esperanto"
  864. Locale["eo"]["endonym"]            = "Esperanto"
  865. Locale["eo"]["translations-of"]    = "Tradukoj de %s"
  866. Locale["eo"]["definitions-of"]     = "Difinoj de %s"
  867. Locale["eo"]["synonyms"]           = "Sinonimoj"
  868. Locale["eo"]["examples"]           = "Ekzemploj"
  869. Locale["eo"]["see-also"]           = "Vidu ankaÅ­"
  870. Locale["eo"]["family"]             = "Artificial Language"
  871. Locale["eo"]["iso"]                = "epo"
  872. Locale["eo"]["glotto"]             = "espe1235"
  873. Locale["eo"]["script"]             = "Latn"
  874. Locale["et"]["name"]               = "Estonian"
  875. Locale["et"]["endonym"]            = "Eesti"
  876. Locale["et"]["translations-of"]    = "SƵna(de) %s tƵlked"
  877. Locale["et"]["definitions-of"]     = "SƵna(de) %s definitsioonid"
  878. Locale["et"]["synonyms"]           = "SĆ¼nonĆ¼Ć¼mid"
  879. Locale["et"]["examples"]           = "NƤited"
  880. Locale["et"]["see-also"]           = "Vt ka"
  881. Locale["et"]["family"]             = "Uralic"
  882. Locale["et"]["iso"]                = "est"
  883. Locale["et"]["glotto"]             = "esto1258"
  884. Locale["et"]["script"]             = "Latn"
  885. Locale["tl"]["name"]               = "Filipino"
  886. Locale["tl"]["endonym"]            = "Tagalog"
  887. Locale["tl"]["translations-of"]    = "Mga pagsasalin ng %s"
  888. Locale["tl"]["definitions-of"]     = "Mga kahulugan ng %s"
  889. Locale["tl"]["synonyms"]           = "Mga Kasingkahulugan"
  890. Locale["tl"]["examples"]           = "Mga Halimbawa"
  891. Locale["tl"]["see-also"]           = "Tingnan rin ang"
  892. Locale["tl"]["family"]             = "Austronesian"
  893. Locale["tl"]["iso"]                = "tgl"
  894. Locale["tl"]["glotto"]             = "taga1270"
  895. Locale["tl"]["script"]             = "Latn"
  896. Locale["fi"]["name"]               = "Finnish"
  897. Locale["fi"]["endonym"]            = "Suomi"
  898. Locale["fi"]["translations-of"]    = "KƤƤnnƶkset tekstille %s"
  899. Locale["fi"]["definitions-of"]     = "MƤƤritelmƤt kohteelle %s"
  900. Locale["fi"]["synonyms"]           = "Synonyymit"
  901. Locale["fi"]["examples"]           = "EsimerkkejƤ"
  902. Locale["fi"]["see-also"]           = "Katso myƶs"
  903. Locale["fi"]["family"]             = "Uralic"
  904. Locale["fi"]["iso"]                = "fin"
  905. Locale["fi"]["glotto"]             = "finn1318"
  906. Locale["fi"]["script"]             = "Latn"
  907. Locale["fr"]["name"]               = "French"
  908. Locale["fr"]["endonym"]            = "FranƧais"
  909. Locale["fr"]["translations-of"]    = "Traductions de %s"
  910. Locale["fr"]["definitions-of"]     = "DĆ©finitions de %s"
  911. Locale["fr"]["synonyms"]           = "Synonymes"
  912. Locale["fr"]["examples"]           = "Exemples"
  913. Locale["fr"]["see-also"]           = "Voir aussi"
  914. Locale["fr"]["family"]             = "Indo-European"
  915. Locale["fr"]["iso"]                = "fra"
  916. Locale["fr"]["glotto"]             = "stan1290"
  917. Locale["fr"]["script"]             = "Latn"
  918. Locale["fr"]["dictionary"]         = "true"
  919. Locale["gl"]["name"]               = "Galician"
  920. Locale["gl"]["endonym"]            = "Galego"
  921. Locale["gl"]["translations-of"]    = "TraduciĆ³ns de %s"
  922. Locale["gl"]["definitions-of"]     = "DefiniciĆ³ns de %s"
  923. Locale["gl"]["synonyms"]           = "SinĆ³nimos"
  924. Locale["gl"]["examples"]           = "Exemplos"
  925. Locale["gl"]["see-also"]           = "Ver tamĆ©n"
  926. Locale["gl"]["family"]             = "Indo-European"
  927. Locale["gl"]["iso"]                = "glg"
  928. Locale["gl"]["glotto"]             = "gali1258"
  929. Locale["gl"]["script"]             = "Latn"
  930. Locale["ka"]["name"]               = "Georgian"
  931. Locale["ka"]["endonym"]            = "įƒ„įƒįƒ įƒ—įƒ£įƒšįƒ˜"
  932. Locale["ka"]["translations-of"]    = "%s-įƒ˜įƒ” įƒ—įƒįƒ įƒ’įƒ›įƒįƒœįƒ”įƒ‘įƒ˜"
  933. Locale["ka"]["definitions-of"]     = "%s-įƒ˜įƒ” įƒ’įƒįƒœįƒ”įƒįƒ–įƒ¦įƒ•įƒ įƒ”įƒ‘įƒ”įƒ‘įƒ˜"
  934. Locale["ka"]["synonyms"]           = "įƒ”įƒ˜įƒœįƒįƒœįƒ˜įƒ›įƒ”įƒ‘įƒ˜"
  935. Locale["ka"]["examples"]           = "įƒ›įƒįƒ’įƒįƒšįƒ˜įƒ—įƒ”įƒ‘įƒ˜"
  936. Locale["ka"]["see-also"]           = "įƒįƒ”įƒ”įƒ•įƒ” įƒ˜įƒ®įƒ˜įƒšįƒ”įƒ—"
  937. Locale["ka"]["family"]             = "Kartvelian"
  938. Locale["ka"]["iso"]                = "kat"
  939. Locale["ka"]["glotto"]             = "nucl1302"
  940. Locale["ka"]["script"]             = "Geor"
  941. Locale["de"]["name"]               = "German"
  942. Locale["de"]["endonym"]            = "Deutsch"
  943. Locale["de"]["translations-of"]    = "Ɯbersetzungen fĆ¼r %s"
  944. Locale["de"]["definitions-of"]     = "Definitionen von %s"
  945. Locale["de"]["synonyms"]           = "Synonyme"
  946. Locale["de"]["examples"]           = "Beispiele"
  947. Locale["de"]["see-also"]           = "Siehe auch"
  948. Locale["de"]["family"]             = "Indo-European"
  949. Locale["de"]["iso"]                = "deu"
  950. Locale["de"]["glotto"]             = "stan1295"
  951. Locale["de"]["script"]             = "Latn"
  952. Locale["de"]["dictionary"]         = "true"
  953. Locale["el"]["name"]               = "Greek"
  954. Locale["el"]["endonym"]            = "Ī•Ī»Ī»Ī·Ī½Ī¹ĪŗĪ¬"
  955. Locale["el"]["translations-of"]    = "ĪœĪµĻ„Ī±Ļ†ĻĪ¬ĻƒĪµĪ¹Ļ‚ Ļ„ĪæĻ… %s"
  956. Locale["el"]["definitions-of"]     = "ĪŒĻĪ¹ĻƒĪ¼ĪæĪÆ %s"
  957. Locale["el"]["synonyms"]           = "Ī£Ļ…Ī½ĻŽĪ½Ļ…Ī¼Ī±"
  958. Locale["el"]["examples"]           = "Ī Ī±ĻĪ±Ī“ĪµĪÆĪ³Ī¼Ī±Ļ„Ī±"
  959. Locale["el"]["see-also"]           = "Ī”ĪµĪÆĻ„Īµ ĪµĻ€ĪÆĻƒĪ·Ļ‚"
  960. Locale["el"]["family"]             = "Indo-European"
  961. Locale["el"]["iso"]                = "ell"
  962. Locale["el"]["glotto"]             = "mode1248"
  963. Locale["el"]["script"]             = "Grek"
  964. Locale["gu"]["name"]               = "Gujarati"
  965. Locale["gu"]["endonym"]            = "ąŖ—ą«ąŖœąŖ°ąŖ¾ąŖ¤ą«€"
  966. Locale["gu"]["translations-of"]    = "%s ąŖØąŖ¾ ąŖ…ąŖØą«ąŖµąŖ¾ąŖ¦"
  967. Locale["gu"]["definitions-of"]     = "%s ąŖØą«€ ąŖµą«ąŖÆąŖ¾ąŖ–ą«ąŖÆąŖ¾ąŖ“"
  968. Locale["gu"]["synonyms"]           = "ąŖøąŖ®ąŖ¾ąŖØąŖ¾ąŖ°ą«ąŖ„ą«€"
  969. Locale["gu"]["examples"]           = "ąŖ‰ąŖ¦ąŖ¾ąŖ¹ąŖ°ąŖ£ą«‹"
  970. Locale["gu"]["see-also"]           = "ąŖ† ąŖŖąŖ£ ąŖœą«ąŖ“"
  971. Locale["gu"]["family"]             = "Indo-European"
  972. Locale["gu"]["iso"]                = "guj"
  973. Locale["gu"]["glotto"]             = "guja1252"
  974. Locale["gu"]["script"]             = "Gujr"
  975. Locale["ht"]["name"]               = "Haitian Creole"
  976. Locale["ht"]["endonym"]            = "KreyĆ²l Ayisyen"
  977. Locale["ht"]["translations-of"]    = "Tradiksyon %s"
  978. Locale["ht"]["definitions-of"]     = "Definisyon nan %s"
  979. Locale["ht"]["synonyms"]           = "Sinonim"
  980. Locale["ht"]["examples"]           = "Egzanp:"
  981. Locale["ht"]["see-also"]           = "WĆØ tou"
  982. Locale["ht"]["family"]             = "Indo-European"
  983. Locale["ht"]["iso"]                = "hat"
  984. Locale["ht"]["glotto"]             = "hait1244"
  985. Locale["ht"]["script"]             = "Latn"
  986. Locale["haw"]["name"]              = "Hawaiian"
  987. Locale["haw"]["endonym"]           = "Ź»ÅŒlelo HawaiŹ»i"
  988. Locale["haw"]["family"]            = "Austronesian"
  989. Locale["haw"]["iso"]               = "haw"
  990. Locale["haw"]["glotto"]            = "hawa1245"
  991. Locale["haw"]["script"]            = "Latn"
  992. Locale["ha"]["name"]               = "Hausa"
  993. Locale["ha"]["endonym"]            = "Hausa"
  994. Locale["ha"]["translations-of"]    = "Fassarar %s"
  995. Locale["ha"]["definitions-of"]     = "Ma'anoni na %s"
  996. Locale["ha"]["synonyms"]           = "Masu kamancin ma'ana"
  997. Locale["ha"]["examples"]           = "Misalai"
  998. Locale["ha"]["see-also"]           = "Duba kuma"
  999. Locale["ha"]["family"]             = "Afro-Asiatic"
  1000. Locale["ha"]["iso"]                = "hau"
  1001. Locale["ha"]["glotto"]             = "haus1257"
  1002. Locale["ha"]["script"]             = "Latn"
  1003. Locale["he"]["name"]               = "Hebrew"
  1004. Locale["he"]["endonym"]            = "ע֓בְ×ØÖ“×™×Ŗ"
  1005. Locale["he"]["translations-of"]    = "×Ŗ×Øגומים של %s"
  1006. Locale["he"]["definitions-of"]     = "הגד×Øו×Ŗ של %s"
  1007. Locale["he"]["synonyms"]           = "מילים × ×Øדפו×Ŗ"
  1008. Locale["he"]["examples"]           = "דוגמאו×Ŗ"
  1009. Locale["he"]["see-also"]           = "×Øאה גם"
  1010. Locale["he"]["family"]             = "Afro-Asiatic"
  1011. Locale["he"]["iso"]                = "heb"
  1012. Locale["he"]["glotto"]             = "hebr1245"
  1013. Locale["he"]["script"]             = "Hebr"
  1014. Locale["he"]["rtl"]                = "true"
  1015. Locale["hi"]["name"]               = "Hindi"
  1016. Locale["hi"]["endonym"]            = "ą¤¹ą¤æą¤Øą„ą¤¦ą„€"
  1017. Locale["hi"]["translations-of"]    = "%s ą¤•ą„‡ ą¤…ą¤Øą„ą¤µą¤¾ą¤¦"
  1018. Locale["hi"]["definitions-of"]     = "%s ą¤•ą„€ ą¤Ŗą¤°ą¤æą¤­ą¤¾ą¤·ą¤¾ą¤ą¤‚"
  1019. Locale["hi"]["synonyms"]           = "ą¤øą¤®ą¤¾ą¤Øą¤¾ą¤°ą„ą¤„ą„€"
  1020. Locale["hi"]["examples"]           = "ą¤‰ą¤¦ą¤¾ą¤¹ą¤°ą¤£"
  1021. Locale["hi"]["see-also"]           = "ą¤Æą¤¹ ą¤­ą„€ ą¤¦ą„‡ą¤–ą„‡ą¤‚"
  1022. Locale["hi"]["family"]             = "Indo-European"
  1023. Locale["hi"]["iso"]                = "hin"
  1024. Locale["hi"]["glotto"]             = "hind1269"
  1025. Locale["hi"]["script"]             = "Deva"
  1026. Locale["hmn"]["name"]              = "Hmong"
  1027. Locale["hmn"]["endonym"]           = "Hmoob"
  1028. Locale["hmn"]["translations-of"]   = "Lus txhais: %s"
  1029. Locale["hmn"]["family"]            = "Hmong-Mien"
  1030. Locale["hmn"]["iso"]               = "hmn"
  1031. Locale["hmn"]["glotto"]            = "firs1234"
  1032. Locale["hmn"]["script"]            = "Latn"
  1033. Locale["hu"]["name"]               = "Hungarian"
  1034. Locale["hu"]["endonym"]            = "Magyar"
  1035. Locale["hu"]["translations-of"]    = "%s fordĆ­tĆ”sai"
  1036. Locale["hu"]["definitions-of"]     = "%s jelentĆ©sei"
  1037. Locale["hu"]["synonyms"]           = "SzinonimĆ”k"
  1038. Locale["hu"]["examples"]           = "PĆ©ldĆ”k"
  1039. Locale["hu"]["see-also"]           = "LĆ”sd mĆ©g"
  1040. Locale["hu"]["family"]             = "Uralic"
  1041. Locale["hu"]["iso"]                = "hun"
  1042. Locale["hu"]["glotto"]             = "hung1274"
  1043. Locale["hu"]["script"]             = "Latn"
  1044. Locale["is"]["name"]               = "Icelandic"
  1045. Locale["is"]["endonym"]            = "ƍslenska"
  1046. Locale["is"]["translations-of"]    = "ĆžĆ½Ć°ingar Ć” %s"
  1047. Locale["is"]["definitions-of"]     = "Skilgreiningar Ć”"
  1048. Locale["is"]["synonyms"]           = "Samheiti"
  1049. Locale["is"]["examples"]           = "DƦmi"
  1050. Locale["is"]["see-also"]           = "SjĆ” einnig"
  1051. Locale["is"]["family"]             = "Indo-European"
  1052. Locale["is"]["iso"]                = "isl"
  1053. Locale["is"]["glotto"]             = "icel1247"
  1054. Locale["is"]["script"]             = "Latn"
  1055. Locale["ig"]["name"]               = "Igbo"
  1056. Locale["ig"]["endonym"]            = "Igbo"
  1057. Locale["ig"]["translations-of"]    = "Ntį»„gharį»‹ asį»„sį»„ nke %s"
  1058. Locale["ig"]["definitions-of"]     = "Nkį»wapį»„ta nke %s"
  1059. Locale["ig"]["synonyms"]           = "Okwu oyiri"
  1060. Locale["ig"]["examples"]           = "į»Œmį»„maatį»„"
  1061. Locale["ig"]["see-also"]           = "Hį»„kwuo"
  1062. Locale["ig"]["family"]             = "Atlantic-Congo"
  1063. Locale["ig"]["iso"]                = "ibo"
  1064. Locale["ig"]["glotto"]             = "nucl1417"
  1065. Locale["ig"]["script"]             = "Latn"
  1066. Locale["id"]["name"]               = "Indonesian"
  1067. Locale["id"]["endonym"]            = "Bahasa Indonesia"
  1068. Locale["id"]["translations-of"]    = "Terjemahan dari %s"
  1069. Locale["id"]["definitions-of"]     = "Definisi %s"
  1070. Locale["id"]["synonyms"]           = "Sinonim"
  1071. Locale["id"]["examples"]           = "Contoh"
  1072. Locale["id"]["see-also"]           = "Lihat juga"
  1073. Locale["id"]["family"]             = "Austronesian"
  1074. Locale["id"]["iso"]                = "ind"
  1075. Locale["id"]["glotto"]             = "indo1316"
  1076. Locale["id"]["script"]             = "Latn"
  1077. Locale["ga"]["name"]               = "Irish"
  1078. Locale["ga"]["endonym"]            = "Gaeilge"
  1079. Locale["ga"]["translations-of"]    = "AistriĆŗchĆ”in ar %s"
  1080. Locale["ga"]["definitions-of"]     = "SainmhĆ­nithe ar %s"
  1081. Locale["ga"]["synonyms"]           = "Comhchiallaigh"
  1082. Locale["ga"]["examples"]           = "SamplaĆ­"
  1083. Locale["ga"]["see-also"]           = "fĆ©ach freisin"
  1084. Locale["ga"]["family"]             = "Indo-European"
  1085. Locale["ga"]["iso"]                = "gle"
  1086. Locale["ga"]["glotto"]             = "iris1253"
  1087. Locale["ga"]["script"]             = "Latn"
  1088. Locale["it"]["name"]               = "Italian"
  1089. Locale["it"]["endonym"]            = "Italiano"
  1090. Locale["it"]["translations-of"]    = "Traduzioni di %s"
  1091. Locale["it"]["definitions-of"]     = "Definizioni di %s"
  1092. Locale["it"]["synonyms"]           = "Sinonimi"
  1093. Locale["it"]["examples"]           = "Esempi"
  1094. Locale["it"]["see-also"]           = "Vedi anche"
  1095. Locale["it"]["family"]             = "Indo-European"
  1096. Locale["it"]["iso"]                = "ita"
  1097. Locale["it"]["glotto"]             = "ital1282"
  1098. Locale["it"]["script"]             = "Latn"
  1099. Locale["it"]["dictionary"]         = "true"
  1100. Locale["ja"]["name"]               = "Japanese"
  1101. Locale["ja"]["endonym"]            = "ę—„ęœ¬čŖž"
  1102. Locale["ja"]["translations-of"]    = "怌%sć€ć®ēæ»čس"
  1103. Locale["ja"]["definitions-of"]     = "%s ć®å®šē¾©"
  1104. Locale["ja"]["synonyms"]           = "同ē¾©čŖž"
  1105. Locale["ja"]["examples"]           = "例"
  1106. Locale["ja"]["see-also"]           = "関連項ē›®"
  1107. Locale["ja"]["family"]             = "Japonic"
  1108. Locale["ja"]["iso"]                = "jpn"
  1109. Locale["ja"]["glotto"]             = "nucl1643"
  1110. Locale["ja"]["script"]             = "Jpan"
  1111. Locale["ja"]["dictionary"]         = "true"
  1112. Locale["jv"]["name"]               = "Javanese"
  1113. Locale["jv"]["endonym"]            = "Basa Jawa"
  1114. Locale["jv"]["translations-of"]    = "Terjemahan %s"
  1115. Locale["jv"]["definitions-of"]     = "Arti %s"
  1116. Locale["jv"]["synonyms"]           = "Sinonim"
  1117. Locale["jv"]["examples"]           = "Conto"
  1118. Locale["jv"]["see-also"]           = "Deleng uga"
  1119. Locale["jv"]["family"]             = "Austronesian"
  1120. Locale["jv"]["iso"]                = "jav"
  1121. Locale["jv"]["glotto"]             = "java1254"
  1122. Locale["jv"]["script"]             = "Latn"
  1123. Locale["kn"]["name"]               = "Kannada"
  1124. Locale["kn"]["endonym"]            = "ą²•ą²Øą³ą²Øą²”"
  1125. Locale["kn"]["translations-of"]    = "%s ą²Ø ą²…ą²Øą³ą²µą²¾ą²¦ą²—ą²³ą³"
  1126. Locale["kn"]["definitions-of"]     = "%s ą²Ø ą²µą³ą²Æą²¾ą²–ą³ą²Æą²¾ą²Øą²—ą²³ą³"
  1127. Locale["kn"]["synonyms"]           = "ą²øą²®ą²¾ą²Øą²¾ą²°ą³ą²„ą²•ą²—ą²³ą³"
  1128. Locale["kn"]["examples"]           = "ą²‰ą²¦ą²¾ą²¹ą²°ą²£ą³†ą²—ą²³ą³"
  1129. Locale["kn"]["see-also"]           = "ą²‡ą²¦ą²Øą³ą²Øą³‚ ą²—ą²®ą²Øą²æą²øą²æ"
  1130. Locale["kn"]["family"]             = "Dravidian"
  1131. Locale["kn"]["iso"]                = "kan"
  1132. Locale["kn"]["glotto"]             = "nucl1305"
  1133. Locale["kn"]["script"]             = "Knda"
  1134. Locale["kk"]["name"]               = "Kazakh"
  1135. Locale["kk"]["endonym"]            = "ŅšŠ°Š·Š°Ņ› тіŠ»Ń–"
  1136. Locale["kk"]["translations-of"]    = "%s Š°ŃƒŠ“Š°Ń€Š¼Š°Š»Š°Ń€Ń‹"
  1137. Locale["kk"]["definitions-of"]     = "%s Š°Š½Ń‹Ņ›Ń‚Š°Š¼Š°Š»Š°Ń€Ń‹"
  1138. Locale["kk"]["synonyms"]           = "Š”ŠøŠ½Š¾Š½ŠøŠ¼Š“ŠµŃ€"
  1139. Locale["kk"]["examples"]           = "ŠœŃ‹ŃŠ°Š»Š“Š°Ń€"
  1140. Locale["kk"]["see-also"]           = "ŠšŠµŠ»ŠµŃŃ– тіŠ·Ń–Š¼Š“і Š“Šµ ŠŗөріŅ£Ń–Š·:"
  1141. Locale["kk"]["family"]             = "Turkic"
  1142. Locale["kk"]["iso"]                = "kaz"
  1143. Locale["kk"]["glotto"]             = "kaza1248"
  1144. Locale["kk"]["script"]             = "Cyrl"
  1145. Locale["km"]["name"]               = "Khmer"
  1146. Locale["km"]["endonym"]            = "įž—įž¶įžŸįž¶įžįŸ’įž˜įŸ‚įžš"
  1147. Locale["km"]["translations-of"]    = "įž€įž¶įžšā€‹įž”įž€ā€‹įž”įŸ’įžšįŸ‚ā€‹įž“įŸƒ %s"
  1148. Locale["km"]["definitions-of"]     = "įž“įž·įž™įž˜įž“įŸįž™ā€‹įž“įŸƒā€‹ %s"
  1149. Locale["km"]["synonyms"]           = "įžŸįž‘įž·įžŸįž“įŸįž™"
  1150. Locale["km"]["examples"]           = "įž§įž‘įž¶įž įžšįžŽįŸ"
  1151. Locale["km"]["see-also"]           = "įž˜įž¾įž›ā€‹įž•įž„ā€‹įžŠįŸ‚įžš"
  1152. Locale["km"]["family"]             = "Austroasiatic"
  1153. Locale["km"]["iso"]                = "khm"
  1154. Locale["km"]["glotto"]             = "cent1989"
  1155. Locale["km"]["script"]             = "Khmr"
  1156. Locale["ko"]["name"]               = "Korean"
  1157. Locale["ko"]["endonym"]            = "ķ•œźµ­ģ–“"
  1158. Locale["ko"]["translations-of"]    = "%sģ˜ ė²ˆģ—­"
  1159. Locale["ko"]["definitions-of"]     = "%sģ˜ ģ •ģ˜"
  1160. Locale["ko"]["synonyms"]           = "ė™ģ˜ģ–“"
  1161. Locale["ko"]["examples"]           = "ģ˜ˆė¬ø"
  1162. Locale["ko"]["see-also"]           = "ģ°øģ”°"
  1163. Locale["ko"]["family"]             = "Koreanic"
  1164. Locale["ko"]["iso"]                = "kor"
  1165. Locale["ko"]["glotto"]             = "kore1280"
  1166. Locale["ko"]["script"]             = "Kore"
  1167. Locale["ko"]["dictionary"]         = "true"
  1168. Locale["ku"]["name"]               = "Kurdish"
  1169. Locale["ku"]["endonym"]            = "KurdĆ®"
  1170. Locale["ku"]["family"]             = "Indo-European"
  1171. Locale["ku"]["iso"]                = "kur"
  1172. Locale["ku"]["glotto"]             = "kurd1259"
  1173. Locale["ku"]["script"]             = "Latn"
  1174. Locale["ky"]["name"]               = "Kyrgyz"
  1175. Locale["ky"]["endonym"]            = "ŠšŃ‹Ń€Š³Ń‹Š·Ń‡Š°"
  1176. Locale["ky"]["translations-of"]    = "%s ŠŗŠ¾Ń‚Š¾Ń€Š¼Š¾ŃŃƒ"
  1177. Locale["ky"]["definitions-of"]     = "%s Š°Š½Ń‹ŠŗтŠ°Š¼Š°ŃŃ‹"
  1178. Locale["ky"]["synonyms"]           = "Š”ŠøŠ½Š¾Š½ŠøŠ¼Š“ŠµŃ€"
  1179. Locale["ky"]["examples"]           = "ŠœŠøсŠ°Š»Š“Š°Ń€"
  1180. Locale["ky"]["see-also"]           = "Š”Š°Š³Ń‹ ŠŗŠ°Ń€Š°Ņ£Ń‹Š·"
  1181. Locale["ky"]["family"]             = "Turkic"
  1182. Locale["ky"]["iso"]                = "kir"
  1183. Locale["ky"]["glotto"]             = "kirg1245"
  1184. Locale["ky"]["script"]             = "Cyrl"
  1185. Locale["lo"]["name"]               = "Lao"
  1186. Locale["lo"]["endonym"]            = "ąŗ„ąŗ²ąŗ§"
  1187. Locale["lo"]["translations-of"]    = "ąŗ„ąŗ³ā€‹ą»ąŗ›ā€‹ąŗŖąŗ³ąŗ„ąŗ±ąŗš %s"
  1188. Locale["lo"]["definitions-of"]     = "ąŗ„ąŗ§ąŗ²ąŗ”ą»ąŗ²ąŗąŗ‚ąŗ­ąŗ‡ %s"
  1189. Locale["lo"]["synonyms"]           = "ąŗ„ąŗ³ąŗ—ąŗµą»ˆąŗ„ą»‰ąŗ²ąŗąŗąŗ±ąŗ™ %s"
  1190. Locale["lo"]["examples"]           = "ąŗ•ąŗ»ąŗ§ąŗ¢ą»ˆąŗ²ąŗ‡"
  1191. Locale["lo"]["see-also"]           = "ą»€ąŗšąŗ“ą»ˆąŗ‡ā€‹ą»€ąŗžąŗµą»ˆąŗ”ā€‹ą»€ąŗ•ąŗµąŗ”"
  1192. Locale["lo"]["family"]             = "Tai-Kadai"
  1193. Locale["lo"]["iso"]                = "lao"
  1194. Locale["lo"]["glotto"]             = "laoo1244"
  1195. Locale["lo"]["script"]             = "Laoo"
  1196. Locale["la"]["name"]               = "Latin"
  1197. Locale["la"]["endonym"]            = "Latina"
  1198. Locale["la"]["translations-of"]    = "Versio de %s"
  1199. Locale["la"]["family"]             = "Indo-European"
  1200. Locale["la"]["iso"]                = "lat"
  1201. Locale["la"]["glotto"]             = "lati1261"
  1202. Locale["la"]["script"]             = "Latn"
  1203. Locale["lv"]["name"]               = "Latvian"
  1204. Locale["lv"]["endonym"]            = "LatvieÅ”u"
  1205. Locale["lv"]["translations-of"]    = "%s tulkojumi"
  1206. Locale["lv"]["definitions-of"]     = "%s definÄ«cijas"
  1207. Locale["lv"]["synonyms"]           = "SinonÄ«mi"
  1208. Locale["lv"]["examples"]           = "Piemēri"
  1209. Locale["lv"]["see-also"]           = "Skatiet arÄ«"
  1210. Locale["lv"]["family"]             = "Indo-European"
  1211. Locale["lv"]["iso"]                = "lav"
  1212. Locale["lv"]["glotto"]             = "latv1249"
  1213. Locale["lv"]["script"]             = "Latn"
  1214. Locale["lt"]["name"]               = "Lithuanian"
  1215. Locale["lt"]["endonym"]            = "Lietuvių"
  1216. Locale["lt"]["translations-of"]    = "ā€ž%sā€œ vertimai"
  1217. Locale["lt"]["definitions-of"]     = "ā€ž%sā€œ apibrėžimai"
  1218. Locale["lt"]["synonyms"]           = "Sinonimai"
  1219. Locale["lt"]["examples"]           = "Pavyzdžiai"
  1220. Locale["lt"]["see-also"]           = "Taip pat žiÅ«rėkite"
  1221. Locale["lt"]["family"]             = "Indo-European"
  1222. Locale["lt"]["iso"]                = "lit"
  1223. Locale["lt"]["glotto"]             = "lith1251"
  1224. Locale["lt"]["script"]             = "Latn"
  1225. Locale["lb"]["name"]               = "Luxembourgish"
  1226. Locale["lb"]["endonym"]            = "LĆ«tzebuergesch"
  1227. Locale["lb"]["family"]             = "Indo-European"
  1228. Locale["lb"]["iso"]                = "ltz"
  1229. Locale["lb"]["glotto"]             = "luxe1241"
  1230. Locale["lb"]["script"]             = "Latn"
  1231. Locale["mk"]["name"]               = "Macedonian"
  1232. Locale["mk"]["endonym"]            = "ŠœŠ°ŠŗŠµŠ“Š¾Š½ŃŠŗŠø"
  1233. Locale["mk"]["translations-of"]    = "ŠŸŃ€ŠµŠ²Š¾Š“Šø Š½Š° %s"
  1234. Locale["mk"]["definitions-of"]     = "Š”ŠµŃ„ŠøŠ½ŠøцŠøŠø Š½Š° %s"
  1235. Locale["mk"]["synonyms"]           = "Š”ŠøŠ½Š¾Š½ŠøŠ¼Šø"
  1236. Locale["mk"]["examples"]           = "ŠŸŃ€ŠøŠ¼ŠµŃ€Šø"
  1237. Locale["mk"]["see-also"]           = "Š’ŠøŠ“Šø Šø"
  1238. Locale["mk"]["family"]             = "Indo-European"
  1239. Locale["mk"]["iso"]                = "mkd"
  1240. Locale["mk"]["glotto"]             = "mace1250"
  1241. Locale["mk"]["script"]             = "Cyrl"
  1242. Locale["mg"]["name"]               = "Malagasy"
  1243. Locale["mg"]["endonym"]            = "Malagasy"
  1244. Locale["mg"]["translations-of"]    = "Dikan'ny %s"
  1245. Locale["mg"]["definitions-of"]     = "Famaritana ny %s"
  1246. Locale["mg"]["synonyms"]           = "Mitovy hevitra"
  1247. Locale["mg"]["examples"]           = "Ohatra"
  1248. Locale["mg"]["see-also"]           = "Jereo ihany koa"
  1249. Locale["mg"]["family"]             = "Austronesian"
  1250. Locale["mg"]["iso"]                = "mlg"
  1251. Locale["mg"]["glotto"]             = "plat1254"
  1252. Locale["mg"]["script"]             = "Latn"
  1253. Locale["ms"]["name"]               = "Malay"
  1254. Locale["ms"]["endonym"]            = "Bahasa Melayu"
  1255. Locale["ms"]["translations-of"]    = "Terjemahan %s"
  1256. Locale["ms"]["definitions-of"]     = "Takrif %s"
  1257. Locale["ms"]["synonyms"]           = "Sinonim"
  1258. Locale["ms"]["examples"]           = "Contoh"
  1259. Locale["ms"]["see-also"]           = "Lihat juga"
  1260. Locale["ms"]["family"]             = "Austronesian"
  1261. Locale["ms"]["iso"]                = "msa"
  1262. Locale["ms"]["glotto"]             = "stan1306"
  1263. Locale["ms"]["script"]             = "Latn"
  1264. Locale["ml"]["name"]               = "Malayalam"
  1265. Locale["ml"]["endonym"]            = "ą“®ą“²ą“Æą“¾ą“³ą“‚"
  1266. Locale["ml"]["translations-of"]    = "%s ą“Žą“Øąµą“Øą“¤ą“æą“Øąµą“±ąµ† ą“µą“æą“µąµ¼ą“¤ąµą“¤ą“Øą“™ąµą“™ąµ¾"
  1267. Locale["ml"]["definitions-of"]     = "%s ą“Žą“Øąµą“Øą“¤ą“æą“Øąµą“±ąµ† ą“Øą“æąµ¼ą“µąµą“µą“šą“Øą“™ąµą“™ąµ¾"
  1268. Locale["ml"]["synonyms"]           = "ą“Ŗą“°ąµą“Æą“¾ą“Æą“™ąµą“™ą“³ąµā€"
  1269. Locale["ml"]["examples"]           = "ą“‰ą“¦ą“¾ą“¹ą“°ą“£ą“™ąµą“™ą“³ąµā€"
  1270. Locale["ml"]["see-also"]           = "ą“‡ą“¤ąµą“‚ ą“•ą“¾ą“£ąµą“•"
  1271. Locale["ml"]["family"]             = "Dravidian"
  1272. Locale["ml"]["iso"]                = "mal"
  1273. Locale["ml"]["glotto"]             = "mala1464"
  1274. Locale["ml"]["script"]             = "Mlym"
  1275. Locale["mt"]["name"]               = "Maltese"
  1276. Locale["mt"]["endonym"]            = "Malti"
  1277. Locale["mt"]["translations-of"]    = "Traduzzjonijiet ta' %s"
  1278. Locale["mt"]["definitions-of"]     = "Definizzjonijiet ta' %s"
  1279. Locale["mt"]["synonyms"]           = "Sinonimi"
  1280. Locale["mt"]["examples"]           = "Eżempji"
  1281. Locale["mt"]["see-also"]           = "Ara wkoll"
  1282. Locale["mt"]["family"]             = "Afro-Asiatic"
  1283. Locale["mt"]["iso"]                = "mlt"
  1284. Locale["mt"]["glotto"]             = "malt1254"
  1285. Locale["mt"]["script"]             = "Latn"
  1286. Locale["mi"]["name"]               = "Maori"
  1287. Locale["mi"]["endonym"]            = "Māori"
  1288. Locale["mi"]["translations-of"]    = "Ngā whakamāoritanga o %s"
  1289. Locale["mi"]["definitions-of"]     = "Ngā whakamārama o %s"
  1290. Locale["mi"]["synonyms"]           = "Ngā Kupu Taurite"
  1291. Locale["mi"]["examples"]           = "Ngā Tauira:"
  1292. Locale["mi"]["see-also"]           = "Tiro hoki:"
  1293. Locale["mi"]["family"]             = "Austronesian"
  1294. Locale["mi"]["iso"]                = "mri"
  1295. Locale["mi"]["glotto"]             = "maor1246"
  1296. Locale["mi"]["script"]             = "Latn"
  1297. Locale["mr"]["name"]               = "Marathi"
  1298. Locale["mr"]["endonym"]            = "ą¤®ą¤°ą¤¾ą¤ ą„€"
  1299. Locale["mr"]["translations-of"]    = "%s ą¤šą„€ ą¤­ą¤¾ą¤·ą¤¾ą¤‚ą¤¤ą¤°ą„‡"
  1300. Locale["mr"]["definitions-of"]     = "%s ą¤šą„ą¤Æą¤¾ ą¤µą„ą¤Æą¤¾ą¤–ą„ą¤Æą¤¾"
  1301. Locale["mr"]["synonyms"]           = "ą¤øą¤®ą¤¾ą¤Øą¤¾ą¤°ą„ą¤„ą„€ ą¤¶ą¤¬ą„ą¤¦"
  1302. Locale["mr"]["examples"]           = "ą¤‰ą¤¦ą¤¾ą¤¹ą¤°ą¤£ą„‡"
  1303. Locale["mr"]["see-also"]           = "ą¤¹ą„‡ ą¤¦ą„‡ą¤–ą„€ą¤² ą¤Ŗą¤¹ą¤¾"
  1304. Locale["mr"]["family"]             = "Indo-European"
  1305. Locale["mr"]["iso"]                = "mar"
  1306. Locale["mr"]["glotto"]             = "mara1378"
  1307. Locale["mr"]["script"]             = "Deva"
  1308. Locale["mn"]["name"]               = "Mongolian"
  1309. Locale["mn"]["endonym"]            = "ŠœŠ¾Š½Š³Š¾Š»"
  1310. Locale["mn"]["translations-of"]    = "%s-Š½ Š¾Ń€Ń‡ŃƒŃƒŠ»Š³Š°"
  1311. Locale["mn"]["definitions-of"]     = "%s ŅÆŠ³ŠøŠ¹Š½ тŠ¾Š“Š¾Ń€Ń…Š¾Š¹Š»Š¾Š»Ń‚"
  1312. Locale["mn"]["synonyms"]           = "ŠžŠ¹Ń€Š¾Š»Ń†Š¾Š¾ утŠ³Š°Ń‚Š°Š¹"
  1313. Locale["mn"]["examples"]           = "Š–ŠøшээŠ½ŅÆŅÆŠ“"
  1314. Locale["mn"]["see-also"]           = "ŠœÓ©Š½ хŠ°Ń€Š°Ń…"
  1315. Locale["mn"]["family"]             = "Mongolic"
  1316. Locale["mn"]["iso"]                = "mon"
  1317. Locale["mn"]["glotto"]             = "mong1331"
  1318. Locale["mn"]["script"]             = "Cyrl"
  1319. Locale["my"]["name"]               = "Myanmar"
  1320. Locale["my"]["endonym"]            = "į€™į€¼į€”į€ŗį€™į€¬į€…į€¬"
  1321. Locale["my"]["translations-of"]    = "%sį į€˜į€¬į€žį€¬į€•į€¼į€”į€ŗį€†į€­į€Æį€į€»į€€į€ŗį€™į€»į€¬į€ø"
  1322. Locale["my"]["definitions-of"]     = "%sį į€”į€”į€€į€ŗį€–į€½į€„į€ŗį€·į€†į€­į€Æį€į€»į€€į€ŗį€™į€»į€¬į€ø"
  1323. Locale["my"]["synonyms"]           = "į€€į€¼į€±į€¬į€„į€ŗį€øį€į€°į€žį€¶į€€į€½į€²į€™į€»į€¬į€ø"
  1324. Locale["my"]["examples"]           = "į€„į€•į€™į€¬"
  1325. Locale["my"]["see-also"]           = "į€–į€±į€¬į€ŗį€•į€¼į€•į€«į€™į€»į€¬į€øį€€į€­į€Æį€œį€² į€€į€¼į€Šį€ŗį€·į€•į€«"
  1326. Locale["my"]["family"]             = "Sino-Tibetan"
  1327. Locale["my"]["iso"]                = "mya"
  1328. Locale["my"]["glotto"]             = "nucl1310"
  1329. Locale["my"]["script"]             = "Mymr"
  1330. Locale["ne"]["name"]               = "Nepali"
  1331. Locale["ne"]["endonym"]            = "ą¤Øą„‡ą¤Ŗą¤¾ą¤²ą„€"
  1332. Locale["ne"]["translations-of"]    = "%są¤•ą¤¾ ą¤…ą¤Øą„ą¤µą¤¾ą¤¦"
  1333. Locale["ne"]["definitions-of"]     = "%są¤•ą„‹ ą¤Ŗą¤°ą¤æą¤­ą¤¾ą¤·ą¤¾"
  1334. Locale["ne"]["synonyms"]           = "ą¤øą¤®ą¤¾ą¤Øą¤¾ą¤°ą„ą¤„ą„€ą¤¹ą¤°ą„‚"
  1335. Locale["ne"]["examples"]           = "ą¤‰ą¤¦ą¤¾ą¤¹ą¤°ą¤£ą¤¹ą¤°ą„"
  1336. Locale["ne"]["see-also"]           = "ą¤Æą„‹ ą¤Ŗą¤Øą¤æ ą¤¹ą„‡ą¤°ą„ą¤Øą„ą¤¹ą„‹ą¤øą„"
  1337. Locale["ne"]["family"]             = "Indo-European"
  1338. Locale["ne"]["iso"]                = "nep"
  1339. Locale["ne"]["glotto"]             = "nepa1254"
  1340. Locale["ne"]["script"]             = "Deva"
  1341. Locale["no"]["name"]               = "Norwegian"
  1342. Locale["no"]["endonym"]            = "Norsk"
  1343. Locale["no"]["translations-of"]    = "Oversettelser av %s"
  1344. Locale["no"]["definitions-of"]     = "Definisjoner av %s"
  1345. Locale["no"]["synonyms"]           = "Synonymer"
  1346. Locale["no"]["examples"]           = "Eksempler"
  1347. Locale["no"]["see-also"]           = "Se ogsĆ„"
  1348. Locale["no"]["family"]             = "Indo-European"
  1349. Locale["no"]["iso"]                = "nor"
  1350. Locale["no"]["glotto"]             = "norw1258"
  1351. Locale["no"]["script"]             = "Latn"
  1352. Locale["ps"]["name"]               = "Pashto"
  1353. Locale["ps"]["endonym"]            = "Ł¾ŚšŲŖŁˆ"
  1354. Locale["ps"]["translations-of"]    = "ŲÆ %sŚ˜ŲØŲ§Ś“Ū"
  1355. Locale["ps"]["definitions-of"]     = "ŲÆ%s ŲŖŲ¹Ų±ŪŒŁŁˆŁ†Ł‡"
  1356. Locale["ps"]["synonyms"]           = "Ł…ŲŖŲ±Ų§ŲÆŁ Ł„ŲŗŲŖŁˆŁ†Ł‡"
  1357. Locale["ps"]["examples"]           = "ŲØŪŁ„Ś«Ū"
  1358. Locale["ps"]["see-also"]           = "ŲÆŲ§ Ł‡Ł… ŁˆŁˆŪŒŁ†Ų¦"
  1359. Locale["ps"]["family"]             = "Indo-European"
  1360. Locale["ps"]["iso"]                = "pus"
  1361. Locale["ps"]["glotto"]             = "pash1269"
  1362. Locale["ps"]["script"]             = "Arab"
  1363. Locale["ps"]["rtl"]                = "true"
  1364. Locale["fa"]["name"]               = "Persian"
  1365. Locale["fa"]["endonym"]            = "ŁŲ§Ų±Ų³ŪŒ"
  1366. Locale["fa"]["translations-of"]    = "ŲŖŲ±Ų¬Ł…Ł‡ā€ŒŁ‡Ų§ŪŒ %s"
  1367. Locale["fa"]["definitions-of"]     = "ŲŖŲ¹Ų±ŪŒŁā€ŒŁ‡Ų§ŪŒ %s"
  1368. Locale["fa"]["synonyms"]           = "Ł…ŲŖŲ±Ų§ŲÆŁā€ŒŁ‡Ų§"
  1369. Locale["fa"]["examples"]           = "Ł…Ų«Ų§Ł„ā€ŒŁ‡Ų§"
  1370. Locale["fa"]["see-also"]           = "Ł‡Ł…Ś†Ł†ŪŒŁ† Ł…Ų±Ų§Ų¬Ų¹Ł‡ Ś©Ł†ŪŒŲÆ ŲØŁ‡"
  1371. Locale["fa"]["family"]             = "Indo-European"
  1372. Locale["fa"]["iso"]                = "fas"
  1373. Locale["fa"]["glotto"]             = "west2369"
  1374. Locale["fa"]["script"]             = "Arab"
  1375. Locale["fa"]["rtl"]                = "true"
  1376. Locale["pl"]["name"]               = "Polish"
  1377. Locale["pl"]["endonym"]            = "Polski"
  1378. Locale["pl"]["translations-of"]    = "Tłumaczenia %s"
  1379. Locale["pl"]["definitions-of"]     = "%s ā€“ definicje"
  1380. Locale["pl"]["synonyms"]           = "Synonimy"
  1381. Locale["pl"]["examples"]           = "Przykłady"
  1382. Locale["pl"]["see-also"]           = "Zobacz też"
  1383. Locale["pl"]["family"]             = "Indo-European"
  1384. Locale["pl"]["iso"]                = "pol"
  1385. Locale["pl"]["glotto"]             = "poli1260"
  1386. Locale["pl"]["script"]             = "Latn"
  1387. Locale["pt"]["name"]               = "Portuguese"
  1388. Locale["pt"]["endonym"]            = "PortuguĆŖs"
  1389. Locale["pt"]["translations-of"]    = "TraduƧƵes de %s"
  1390. Locale["pt"]["definitions-of"]     = "DefiniƧƵes de %s"
  1391. Locale["pt"]["synonyms"]           = "SinĆ“nimos"
  1392. Locale["pt"]["examples"]           = "Exemplos"
  1393. Locale["pt"]["see-also"]           = "Veja tambĆ©m"
  1394. Locale["pt"]["family"]             = "Indo-European"
  1395. Locale["pt"]["iso"]                = "por"
  1396. Locale["pt"]["glotto"]             = "port1283"
  1397. Locale["pt"]["script"]             = "Latn"
  1398. Locale["pt"]["dictionary"]         = "true"
  1399. Locale["pa"]["name"]               = "Punjabi"
  1400. Locale["pa"]["endonym"]            = "ąØŖą©°ąØœąØ¾ąØ¬ą©€"
  1401. Locale["pa"]["translations-of"]    = "ąØ¦ą©‡ ąØ…ąØØą©ąØµąØ¾ąØ¦%s"
  1402. Locale["pa"]["definitions-of"]     = "ąØ¦ą©€ąØ†ąØ‚ ąØŖąØ°ąØæąØ­ąØ¾ąØøąØ¼ąØ¾ %s"
  1403. Locale["pa"]["synonyms"]           = "ąØøąØ®ąØ¾ąØØąØ¾ąØ°ąØ„ąØ• ąØ¶ąØ¬ąØ¦"
  1404. Locale["pa"]["examples"]           = "ąØ‰ąØ¦ąØ¾ąØ¹ąØ°ąØ£ąØ¾ąØ‚"
  1405. Locale["pa"]["see-also"]           = "ąØ‡ąØ¹ ąØµą©€ ąØµą©‡ąØ–ą©‹"
  1406. Locale["pa"]["family"]             = "Indo-European"
  1407. Locale["pa"]["iso"]                = "pan"
  1408. Locale["pa"]["glotto"]             = "panj1256"
  1409. Locale["pa"]["script"]             = "Guru"
  1410. Locale["ro"]["name"]               = "Romanian"
  1411. Locale["ro"]["endonym"]            = "RomĆ¢nă"
  1412. Locale["ro"]["translations-of"]    = "Traduceri pentru %s"
  1413. Locale["ro"]["definitions-of"]     = "Definiții pentru %s"
  1414. Locale["ro"]["synonyms"]           = "Sinonime"
  1415. Locale["ro"]["examples"]           = "Exemple"
  1416. Locale["ro"]["see-also"]           = "Vedeți și"
  1417. Locale["ro"]["family"]             = "Indo-European"
  1418. Locale["ro"]["iso"]                = "ron"
  1419. Locale["ro"]["glotto"]             = "roma1327"
  1420. Locale["ro"]["script"]             = "Latn"
  1421. Locale["ru"]["name"]               = "Russian"
  1422. Locale["ru"]["endonym"]            = "Š ŃƒŃŃŠŗŠøŠ¹"
  1423. Locale["ru"]["translations-of"]    = "%s: Š²Š°Ń€ŠøŠ°Š½Ń‚Ń‹ ŠæŠµŃ€ŠµŠ²Š¾Š“Š°"
  1424. Locale["ru"]["definitions-of"]     = "%s ā€“ Š¾ŠæрŠµŠ“ŠµŠ»ŠµŠ½Šøя"
  1425. Locale["ru"]["synonyms"]           = "Š”ŠøŠ½Š¾Š½ŠøŠ¼Ń‹"
  1426. Locale["ru"]["examples"]           = "ŠŸŃ€ŠøŠ¼ŠµŃ€Ń‹"
  1427. Locale["ru"]["see-also"]           = "ŠŸŠ¾Ń…Š¾Š¶ŠøŠµ сŠ»Š¾Š²Š°"
  1428. Locale["ru"]["family"]             = "Indo-European"
  1429. Locale["ru"]["iso"]                = "rus"
  1430. Locale["ru"]["glotto"]             = "russ1263"
  1431. Locale["ru"]["script"]             = "Cyrl"
  1432. Locale["ru"]["dictionary"]         = "true"
  1433. Locale["sm"]["name"]               = "Samoan"
  1434. Locale["sm"]["endonym"]            = "Gagana Sāmoa"
  1435. Locale["sm"]["family"]             = "Austronesian"
  1436. Locale["sm"]["iso"]                = "smo"
  1437. Locale["sm"]["glotto"]             = "samo1305"
  1438. Locale["sm"]["script"]             = "Latn"
  1439. Locale["gd"]["name"]               = "Scots Gaelic"
  1440. Locale["gd"]["endonym"]            = "GĆ idhlig"
  1441. Locale["gd"]["translations-of"]    = "Eadar-theangachadh airson %s"
  1442. Locale["gd"]["definitions-of"]     = "Deifiniseanan airson %s"
  1443. Locale["gd"]["synonyms"]           = "Co-fhaclan"
  1444. Locale["gd"]["examples"]           = "Buill-eisimpleir"
  1445. Locale["gd"]["see-also"]           = "Faic na leanas cuideachd"
  1446. Locale["gd"]["family"]             = "Indo-European"
  1447. Locale["gd"]["iso"]                = "gla"
  1448. Locale["gd"]["glotto"]             = "scot1245"
  1449. Locale["gd"]["script"]             = "Latn"
  1450. Locale["sr-Cyrl"]["name"]          = "Serbian (Cyrillic)"
  1451. Locale["sr-Cyrl"]["endonym"]       = "срŠæсŠŗŠø"
  1452. Locale["sr-Cyrl"]["translations-of"] = "ŠŸŃ€ŠµŠ²Š¾Š“Šø Š·Š° ā€ž%sā€œ"
  1453. Locale["sr-Cyrl"]["definitions-of"]  = "Š”ŠµŃ„ŠøŠ½ŠøцŠøјŠµ Š·Š° %s"
  1454. Locale["sr-Cyrl"]["synonyms"]      = "Š”ŠøŠ½Š¾Š½ŠøŠ¼Šø"
  1455. Locale["sr-Cyrl"]["examples"]      = "ŠŸŃ€ŠøŠ¼ŠµŃ€Šø"
  1456. Locale["sr-Cyrl"]["see-also"]      = "ŠŸŠ¾Š³Š»ŠµŠ“Š°Ń˜Ń‚Šµ тŠ°ŠŗŠ¾Ń’Šµ"
  1457. Locale["sr-Cyrl"]["family"]        = "Indo-European"
  1458. Locale["sr-Cyrl"]["iso"]           = "srp-Cyrl"
  1459. Locale["sr-Cyrl"]["glotto"]        = "serb1264"
  1460. Locale["sr-Cyrl"]["script"]        = "Cyrl"
  1461. Locale["sr-Latn"]["name"]          = "Serbian (Latin)"
  1462. Locale["sr-Latn"]["endonym"]       = "srpski"
  1463. Locale["sr-Latn"]["translations-of"] = "Prevodi za ā€ž%sā€œ"
  1464. Locale["sr-Latn"]["definitions-of"]  = "Definicije za %s"
  1465. Locale["sr-Latn"]["synonyms"]      = "Sinonimi"
  1466. Locale["sr-Latn"]["examples"]      = "Primeri"
  1467. Locale["sr-Latn"]["see-also"]      = "Pogledajte takođe"
  1468. Locale["sr-Latn"]["family"]        = "Indo-European"
  1469. Locale["sr-Latn"]["iso"]           = "srp-Latn"
  1470. Locale["sr-Latn"]["glotto"]        = "serb1264"
  1471. Locale["sr-Latn"]["script"]        = "Latn"
  1472. Locale["st"]["name"]               = "Sesotho"
  1473. Locale["st"]["endonym"]            = "Sesotho"
  1474. Locale["st"]["translations-of"]    = "Liphetolelo tsa %s"
  1475. Locale["st"]["definitions-of"]     = "Meelelo ea %s"
  1476. Locale["st"]["synonyms"]           = "Mantsoe a tÅ”oanang ka moelelo"
  1477. Locale["st"]["examples"]           = "Mehlala"
  1478. Locale["st"]["see-also"]           = "Bona hape"
  1479. Locale["st"]["family"]             = "Atlantic-Congo"
  1480. Locale["st"]["iso"]                = "sot"
  1481. Locale["st"]["glotto"]             = "sout2807"
  1482. Locale["st"]["script"]             = "Latn"
  1483. Locale["sn"]["name"]               = "Shona"
  1484. Locale["sn"]["endonym"]            = "chiShona"
  1485. Locale["sn"]["translations-of"]    = "Shanduro dze %s"
  1486. Locale["sn"]["definitions-of"]     = "Zvinoreva %s"
  1487. Locale["sn"]["synonyms"]           = "Mashoko anoreva zvakafana nemamwe"
  1488. Locale["sn"]["examples"]           = "Mienzaniso"
  1489. Locale["sn"]["see-also"]           = "Onawo"
  1490. Locale["sn"]["family"]             = "Atlantic-Congo"
  1491. Locale["sn"]["iso"]                = "sna"
  1492. Locale["sn"]["glotto"]             = "core1255"
  1493. Locale["sn"]["script"]             = "Latn"
  1494. Locale["sd"]["name"]               = "Sindhi"
  1495. Locale["sd"]["endonym"]            = "Ų³Ł†ŚŒŁŠ"
  1496. Locale["sd"]["translations-of"]    = "%s Ų¬Łˆ ŲŖŲ±Ų¬Ł…Łˆ"
  1497. Locale["sd"]["definitions-of"]     = "%s Ų¬ŁˆŁ† ŁˆŲµŁŁˆŁ†"
  1498. Locale["sd"]["synonyms"]           = "Ł‡Ł… Ł…Ų¹Ł†ŁŠ"
  1499. Locale["sd"]["examples"]           = "Ł…Ų«Ų§Ł„ŁˆŁ†"
  1500. Locale["sd"]["see-also"]           = "ŲØŁ‡ ŚŲ³Łˆ"
  1501. Locale["sd"]["family"]             = "Indo-European"
  1502. Locale["sd"]["iso"]                = "snd"
  1503. Locale["sd"]["glotto"]             = "sind1272"
  1504. Locale["sd"]["script"]             = "Arab"
  1505. Locale["sd"]["rtl"]                = "true"
  1506. Locale["si"]["name"]               = "Sinhala"
  1507. Locale["si"]["endonym"]            = "ą·ƒą·’ą¶‚ą·„ą¶½"
  1508. Locale["si"]["translations-of"]    = "%s ą·„ą·’ ą¶“ą¶»ą·’ą·€ą¶»ą·Šą¶­ą¶±"
  1509. Locale["si"]["definitions-of"]     = "%s ą·„ą·’ ą¶±ą·’ą¶»ą·Šą·€ą¶ ą¶±"
  1510. Locale["si"]["synonyms"]           = "ą·ƒą¶øą·ą¶±ą·ą¶»ą·Šą¶® ą¶“ą¶Æ"
  1511. Locale["si"]["examples"]           = "ą¶‹ą¶Æą·ą·„ą¶»ą¶«"
  1512. Locale["si"]["see-also"]           = "ą¶øą·™ą¶ŗą¶­ą·Š ą¶¶ą¶½ą¶±ą·Šą¶±"
  1513. Locale["si"]["family"]             = "Indo-European"
  1514. Locale["si"]["iso"]                = "sin"
  1515. Locale["si"]["glotto"]             = "sinh1246"
  1516. Locale["si"]["script"]             = "Sinh"
  1517. Locale["sk"]["name"]               = "Slovak"
  1518. Locale["sk"]["endonym"]            = "Slovenčina"
  1519. Locale["sk"]["translations-of"]    = "Preklady vĆ½razu: %s"
  1520. Locale["sk"]["definitions-of"]     = "DefinĆ­cie vĆ½razu %s"
  1521. Locale["sk"]["synonyms"]           = "SynonymĆ”"
  1522. Locale["sk"]["examples"]           = "PrĆ­klady"
  1523. Locale["sk"]["see-also"]           = "Pozrite tiež"
  1524. Locale["sk"]["family"]             = "Indo-European"
  1525. Locale["sk"]["iso"]                = "slk"
  1526. Locale["sk"]["glotto"]             = "slov1269"
  1527. Locale["sk"]["script"]             = "Latn"
  1528. Locale["sl"]["name"]               = "Slovenian"
  1529. Locale["sl"]["endonym"]            = "SlovenŔčina"
  1530. Locale["sl"]["translations-of"]    = "Prevodi za %s"
  1531. Locale["sl"]["definitions-of"]     = "Razlage za %s"
  1532. Locale["sl"]["synonyms"]           = "Sopomenke"
  1533. Locale["sl"]["examples"]           = "Primeri"
  1534. Locale["sl"]["see-also"]           = "Glejte tudi"
  1535. Locale["sl"]["family"]             = "Indo-European"
  1536. Locale["sl"]["iso"]                = "slv"
  1537. Locale["sl"]["glotto"]             = "slov1268"
  1538. Locale["sl"]["script"]             = "Latn"
  1539. Locale["so"]["name"]               = "Somali"
  1540. Locale["so"]["endonym"]            = "Soomaali"
  1541. Locale["so"]["translations-of"]    = "Turjumaada %s"
  1542. Locale["so"]["definitions-of"]     = "Qeexitaannada %s"
  1543. Locale["so"]["synonyms"]           = "La micne ah"
  1544. Locale["so"]["examples"]           = "Tusaalooyin"
  1545. Locale["so"]["see-also"]           = "Sidoo kale eeg"
  1546. Locale["so"]["family"]             = "Afro-Asiatic"
  1547. Locale["so"]["iso"]                = "som"
  1548. Locale["so"]["glotto"]             = "soma1255"
  1549. Locale["so"]["script"]             = "Latn"
  1550. Locale["es"]["name"]               = "Spanish"
  1551. Locale["es"]["endonym"]            = "EspaƱol"
  1552. Locale["es"]["translations-of"]    = "Traducciones de %s"
  1553. Locale["es"]["definitions-of"]     = "Definiciones de %s"
  1554. Locale["es"]["synonyms"]           = "SinĆ³nimos"
  1555. Locale["es"]["examples"]           = "Ejemplos"
  1556. Locale["es"]["see-also"]           = "Ver tambiĆ©n"
  1557. Locale["es"]["family"]             = "Indo-European"
  1558. Locale["es"]["iso"]                = "spa"
  1559. Locale["es"]["glotto"]             = "stan1288"
  1560. Locale["es"]["script"]             = "Latn"
  1561. Locale["es"]["dictionary"]         = "true"
  1562. Locale["su"]["name"]               = "Sundanese"
  1563. Locale["su"]["endonym"]            = "Basa Sunda"
  1564. Locale["su"]["translations-of"]    = "Tarjamahan tina %s"
  1565. Locale["su"]["definitions-of"]     = "Panjelasan tina %s"
  1566. Locale["su"]["synonyms"]           = "Sinonim"
  1567. Locale["su"]["examples"]           = "Conto"
  1568. Locale["su"]["see-also"]           = "Tingali ogĆ©"
  1569. Locale["su"]["family"]             = "Austronesian"
  1570. Locale["su"]["iso"]                = "sun"
  1571. Locale["su"]["glotto"]             = "sund1252"
  1572. Locale["su"]["script"]             = "Latn"
  1573. Locale["sw"]["name"]               = "Swahili"
  1574. Locale["sw"]["endonym"]            = "Kiswahili"
  1575. Locale["sw"]["translations-of"]    = "Tafsiri ya %s"
  1576. Locale["sw"]["definitions-of"]     = "Ufafanuzi wa %s"
  1577. Locale["sw"]["synonyms"]           = "Visawe"
  1578. Locale["sw"]["examples"]           = "Mifano"
  1579. Locale["sw"]["see-also"]           = "Angalia pia"
  1580. Locale["sw"]["family"]             = "Atlantic-Congo"
  1581. Locale["sw"]["iso"]                = "swa"
  1582. Locale["sw"]["glotto"]             = "swah1253"
  1583. Locale["sw"]["script"]             = "Latn"
  1584. Locale["sv"]["name"]               = "Swedish"
  1585. Locale["sv"]["endonym"]            = "Svenska"
  1586. Locale["sv"]["translations-of"]    = "ƖversƤttningar av %s"
  1587. Locale["sv"]["definitions-of"]     = "Definitioner av %s"
  1588. Locale["sv"]["synonyms"]           = "Synonymer"
  1589. Locale["sv"]["examples"]           = "Exempel"
  1590. Locale["sv"]["see-also"]           = "Se Ƥven"
  1591. Locale["sv"]["family"]             = "Indo-European"
  1592. Locale["sv"]["iso"]                = "swe"
  1593. Locale["sv"]["glotto"]             = "swed1254"
  1594. Locale["sv"]["script"]             = "Latn"
  1595. Locale["tg"]["name"]               = "Tajik"
  1596. Locale["tg"]["endonym"]            = "Š¢Š¾Ņ·ŠøŠŗÓ£"
  1597. Locale["tg"]["translations-of"]    = "Š¢Š°Ń€Ņ·ŃƒŠ¼Š°Ņ³Š¾Šø %s"
  1598. Locale["tg"]["definitions-of"]     = "Š¢Š°ŃŠŃ€ŠøфŅ³Š¾Šø %s"
  1599. Locale["tg"]["synonyms"]           = "ŠœŃƒŃ€Š¾Š“ŠøфŅ³Š¾"
  1600. Locale["tg"]["examples"]           = "ŠŠ°Š¼ŃƒŠ½Š°Ņ³Š¾:"
  1601. Locale["tg"]["see-also"]           = "Ņ²Š°Š¼Ń‡ŃƒŠ½ŠøŠ½ Š‘ŠøŠ½ŠµŠ“"
  1602. Locale["tg"]["family"]             = "Indo-European"
  1603. Locale["tg"]["iso"]                = "tgk"
  1604. Locale["tg"]["glotto"]             = "taji1245"
  1605. Locale["tg"]["script"]             = "Cyrl"
  1606. Locale["ta"]["name"]               = "Tamil"
  1607. Locale["ta"]["endonym"]            = "ą®¤ą®®ą®æą®“ąÆ"
  1608. Locale["ta"]["translations-of"]    = "%s ą®‡ą®©ąÆ ą®®ąÆŠą®“ą®æą®ŖąÆ†ą®Æą®°ąÆą®ŖąÆą®ŖąÆą®•ą®³ąÆ"
  1609. Locale["ta"]["definitions-of"]     = "%s ą®‡ą®©ąÆ ą®µą®°ąÆˆą®Æą®±ąÆˆą®•ą®³ąÆ"
  1610. Locale["ta"]["synonyms"]           = "ą®‡ą®£ąÆˆą®šąÆą®šąÆŠą®±ąÆą®•ą®³ąÆ"
  1611. Locale["ta"]["examples"]           = "ą®Žą®ŸąÆą®¤ąÆą®¤ąÆą®•ąÆą®•ą®¾ą®ŸąÆą®ŸąÆą®•ą®³ąÆ"
  1612. Locale["ta"]["see-also"]           = "ą®‡ą®¤ąÆˆą®ÆąÆą®®ąÆ ą®•ą®¾ą®£ąÆą®•"
  1613. Locale["ta"]["family"]             = "Dravidian"
  1614. Locale["ta"]["iso"]                = "tam"
  1615. Locale["ta"]["glotto"]             = "tami1289"
  1616. Locale["ta"]["script"]             = "Taml"
  1617. Locale["te"]["name"]               = "Telugu"
  1618. Locale["te"]["endonym"]            = "ą°¤ą±†ą°²ą±ą°—ą±"
  1619. Locale["te"]["translations-of"]    = "%s ą°Æą±Šą°•ą±ą°• ą°…ą°Øą±ą°µą°¾ą°¦ą°¾ą°²ą±"
  1620. Locale["te"]["definitions-of"]     = "%s ą°Æą±Šą°•ą±ą°• ą°Øą°æą°°ą±ą°µą°šą°Øą°¾ą°²ą±"
  1621. Locale["te"]["synonyms"]           = "ą°Ŗą°°ą±ą°Æą°¾ą°Æą°Ŗą°¦ą°¾ą°²ą±"
  1622. Locale["te"]["examples"]           = "ą°‰ą°¦ą°¾ą°¹ą°°ą°£ą°²ą±"
  1623. Locale["te"]["see-also"]           = "ą°µą±€ą°Ÿą°æą°Øą°æ ą°•ą±‚ą°”ą°¾ ą°šą±‚ą°”ą°‚ą°”ą°æ"
  1624. Locale["te"]["family"]             = "Dravidian"
  1625. Locale["te"]["iso"]                = "tel"
  1626. Locale["te"]["glotto"]             = "telu1262"
  1627. Locale["te"]["script"]             = "Telu"
  1628. Locale["th"]["name"]               = "Thai"
  1629. Locale["th"]["endonym"]            = "ą¹„ąø—ąø¢"
  1630. Locale["th"]["translations-of"]    = "ąø„ąø³ą¹ąø›ąø„ąø‚ąø­ąø‡ %s"
  1631. Locale["th"]["definitions-of"]     = "ąø„ąø³ąøˆąø³ąøąø±ąø”ąø„ąø§ąø²ąø”ąø‚ąø­ąø‡ %s"
  1632. Locale["th"]["synonyms"]           = "ąø„ąø³ąøžą¹‰ąø­ąø‡ąø„ąø§ąø²ąø”ąø«ąø”ąø²ąø¢"
  1633. Locale["th"]["examples"]           = "ąø•ąø±ąø§ąø­ąø¢ą¹ˆąø²ąø‡"
  1634. Locale["th"]["see-also"]           = "ąø”ąø¹ą¹€ąøžąø“ą¹ˆąø”ą¹€ąø•ąø“ąø”"
  1635. Locale["th"]["family"]             = "Tai-Kadai"
  1636. Locale["th"]["iso"]                = "tha"
  1637. Locale["th"]["glotto"]             = "thai1261"
  1638. Locale["th"]["script"]             = "Thai"
  1639. Locale["tr"]["name"]               = "Turkish"
  1640. Locale["tr"]["endonym"]            = "TĆ¼rkƧe"
  1641. Locale["tr"]["translations-of"]    = "%s Ƨevirileri"
  1642. Locale["tr"]["definitions-of"]     = "%s iƧin tanımlar"
  1643. Locale["tr"]["synonyms"]           = "Eş anlamlılar"
  1644. Locale["tr"]["examples"]           = "Ɩrnekler"
  1645. Locale["tr"]["see-also"]           = "Ayrıca bkz."
  1646. Locale["tr"]["family"]             = "Turkic"
  1647. Locale["tr"]["iso"]                = "tur"
  1648. Locale["tr"]["glotto"]             = "nucl1301"
  1649. Locale["tr"]["script"]             = "Latn"
  1650. Locale["uk"]["name"]               = "Ukrainian"
  1651. Locale["uk"]["endonym"]            = "Š£ŠŗрŠ°Ń—Š½ŃŃŒŠŗŠ°"
  1652. Locale["uk"]["translations-of"]    = "ŠŸŠµŃ€ŠµŠŗŠ»Š°Š“Šø сŠ»Š¾Š²Š° Š°Š±Š¾ Š²ŠøрŠ°Š·Ńƒ \"%s\""
  1653. Locale["uk"]["definitions-of"]     = "\"%s\" ā€“ Š²ŠøŠ·Š½Š°Ń‡ŠµŠ½Š½Ń"
  1654. Locale["uk"]["synonyms"]           = "Š”ŠøŠ½Š¾Š½Ń–Š¼Šø"
  1655. Locale["uk"]["examples"]           = "ŠŸŃ€ŠøŠŗŠ»Š°Š“Šø"
  1656. Locale["uk"]["see-also"]           = "Š”ŠøŠ²Ń–Ń‚ŃŒŃŃ тŠ°ŠŗŠ¾Š¶"
  1657. Locale["uk"]["family"]             = "Indo-European"
  1658. Locale["uk"]["iso"]                = "ukr"
  1659. Locale["uk"]["glotto"]             = "ukra1253"
  1660. Locale["uk"]["script"]             = "Cyrl"
  1661. Locale["ur"]["name"]               = "Urdu"
  1662. Locale["ur"]["endonym"]            = "Ų§ŁŲ±ŲÆŁŁˆ"
  1663. Locale["ur"]["translations-of"]    = "Ś©Ū’ ŲŖŲ±Ų¬Ł…Ū’ %s"
  1664. Locale["ur"]["definitions-of"]     = "Ś©ŪŒ ŲŖŲ¹Ų±ŪŒŁŲ§ŲŖ %s"
  1665. Locale["ur"]["synonyms"]           = "Ł…ŲŖŲ±Ų§ŲÆŁŲ§ŲŖ"
  1666. Locale["ur"]["examples"]           = "Ł…Ų«Ų§Ł„ŪŒŚŗ"
  1667. Locale["ur"]["see-also"]           = "Ł†ŪŒŲ² ŲÆŪŒŚ©Ś¾ŪŒŚŗ"
  1668. Locale["ur"]["family"]             = "Indo-European"
  1669. Locale["ur"]["iso"]                = "urd"
  1670. Locale["ur"]["glotto"]             = "urdu1245"
  1671. Locale["ur"]["script"]             = "Arab"
  1672. Locale["ur"]["rtl"]                = "true"
  1673. Locale["uz"]["name"]               = "Uzbek"
  1674. Locale["uz"]["endonym"]            = "OŹ»zbek tili"
  1675. Locale["uz"]["translations-of"]    = "%s: tarjima variantlari"
  1676. Locale["uz"]["definitions-of"]     = "%s ā€“ taā€™riflar"
  1677. Locale["uz"]["synonyms"]           = "Sinonimlar"
  1678. Locale["uz"]["examples"]           = "Namunalar"
  1679. Locale["uz"]["see-also"]           = "Oā€˜xshash soā€˜zlar"
  1680. Locale["uz"]["family"]             = "Turkic"
  1681. Locale["uz"]["iso"]                = "uzb"
  1682. Locale["uz"]["glotto"]             = "uzbe1247"
  1683. Locale["uz"]["script"]             = "Latn"
  1684. Locale["vi"]["name"]               = "Vietnamese"
  1685. Locale["vi"]["endonym"]            = "Tiįŗæng Viį»‡t"
  1686. Locale["vi"]["translations-of"]    = "Bįŗ£n dį»‹ch cį»§a %s"
  1687. Locale["vi"]["definitions-of"]     = "NghÄ©a cį»§a %s"
  1688. Locale["vi"]["synonyms"]           = "Tį»« đį»“ng nghÄ©a"
  1689. Locale["vi"]["examples"]           = "VĆ­ dį»„"
  1690. Locale["vi"]["see-also"]           = "Xem thĆŖm"
  1691. Locale["vi"]["family"]             = "Austroasiatic"
  1692. Locale["vi"]["iso"]                = "vie"
  1693. Locale["vi"]["glotto"]             = "viet1252"
  1694. Locale["vi"]["script"]             = "Latn"
  1695. Locale["cy"]["name"]               = "Welsh"
  1696. Locale["cy"]["endonym"]            = "Cymraeg"
  1697. Locale["cy"]["translations-of"]    = "Cyfieithiadau %s"
  1698. Locale["cy"]["definitions-of"]     = "Diffiniadau %s"
  1699. Locale["cy"]["synonyms"]           = "Cyfystyron"
  1700. Locale["cy"]["examples"]           = "Enghreifftiau"
  1701. Locale["cy"]["see-also"]           = "Gweler hefyd"
  1702. Locale["cy"]["family"]             = "Indo-European"
  1703. Locale["cy"]["iso"]                = "cym"
  1704. Locale["cy"]["glotto"]             = "wels1247"
  1705. Locale["cy"]["script"]             = "Latn"
  1706. Locale["fy"]["name"]               = "Frisian"
  1707. Locale["fy"]["endonym"]            = "Frysk"
  1708. Locale["fy"]["translations-of"]    = "Oersettings fan %s"
  1709. Locale["fy"]["definitions-of"]     = "Definysjes fan %s"
  1710. Locale["fy"]["synonyms"]           = "Synonimen"
  1711. Locale["fy"]["examples"]           = "Foarbylden"
  1712. Locale["fy"]["see-also"]           = "Sjoch ek"
  1713. Locale["fy"]["family"]             = "Indo-European"
  1714. Locale["fy"]["iso"]                = "fry"
  1715. Locale["fy"]["glotto"]             = "west2354"
  1716. Locale["fy"]["script"]             = "Latn"
  1717. Locale["xh"]["name"]               = "Xhosa"
  1718. Locale["xh"]["endonym"]            = "isiXhosa"
  1719. Locale["xh"]["translations-of"]    = "Iinguqulelo zika-%s"
  1720. Locale["xh"]["definitions-of"]     = "Iingcaciso zika-%s"
  1721. Locale["xh"]["synonyms"]           = "Izithethantonye"
  1722. Locale["xh"]["examples"]           = "Imizekelo"
  1723. Locale["xh"]["see-also"]           = "Kwakhona bona"
  1724. Locale["xh"]["family"]             = "Atlantic-Congo"
  1725. Locale["xh"]["iso"]                = "xho"
  1726. Locale["xh"]["glotto"]             = "xhos1239"
  1727. Locale["xh"]["script"]             = "Latn"
  1728. Locale["yi"]["name"]               = "Yiddish"
  1729. Locale["yi"]["endonym"]            = "יי֓דיש"
  1730. Locale["yi"]["translations-of"]    = "איבע×Øזעצונגען פון %s"
  1731. Locale["yi"]["definitions-of"]     = "דפיניציונען %s"
  1732. Locale["yi"]["synonyms"]           = "הינאÖøנימען"
  1733. Locale["yi"]["examples"]           = "ביישפילע"
  1734. Locale["yi"]["see-also"]           = "זייען אויך"
  1735. Locale["yi"]["family"]             = "Indo-European"
  1736. Locale["yi"]["iso"]                = "yid"
  1737. Locale["yi"]["glotto"]             = "yidd1255"
  1738. Locale["yi"]["script"]             = "Hebr"
  1739. Locale["yi"]["rtl"]                = "true"
  1740. Locale["yo"]["name"]               = "Yoruba"
  1741. Locale["yo"]["endonym"]            = "YorĆ¹bĆ”"
  1742. Locale["yo"]["translations-of"]    = "Awį»n itumį» ti %s"
  1743. Locale["yo"]["definitions-of"]     = "Awį»n itumį» ti %s"
  1744. Locale["yo"]["synonyms"]           = "Awį»n į»rį» onitumį»"
  1745. Locale["yo"]["examples"]           = "Awį»n apįŗ¹rįŗ¹"
  1746. Locale["yo"]["see-also"]           = "Tun wo"
  1747. Locale["yo"]["family"]             = "Atlantic-Congo"
  1748. Locale["yo"]["iso"]                = "yor"
  1749. Locale["yo"]["glotto"]             = "yoru1245"
  1750. Locale["yo"]["script"]             = "Latn"
  1751. Locale["zu"]["name"]               = "Zulu"
  1752. Locale["zu"]["endonym"]            = "isiZulu"
  1753. Locale["zu"]["translations-of"]    = "Ukuhumusha i-%s"
  1754. Locale["zu"]["definitions-of"]     = "Izincazelo ze-%s"
  1755. Locale["zu"]["synonyms"]           = "Amagama afanayo"
  1756. Locale["zu"]["examples"]           = "Izibonelo"
  1757. Locale["zu"]["see-also"]           = "Bheka futhi"
  1758. Locale["zu"]["family"]             = "Atlantic-Congo"
  1759. Locale["zu"]["iso"]                = "zul"
  1760. Locale["zu"]["glotto"]             = "zulu1248"
  1761. Locale["zu"]["script"]             = "Latn"
  1762. Locale["yue"]["support"]           = "bing-only"
  1763. Locale["yue"]["name"]              = "Cantonese"
  1764. Locale["yue"]["endonym"]           = "ē²µčŖž"
  1765. Locale["yue"]["family"]            = "Sino-Tibetan"
  1766. Locale["yue"]["iso"]               = "yue"
  1767. Locale["yue"]["glotto"]            = "cant1236"
  1768. Locale["yue"]["script"]            = "Hant"
  1769. Locale["fj"]["support"]           = "bing-only"
  1770. Locale["fj"]["name"]              = "Fijian"
  1771. Locale["fj"]["endonym"]           = "Vosa Vakaviti"
  1772. Locale["fj"]["family"]            = "Austronesian"
  1773. Locale["fj"]["iso"]               = "fij"
  1774. Locale["fj"]["glotto"]            = "fiji1243"
  1775. Locale["fj"]["script"]            = "Latn"
  1776. Locale["mww"]["support"]           = "bing-only"
  1777. Locale["mww"]["name"]              = "Hmong Daw"
  1778. Locale["mww"]["endonym"]           = "Hmoob Daw"
  1779. Locale["mww"]["family"]            = "Hmong-Mien"
  1780. Locale["mww"]["iso"]               = "mww"
  1781. Locale["mww"]["glotto"]            = "hmon1333"
  1782. Locale["mww"]["script"]            = "Latn"
  1783. Locale["otq"]["support"]           = "bing-only"
  1784. Locale["otq"]["name"]              = "QuerĆ©taro Otomi"
  1785. Locale["otq"]["endonym"]           = "HƱąƱho"
  1786. Locale["otq"]["family"]            = "Oto-Manguean"
  1787. Locale["otq"]["iso"]               = "otq"
  1788. Locale["otq"]["glotto"]            = "quer1236"
  1789. Locale["otq"]["script"]            = "Latn"
  1790. Locale["ty"]["support"]           = "bing-only"
  1791. Locale["ty"]["name"]              = "Tahitian"
  1792. Locale["ty"]["endonym"]           = "Reo Tahiti"
  1793. Locale["ty"]["family"]            = "Austronesian"
  1794. Locale["ty"]["iso"]               = "tah"
  1795. Locale["ty"]["glotto"]            = "tahi1242"
  1796. Locale["ty"]["script"]            = "Latn"
  1797. Locale["to"]["support"]           = "bing-only"
  1798. Locale["to"]["name"]              = "Tongan"
  1799. Locale["to"]["endonym"]           = "Lea faka-Tonga"
  1800. Locale["to"]["family"]            = "Austronesian"
  1801. Locale["to"]["iso"]               = "ton"
  1802. Locale["to"]["glotto"]            = "tong1325"
  1803. Locale["to"]["script"]            = "Latn"
  1804. Locale["yua"]["support"]           = "bing-only"
  1805. Locale["yua"]["name"]              = "Yucatec Maya"
  1806. Locale["yua"]["endonym"]           = "MĆ aya T'Ć an"
  1807. Locale["yua"]["family"]            = "Mayan"
  1808. Locale["yua"]["iso"]               = "yua"
  1809. Locale["yua"]["glotto"]            = "yuca1254"
  1810. Locale["yua"]["script"]            = "Latn"
  1811. Locale["tlh"]["support"]           = "bing-only"
  1812. Locale["tlh"]["name"]              = "Klingon"
  1813. Locale["tlh"]["endonym"]           = "tlhIngan Hol"
  1814. Locale["tlh"]["family"]            = "Artificial Language"
  1815. Locale["tlh"]["iso"]               = "tlh"
  1816. Locale["tlh"]["script"]            = "Latn"
  1817. Locale["tlh-Qaak"]["support"]      = "bing-only"
  1818. Locale["tlh-Qaak"]["name"]         = "Klingon (pIqaD)"
  1819. Locale["tlh-Qaak"]["endonym"]      = "ļ£¤ļ£—ļ£œļ£ļ£› ļ£–ļ£ļ£™"
  1820. Locale["tlh-Qaak"]["family"]       = "Artificial Language"
  1821. Locale["tlh-Qaak"]["iso"]          = "tlh"
  1822. Locale["tlh-Qaak"]["script"]       = "Piqd"
  1823. Locale["as"]["support"]            = "unstable"
  1824. Locale["as"]["name"]               = "Assamese"
  1825. Locale["as"]["endonym"]            = "ą¦…ą¦øą¦®ą§€ą¦Æą¦¼ą¦¾"
  1826. Locale["as"]["family"]             = "Indo-European"
  1827. Locale["as"]["iso"]                = "asm"
  1828. Locale["as"]["glotto"]             = "assa1263"
  1829. Locale["as"]["script"]             = "Beng"
  1830. Locale["ba"]["support"]            = "unstable"
  1831. Locale["ba"]["name"]               = "Bashkir"
  1832. Locale["ba"]["endonym"]            = "Š±Š°ŃˆŅ”Š¾Ń€Ń‚ тŠµŠ»Šµ"
  1833. Locale["ba"]["family"]             = "Turkic"
  1834. Locale["ba"]["iso"]                = "bak"
  1835. Locale["ba"]["glotto"]             = "bash1264"
  1836. Locale["ba"]["script"]             = "Cyrl"
  1837. Locale["br"]["support"]            = "unstable"
  1838. Locale["br"]["name"]               = "Breton"
  1839. Locale["br"]["endonym"]            = "Brezhoneg"
  1840. Locale["br"]["family"]             = "Indo-European"
  1841. Locale["br"]["iso"]                = "bre"
  1842. Locale["br"]["glotto"]             = "bret1244"
  1843. Locale["br"]["script"]             = "Latn"
  1844. Locale["dz"]["support"]            = "unstable"
  1845. Locale["dz"]["name"]               = "Dzongkha"
  1846. Locale["dz"]["endonym"]            = "ą½¢ą¾«ą½¼ą½„ą¼‹ą½"
  1847. Locale["dz"]["family"]             = "Sino-Tibetan"
  1848. Locale["dz"]["iso"]                = "dzo"
  1849. Locale["dz"]["glotto"]             = "nucl1307"
  1850. Locale["dz"]["script"]             = "Tibt"
  1851. Locale["fo"]["support"]            = "unstable"
  1852. Locale["fo"]["name"]               = "Faroese"
  1853. Locale["fo"]["endonym"]            = "FĆøroyskt"
  1854. Locale["fo"]["family"]             = "Indo-European"
  1855. Locale["fo"]["iso"]                = "fao"
  1856. Locale["fo"]["glotto"]             = "faro1244"
  1857. Locale["fo"]["script"]             = "Latn"
  1858. Locale["gn"]["support"]            = "unstable"
  1859. Locale["gn"]["name"]               = "Guarani"
  1860. Locale["gn"]["endonym"]            = "AvaƱe'įŗ½"
  1861. Locale["gn"]["family"]             = "Tupian"
  1862. Locale["gn"]["iso"]                = "grn"
  1863. Locale["gn"]["glotto"]             = "para1311"
  1864. Locale["gn"]["script"]             = "Latn"
  1865. Locale["ie"]["support"]            = "unstable"
  1866. Locale["ie"]["name"]               = "Interlingue"
  1867. Locale["ie"]["endonym"]            = "Interlingue"
  1868. Locale["ie"]["family"]             = "Artificial Language"
  1869. Locale["ie"]["iso"]                = "ile"
  1870. Locale["ie"]["glotto"]             = "occi1241"
  1871. Locale["ie"]["script"]             = "Latn"
  1872. Locale["rw"]["support"]            = "unstable"
  1873. Locale["rw"]["name"]               = "Kinyarwanda"
  1874. Locale["rw"]["endonym"]            = "Ikinyarwanda"
  1875. Locale["rw"]["family"]             = "Atlantic-Congo"
  1876. Locale["rw"]["iso"]                = "kin"
  1877. Locale["rw"]["glotto"]             = "kiny1244"
  1878. Locale["rw"]["script"]             = "Latn"
  1879. Locale["oc"]["support"]            = "unstable"
  1880. Locale["oc"]["name"]               = "Occitan"
  1881. Locale["oc"]["endonym"]            = "Occitan"
  1882. Locale["oc"]["family"]             = "Indo-European"
  1883. Locale["oc"]["iso"]                = "oci"
  1884. Locale["oc"]["glotto"]             = "occi1239"
  1885. Locale["oc"]["script"]             = "Latn"
  1886. Locale["om"]["support"]            = "unstable"
  1887. Locale["om"]["name"]               = "Oromo"
  1888. Locale["om"]["endonym"]            = "Afaan Oromoo"
  1889. Locale["om"]["family"]             = "Afro-Asiatic"
  1890. Locale["om"]["iso"]                = "orm"
  1891. Locale["om"]["glotto"]             = "nucl1736"
  1892. Locale["om"]["script"]             = "Latn"
  1893. Locale["or"]["support"]            = "unstable"
  1894. Locale["or"]["name"]               = "Oriya"
  1895. Locale["or"]["endonym"]            = "ą¬“ą¬”ą¬¼ą¬æą¬†"
  1896. Locale["or"]["family"]             = "Indo-European"
  1897. Locale["or"]["iso"]                = "ori"
  1898. Locale["or"]["glotto"]             = "macr1269"
  1899. Locale["or"]["script"]             = "Orya"
  1900. Locale["rm"]["support"]            = "unstable"
  1901. Locale["rm"]["name"]               = "Romansh"
  1902. Locale["rm"]["endonym"]            = "Rumantsch"
  1903. Locale["rm"]["family"]             = "Indo-European"
  1904. Locale["rm"]["iso"]                = "roh"
  1905. Locale["rm"]["glotto"]             = "roma1326"
  1906. Locale["rm"]["script"]             = "Latn"
  1907. Locale["ti"]["support"]            = "unstable"
  1908. Locale["ti"]["name"]               = "Tigrinya"
  1909. Locale["ti"]["endonym"]            = "į‰µįŒįˆ­įŠ›"
  1910. Locale["ti"]["family"]             = "Afro-Asiatic"
  1911. Locale["ti"]["iso"]                = "tir"
  1912. Locale["ti"]["glotto"]             = "tigr1271"
  1913. Locale["ti"]["script"]             = "Ethi"
  1914. Locale["bo"]["support"]            = "unstable"
  1915. Locale["bo"]["name"]               = "Tibetan"
  1916. Locale["bo"]["endonym"]            = "ą½–ą½¼ą½‘ą¼‹ą½”ą½²ą½‚"
  1917. Locale["bo"]["family"]             = "Sino-Tibetan"
  1918. Locale["bo"]["iso"]                = "bod"
  1919. Locale["bo"]["glotto"]             = "tibe1272"
  1920. Locale["bo"]["script"]             = "Tibt"
  1921. Locale["tk"]["support"]            = "unstable"
  1922. Locale["tk"]["name"]               = "Turkmen"
  1923. Locale["tk"]["endonym"]            = "TĆ¼rkmen"
  1924. Locale["tk"]["family"]             = "Turkic"
  1925. Locale["tk"]["iso"]                = "tuk"
  1926. Locale["tk"]["glotto"]             = "turk1304"
  1927. Locale["tk"]["script"]             = "Latn"
  1928. Locale["tt"]["support"]            = "yandex-only"
  1929. Locale["tt"]["name"]               = "Tatar"
  1930. Locale["tt"]["endonym"]            = "тŠ°Ń‚Š°Ń€Ń‡Š°"
  1931. Locale["tt"]["family"]             = "Turkic"
  1932. Locale["tt"]["iso"]                = "tat"
  1933. Locale["tt"]["glotto"]             = "tata1255"
  1934. Locale["tt"]["script"]             = "Cyrl"
  1935. Locale["udm"]["support"]           = "yandex-only"
  1936. Locale["udm"]["name"]              = "Udmurt"
  1937. Locale["udm"]["endonym"]           = "уŠ“Š¼ŃƒŃ€Ń‚"
  1938. Locale["udm"]["family"]            = "Uralic"
  1939. Locale["udm"]["iso"]               = "udm"
  1940. Locale["udm"]["glotto"]            = "udmu1245"
  1941. Locale["udm"]["script"]            = "Cyrl"
  1942. Locale["ug"]["support"]            = "unstable"
  1943. Locale["ug"]["name"]               = "Uyghur"
  1944. Locale["ug"]["endonym"]            = "Ų¦Ū‡ŁŠŲŗŪ‡Ų± ŲŖŁ‰Ł„Ł‰"
  1945. Locale["ug"]["family"]             = "Turkic"
  1946. Locale["ug"]["iso"]                = "uig"
  1947. Locale["ug"]["glotto"]             = "uigh1240"
  1948. Locale["ug"]["script"]             = "Arab"
  1949. Locale["ug"]["rtl"]                = "true"
  1950. Locale["vo"]["support"]            = "unstable"
  1951. Locale["vo"]["name"]               = "VolapĆ¼k"
  1952. Locale["vo"]["endonym"]            = "VolapĆ¼k"
  1953. Locale["vo"]["family"]             = "Artificial Language"
  1954. Locale["vo"]["iso"]                = "vol"
  1955. Locale["vo"]["script"]             = "Latn"
  1956. Locale["wo"]["support"]            = "unstable"
  1957. Locale["wo"]["name"]               = "Wolof"
  1958. Locale["wo"]["endonym"]            = "Wollof"
  1959. Locale["wo"]["family"]             = "Atlantic-Congo"
  1960. Locale["wo"]["iso"]                = "wol"
  1961. Locale["wo"]["glotto"]             = "wolo1247"
  1962. Locale["wo"]["script"]             = "Latn"
  1963. Locale["chr"]["support"]           = "unstable"
  1964. Locale["chr"]["name"]              = "Cherokee"
  1965. Locale["chr"]["endonym"]           = "į£įŽ³įŽ©"
  1966. Locale["chr"]["family"]            = "Iroquoian"
  1967. Locale["chr"]["iso"]               = "chr"
  1968. Locale["chr"]["glotto"]            = "cher1273"
  1969. Locale["chr"]["script"]            = "Cher"
  1970. for (i in Locale) {
  1971. Locale[i]["display"] = show(Locale[i]["endonym"], i)
  1972. LocaleAlias[Locale[i]["iso"]] = i
  1973. LocaleAlias[tolower(Locale[i]["name"])] = i
  1974. LocaleAlias[tolower(Locale[i]["endonym"])] = i
  1975. }
  1976. LocaleAlias["in"] = "id"
  1977. LocaleAlias["iw"] = "he"
  1978. LocaleAlias["ji"] = "yi"
  1979. LocaleAlias["jw"] = "jv"
  1980. LocaleAlias["mo"] = "ro"
  1981. LocaleAlias["nb"] = "no"
  1982. LocaleAlias["nn"] = "no"
  1983. LocaleAlias["sh"]      = "sr-Cyrl"
  1984. LocaleAlias["sr"]      = "sr-Cyrl"
  1985. LocaleAlias["srp"]     = "sr-Cyrl"
  1986. LocaleAlias["serbian"] = "sr-Cyrl"
  1987. LocaleAlias["zh"]      = "zh-CN"
  1988. LocaleAlias["zh-CHS"]  = "zh-CN"
  1989. LocaleAlias["zh-CHT"]  = "zh-TW"
  1990. LocaleAlias["zho"]     = "zh-CN"
  1991. LocaleAlias["chinese"] = "zh-CN"
  1992. LocaleAlias["tlh-Latn"] = "tlh"
  1993. LocaleAlias["tlh-Piqd"] = "tlh-Qaak"
  1994. }
  1995. function getCode(code,    group) {
  1996. if (code == "auto" || code in Locale)
  1997. return code
  1998. else if (code in LocaleAlias)
  1999. return LocaleAlias[code]
  2000. else if (tolower(code) in LocaleAlias)
  2001. return LocaleAlias[tolower(code)]
  2002. match(code, /^([[:alpha:]][[:alpha:]][[:alpha:]]?)-(.*)$/, group)
  2003. if (group[1])
  2004. return group[1]
  2005. return
  2006. }
  2007. function getName(code) {
  2008. return Locale[getCode(code)]["name"]
  2009. }
  2010. function getEndonym(code) {
  2011. return Locale[getCode(code)]["endonym"]
  2012. }
  2013. function getDisplay(code) {
  2014. return Locale[getCode(code)]["display"]
  2015. }
  2016. function showTranslationsOf(code, text,    fmt) {
  2017. fmt = Locale[getCode(code)]["translations-of"]
  2018. if (!fmt) fmt = Locale["en"]["translations-of"]
  2019. return sprintf(fmt, text)
  2020. }
  2021. function showDefinitionsOf(code, text,    fmt) {
  2022. fmt = Locale[getCode(code)]["definitions-of"]
  2023. if (!fmt) fmt = Locale["en"]["definitions-of"]
  2024. return sprintf(fmt, text)
  2025. }
  2026. function showSynonyms(code,    tmp) {
  2027. tmp = Locale[getCode(code)]["synonyms"]
  2028. if (!tmp) tmp = Locale["en"]["synonyms"]
  2029. return tmp
  2030. }
  2031. function showExamples(code,    tmp) {
  2032. tmp = Locale[getCode(code)]["examples"]
  2033. if (!tmp) tmp = Locale["en"]["examples"]
  2034. return tmp
  2035. }
  2036. function showSeeAlso(code,    tmp) {
  2037. tmp = Locale[getCode(code)]["see-also"]
  2038. if (!tmp) tmp = Locale["en"]["see-also"]
  2039. return tmp
  2040. }
  2041. function getFamily(code) {
  2042. return Locale[getCode(code)]["family"]
  2043. }
  2044. function getISO(code) {
  2045. return Locale[getCode(code)]["iso"]
  2046. }
  2047. function getGlotto(code) {
  2048. return Locale[getCode(code)]["glotto"]
  2049. }
  2050. function getScript(code) {
  2051. return Locale[getCode(code)]["script"]
  2052. }
  2053. function isRTL(code) {
  2054. return Locale[getCode(code)]["rtl"] ? 1 : 0
  2055. }
  2056. function hasDictionary(code) {
  2057. return Locale[getCode(code)]["dictionary"] ? 1 : 0
  2058. }
  2059. function compName(i1, v1, i2, v2) {
  2060. if (getName(i1) < getName(i2))
  2061. return -1
  2062. else
  2063. return (getName(i1) != getName(i2))
  2064. }
  2065. function scriptName(code) {
  2066. switch (code) {
  2067. case "Arab": return "Arabic"
  2068. case "Armn": return "Armenian"
  2069. case "Beng": return "Bengali"
  2070. case "Cher": return "Cherokee"
  2071. case "Cyrl": return "Cyrillic"
  2072. case "Deva": return "Devanagari"
  2073. case "Ethi": return "Ethiopic (GeŹ»ez)"
  2074. case "Geor": return "Georgian (Mkhedruli)"
  2075. case "Grek": return "Greek"
  2076. case "Gujr": return "Gujarati"
  2077. case "Guru": return "Gurmukhi"
  2078. case "Hani": return "Han"
  2079. case "Hans": return "Han (Simplified)"
  2080. case "Hant": return "Han (Traditional)"
  2081. case "Hebr": return "Hebrew"
  2082. case "Jpan": return "Japanese (Han + Hiragana + Katakana)"
  2083. case "Khmr": return "Khmer"
  2084. case "Knda": return "Kannada"
  2085. case "Kore": return "Korean (Hangul + Han)"
  2086. case "Laoo": return "Lao"
  2087. case "Latn": return "Latin"
  2088. case "Mlym": return "Malayalam"
  2089. case "Mymr": return "Myanmar"
  2090. case "Orya": return "Oriya"
  2091. case "Piqd": return "Klingon (pIqaD)"
  2092. case "Sinh": return "Sinhala"
  2093. case "Taml": return "Tamil"
  2094. case "Telu": return "Telugu"
  2095. case "Thai": return "Thai"
  2096. case "Tibt": return "Tibetan"
  2097. default: return "Unknown"
  2098. }
  2099. }
  2100. function getDetails(code,    group, iso, language, script) {
  2101. if (code == "auto" || !getCode(code)) {
  2102. e("[ERROR] Language not found: " code "\n"\
  2103. "        Run '-reference / -R' to see a list of available languages.")
  2104. exit 1
  2105. }
  2106. script = scriptName(getScript(code))
  2107. if (isRTL(code)) script = script " (R-to-L)"
  2108. split(getISO(code), group, "-")
  2109. iso = group[1]
  2110. split(getName(code), group, " ")
  2111. language = length(group) == 1 ? group[1] "_language" :
  2112. group[2] ~ /^\(.*\)$/ ? group[1] "_language" : join(group, "_")
  2113. return ansi("bold", sprintf("%s\n", getDisplay(code)))\
  2114. sprintf("%-22s%s\n", "Name", ansi("bold", getName(code)))\
  2115. sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code)))\
  2116. sprintf("%-22s%s\n", "Writing system", ansi("bold", script))\
  2117. sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code)))\
  2118. sprintf("%-22s%s\n", "ISO 639-3", ansi("bold", iso))\
  2119. sprintf("%-22s%s\n", "SIL", ansi("bold", "http://www-01.sil.org/iso639-3/documentation.asp?id=" iso))\
  2120. sprintf("%-22s%s\n", "Glottolog", getGlotto(code) ?
  2121. ansi("bold", "http://glottolog.org/resource/languoid/id/" getGlotto(code)) : "")\
  2122. sprintf("%-22s%s", "Wikipedia", ansi("bold", "http://en.wikipedia.org/wiki/" language))
  2123. }
  2124. function showPhonetics(phonetics, code) {
  2125. if (code && getCode(code) == "en")
  2126. return "/" phonetics "/"
  2127. else
  2128. return "(" phonetics ")"
  2129. }
  2130. function show(text, code,    temp) {
  2131. if (!code || isRTL(code)) {
  2132. if (Cache[text][0])
  2133. return Cache[text][0]
  2134. else {
  2135. if ((FriBidi || (code && isRTL(code))) && BiDiNoPad)
  2136. ("echo " parameterize(text) PIPE BiDiNoPad) | getline temp
  2137. else
  2138. temp = text
  2139. return Cache[text][0] = temp
  2140. }
  2141. } else
  2142. return text
  2143. }
  2144. function s(text, code, width,    temp) {
  2145. if (!code || isRTL(code)) {
  2146. if (!width) width = Option["width"]
  2147. if (Cache[text][width])
  2148. return Cache[text][width]
  2149. else {
  2150. if ((FriBidi || (code && isRTL(code))) && BiDi)
  2151. ("echo " parameterize(text) PIPE sprintf(BiDi, width)) | getline temp
  2152. else
  2153. temp = text
  2154. return Cache[text][width] = temp
  2155. }
  2156. } else
  2157. return text
  2158. }
  2159. function ins(level, text, code, width,    i, temp) {
  2160. if (code && isRTL(code)) {
  2161. if (!width) width = Option["width"]
  2162. return s(text, code, width - Option["indent"] * level)
  2163. } else
  2164. return replicate(" ", Option["indent"] * level) text
  2165. }
  2166. function parseLang(lang,    code, group) {
  2167. match(lang, /^([a-z][a-z][a-z]?)(_|$)/, group)
  2168. code = getCode(group[1])
  2169. if (lang ~ /^zh_(CN|SG)/) code = "zh-CN"
  2170. else if (lang ~ /^zh_(TW|HK)/) code = "zh-TW"
  2171. if (!code) code = "en"
  2172. return code
  2173. }
  2174. function initUserLang(    lang, utf) {
  2175. if (lang = ENVIRON["LANGUAGE"]) {
  2176. if (!UserLocale) UserLocale = lang
  2177. utf = utf || tolower(lang) ~ /utf-?8$/
  2178. }
  2179. if (lang = ENVIRON["LC_ALL"]) {
  2180. if (!UserLocale) UserLocale = lang
  2181. utf = utf || tolower(lang) ~ /utf-?8$/
  2182. }
  2183. if (lang = ENVIRON["LANG"]) {
  2184. if (!UserLocale) UserLocale = lang
  2185. utf = utf || tolower(lang) ~ /utf-?8$/
  2186. }
  2187. if (!UserLocale) {
  2188. UserLocale = "en_US.UTF-8"
  2189. utf = 1
  2190. }
  2191. if (!utf)
  2192. w("[WARNING] Your locale codeset (" UserLocale ") is not UTF-8.")
  2193. UserLang = parseLang(UserLocale)
  2194. }
  2195. function getVersion(    build, gitHead, platform) {
  2196. initAudioPlayer()
  2197. initPager()
  2198. platform = detectProgram("uname", "-s", 1)
  2199. if (ENVIRON["TRANS_BUILD"])
  2200. build = "-" ENVIRON["TRANS_BUILD"]
  2201. else {
  2202. gitHead = getGitHead()
  2203. build = gitHead ? "-git:" gitHead : ""
  2204. }
  2205. return ansi("bold", sprintf("%-22s%s%s\n\n", Name, Version, build))\
  2206. sprintf("%-22s%s\n", "platform", platform)\
  2207. sprintf("%-22s%s\n", "gawk (GNU Awk)", PROCINFO["version"])\
  2208. sprintf("%s\n", FriBidi ? FriBidi :
  2209. "fribidi (GNU FriBidi) [NOT INSTALLED]")\
  2210. sprintf("%-22s%s\n", "audio player", AudioPlayer ? AudioPlayer :
  2211. "[NOT INSTALLED]")\
  2212. sprintf("%-22s%s\n", "terminal pager", Pager ? Pager :
  2213. "[NOT INSTALLED]")\
  2214. sprintf("%-22s%s\n", "terminal type", ENVIRON["TERM"])\
  2215. sprintf("%-22s%s (%s)\n", "user locale", UserLocale, getName(UserLang))\
  2216. sprintf("%-22s%s\n", "home language", Option["hl"])\
  2217. sprintf("%-22s%s\n", "source language", Option["sl"])\
  2218. sprintf("%-22s%s\n", "target language", join(Option["tl"], "+"))\
  2219. sprintf("%-22s%s\n", "translation engine", Option["engine"])\
  2220. sprintf("%-22s%s\n", "proxy", Option["proxy"] ? Option["proxy"] :
  2221. "[NONE]")\
  2222. sprintf("%-22s%s\n", "user-agent", Option["user-agent"] ? Option["user-agent"] :
  2223. "[NONE]")\
  2224. sprintf("%-22s%s\n", "theme", Option["theme"])\
  2225. sprintf("%-22s%s\n", "init file", InitScript ? InitScript : "[NONE]")\
  2226. sprintf("\n%-22s%s", "Report bugs to:", "https://github.com/soimort/translate-shell/issues")
  2227. }
  2228. function getHelp() {
  2229. return "Usage:  " ansi("bold", Command)\
  2230. " [" ansi("underline", "OPTIONS") "]"\
  2231. " [" ansi("underline", "SOURCE") "]"\
  2232. ":[" ansi("underline", "TARGETS") "]"\
  2233. " [" ansi("underline", "TEXT") "]..." RS\
  2234. RS "Information options:" RS\
  2235. ins(1, ansi("bold", "-V") ", " ansi("bold", "-version")) RS\
  2236. ins(2, "Print version and exit.") RS\
  2237. ins(1, ansi("bold", "-H") ", " ansi("bold", "-help")) RS\
  2238. ins(2, "Print help message and exit.") RS\
  2239. ins(1, ansi("bold", "-M") ", " ansi("bold", "-man")) RS\
  2240. ins(2, "Show man page and exit.") RS\
  2241. ins(1, ansi("bold", "-T") ", " ansi("bold", "-reference")) RS\
  2242. ins(2, "Print reference table of languages and exit.") RS\
  2243. ins(1, ansi("bold", "-R") ", " ansi("bold", "-reference-english")) RS\
  2244. ins(2, "Print reference table of languages (in English names) and exit.") RS\
  2245. ins(1, ansi("bold", "-L ") ansi("underline", "CODES")\
  2246. ", " ansi("bold", "-list ") ansi("underline", "CODES")) RS\
  2247. ins(2, "Print details of languages and exit.") RS\
  2248. ins(1, ansi("bold", "-S") ", " ansi("bold", "-list-engines")) RS\
  2249. ins(2, "List available translation engines and exit.") RS\
  2250. ins(1, ansi("bold", "-U") ", " ansi("bold", "-upgrade")) RS\
  2251. ins(2, "Check for upgrade of this program.") RS\
  2252. RS "Translator options:" RS\
  2253. ins(1, ansi("bold", "-e ") ansi("underline", "ENGINE")\
  2254. ", " ansi("bold", "-engine ") ansi("underline", "ENGINE")) RS\
  2255. ins(2, "Specify the translation engine to use.") RS\
  2256. RS "Display options:" RS\
  2257. ins(1, ansi("bold", "-verbose")) RS\
  2258. ins(2, "Verbose mode. (default)") RS\
  2259. ins(1, ansi("bold", "-b") ", " ansi("bold", "-brief")) RS\
  2260. ins(2, "Brief mode.") RS\
  2261. ins(1, ansi("bold", "-d") ", " ansi("bold", "-dictionary")) RS\
  2262. ins(2, "Dictionary mode.") RS\
  2263. ins(1, ansi("bold", "-identify")) RS\
  2264. ins(2, "Language identification.") RS\
  2265. ins(1, ansi("bold", "-show-original ") ansi("underline", "Y/n")) RS\
  2266. ins(2, "Show original text or not.") RS\
  2267. ins(1, ansi("bold", "-show-original-phonetics ") ansi("underline", "Y/n")) RS\
  2268. ins(2, "Show phonetic notation of original text or not.") RS\
  2269. ins(1, ansi("bold", "-show-translation ") ansi("underline", "Y/n")) RS\
  2270. ins(2, "Show translation or not.") RS\
  2271. ins(1, ansi("bold", "-show-translation-phonetics ") ansi("underline", "Y/n")) RS\
  2272. ins(2, "Show phonetic notation of translation or not.") RS\
  2273. ins(1, ansi("bold", "-show-prompt-message ") ansi("underline", "Y/n")) RS\
  2274. ins(2, "Show prompt message or not.") RS\
  2275. ins(1, ansi("bold", "-show-languages ") ansi("underline", "Y/n")) RS\
  2276. ins(2, "Show source and target languages or not.") RS\
  2277. ins(1, ansi("bold", "-show-original-dictionary ") ansi("underline", "y/N")) RS\
  2278. ins(2, "Show dictionary entry of original text or not.") RS\
  2279. ins(1, ansi("bold", "-show-dictionary ") ansi("underline", "Y/n")) RS\
  2280. ins(2, "Show dictionary entry of translation or not.") RS\
  2281. ins(1, ansi("bold", "-show-alternatives ") ansi("underline", "Y/n")) RS\
  2282. ins(2, "Show alternative translations or not.") RS\
  2283. ins(1, ansi("bold", "-w ") ansi("underline", "NUM")\
  2284. ", " ansi("bold", "-width ") ansi("underline", "NUM")) RS\
  2285. ins(2, "Specify the screen width for padding.") RS\
  2286. ins(1, ansi("bold", "-indent ") ansi("underline", "NUM")) RS\
  2287. ins(2, "Specify the size of indent (number of spaces).") RS\
  2288. ins(1, ansi("bold", "-theme ") ansi("underline", "FILENAME")) RS\
  2289. ins(2, "Specify the theme to use.") RS\
  2290. ins(1, ansi("bold", "-no-theme")) RS\
  2291. ins(2, "Do not use any other theme than default.") RS\
  2292. ins(1, ansi("bold", "-no-ansi")) RS\
  2293. ins(2, "Do not use ANSI escape codes.") RS\
  2294. ins(1, ansi("bold", "-no-autocorrect")) RS\
  2295. ins(2, "Do not autocorrect. (if defaulted by the translation engine)") RS\
  2296. ins(1, ansi("bold", "-no-bidi")) RS\
  2297. ins(2, "Do not convert bidirectional texts.") RS\
  2298. ins(1, ansi("bold", "-no-warn")) RS\
  2299. ins(2, "Do not write warning messages to stderr.") RS\
  2300. ins(1, ansi("bold", "-dump")) RS\
  2301. ins(2, "Print raw API response instead.") RS\
  2302. RS "Audio options:" RS\
  2303. ins(1, ansi("bold", "-p, -play")) RS\
  2304. ins(2, "Listen to the translation.") RS\
  2305. ins(1, ansi("bold", "-speak")) RS\
  2306. ins(2, "Listen to the original text.") RS\
  2307. ins(1, ansi("bold", "-n ") ansi("underline", "VOICE")\
  2308. ", " ansi("bold", "-narrator ") ansi("underline", "VOICE")) RS\
  2309. ins(2, "Specify the narrator, and listen to the translation.") RS\
  2310. ins(1, ansi("bold", "-player ") ansi("underline", "PROGRAM")) RS\
  2311. ins(2, "Specify the audio player to use, and listen to the translation.") RS\
  2312. ins(1, ansi("bold", "-no-play")) RS\
  2313. ins(2, "Do not listen to the translation.") RS\
  2314. ins(1, ansi("bold", "-no-translate")) RS\
  2315. ins(2, "Do not translate anything when using -speak.") RS\
  2316. ins(1, ansi("bold", "-download-audio")) RS\
  2317. ins(2, "Download the audio to the current directory.") RS\
  2318. ins(1, ansi("bold", "-download-audio-as ") ansi("underline", "FILENAME")) RS\
  2319. ins(2, "Download the audio to the specified file.") RS\
  2320. RS "Terminal paging and browsing options:" RS\
  2321. ins(1, ansi("bold", "-v") ", " ansi("bold", "-view")) RS\
  2322. ins(2, "View the translation in a terminal pager.") RS\
  2323. ins(1, ansi("bold", "-pager ") ansi("underline", "PROGRAM")) RS\
  2324. ins(2, "Specify the terminal pager to use, and view the translation.") RS\
  2325. ins(1, ansi("bold", "-no-view")) RS\
  2326. ins(2, "Do not view the translation in a terminal pager.") RS\
  2327. ins(1, ansi("bold", "-browser ") ansi("underline", "PROGRAM")) RS\
  2328. ins(2, "Specify the web browser to use.") RS\
  2329. RS "Networking options:" RS\
  2330. ins(1, ansi("bold", "-x ") ansi("underline", "HOST:PORT")\
  2331. ", " ansi("bold", "-proxy ") ansi("underline", "HOST:PORT")) RS\
  2332. ins(2, "Use HTTP proxy on given port.") RS\
  2333. ins(1, ansi("bold", "-u ") ansi("underline", "STRING")\
  2334. ", " ansi("bold", "-user-agent ") ansi("underline", "STRING")) RS\
  2335. ins(2, "Specify the User-Agent to identify as.") RS\
  2336. RS "Interactive shell options:" RS\
  2337. ins(1, ansi("bold", "-I") ", " ansi("bold", "-interactive") ", " ansi("bold", "-shell")) RS\
  2338. ins(2, "Start an interactive shell.") RS\
  2339. ins(1, ansi("bold", "-E") ", " ansi("bold", "-emacs")) RS\
  2340. ins(2, "Start the GNU Emacs front-end for an interactive shell.") RS\
  2341. ins(1, ansi("bold", "-no-rlwrap")) RS\
  2342. ins(2, "Do not invoke rlwrap when starting an interactive shell.") RS\
  2343. RS "I/O options:" RS\
  2344. ins(1, ansi("bold", "-i ") ansi("underline", "FILENAME")\
  2345. ", " ansi("bold", "-input ") ansi("underline", "FILENAME")) RS\
  2346. ins(2, "Specify the input file.") RS\
  2347. ins(1, ansi("bold", "-o ") ansi("underline", "FILENAME")\
  2348. ", " ansi("bold", "-output ") ansi("underline", "FILENAME")) RS\
  2349. ins(2, "Specify the output file.") RS\
  2350. RS "Language preference options:" RS\
  2351. ins(1, ansi("bold", "-l ") ansi("underline", "CODE")\
  2352. ", " ansi("bold", "-hl ") ansi("underline", "CODE")\
  2353. ", " ansi("bold", "-lang ") ansi("underline", "CODE")) RS\
  2354. ins(2, "Specify your home language.") RS\
  2355. ins(1, ansi("bold", "-s ") ansi("underline", "CODE")\
  2356. ", " ansi("bold", "-sl ") ansi("underline", "CODE")\
  2357. ", " ansi("bold", "-source ") ansi("underline", "CODE")\
  2358. ", " ansi("bold", "-from ") ansi("underline", "CODE")) RS\
  2359. ins(2, "Specify the source language.") RS\
  2360. ins(1, ansi("bold", "-t ") ansi("underline", "CODES")\
  2361. ", " ansi("bold", "-tl ") ansi("underline", "CODE")\
  2362. ", " ansi("bold", "-target ") ansi("underline", "CODES")\
  2363. ", " ansi("bold", "-to ") ansi("underline", "CODES")) RS\
  2364. ins(2, "Specify the target language(s), joined by '+'.") RS\
  2365. RS "Other options:" RS\
  2366. ins(1, ansi("bold", "-no-init")) RS\
  2367. ins(2, "Do not load any initialization script.") RS\
  2368. RS "See the man page " Command "(1) for more information."
  2369. }
  2370. function showMan(    temp) {
  2371. if (ENVIRON["TRANS_MANPAGE"]) {
  2372. initPager()
  2373. Groff = detectProgram("groff", "--version")
  2374. if (Pager && Groff) {
  2375. temp = "echo -E \"${TRANS_MANPAGE}\""
  2376. temp = temp PIPE\
  2377. Groff " -Wall -mtty-char -mandoc -Tutf8 "\
  2378. "-rLL=" Option["width"] "n -rLT=" Option["width"] "n"
  2379. switch (Pager) {
  2380. case "less":
  2381. temp = temp PIPE\
  2382. Pager " -s -P\"\\ \\Manual page " Command "(1) line %lt (press h for help or q to quit)\""
  2383. break
  2384. case "most":
  2385. temp = temp PIPE Pager " -Cs"
  2386. break
  2387. default:
  2388. temp = temp PIPE Pager
  2389. }
  2390. system(temp)
  2391. return
  2392. }
  2393. }
  2394. if (fileExists("man/" Command ".1"))
  2395. system("man man/" Command ".1" SUPERR)
  2396. else if (system("man " Command SUPERR))
  2397. print getHelp()
  2398. }
  2399. function getReference(displayName,
  2400. code, col, cols, i, j, name, num, r, rows, saveSortedIn,
  2401. t1, t2) {
  2402. num = 0
  2403. for (code in Locale)
  2404. if (Locale[code]["support"] != "unstable")
  2405. num++
  2406. rows = int(num / 3) + (num % 3 ? 1 : 0)
  2407. cols[0][0] = cols[1][0] = cols[2][0] = NULLSTR
  2408. i = 0
  2409. saveSortedIn = PROCINFO["sorted_in"]
  2410. PROCINFO["sorted_in"] = displayName == "endonym" ? "@ind_num_asc" :
  2411. "compName"
  2412. for (code in Locale) {
  2413. if (Locale[code]["support"] != "unstable") {
  2414. col = int(i / rows)
  2415. append(cols[col], code)
  2416. i++
  2417. }
  2418. }
  2419. PROCINFO["sorted_in"] = saveSortedIn
  2420. if (displayName == "endonym") {
  2421. r = "ā”Œ" replicate("ā”€", 23) "ā”¬" replicate("ā”€", 23) "ā”¬" replicate("ā”€", 23) "ā”" RS
  2422. for (i = 0; i < rows; i++) {
  2423. r = r "ā”‚"
  2424. for (j = 0; j < 3; j++) {
  2425. if (cols[j][i]) {
  2426. t1 = getDisplay(cols[j][i])
  2427. switch (cols[j][i]) {
  2428. case "he":
  2429. t1 = sprintf(" %-18s", t1)
  2430. break
  2431. case "ur":
  2432. t1 = sprintf(" %-17s", t1)
  2433. break
  2434. case "hi": case "gu": case "km": case "kn":
  2435. case "my": case "ne": case "pa": case "si":
  2436. case "ta": case "te": case "yi":
  2437. t1 = sprintf(" %-16s", t1)
  2438. break
  2439. case "yue":
  2440. t1 = sprintf(" %-13s", t1)
  2441. break
  2442. case "ja": case "ko":
  2443. t1 = sprintf(" %-12s", t1)
  2444. break
  2445. case "zh-CN": case "zh-TW":
  2446. t1 = sprintf(" %-11s", t1)
  2447. break
  2448. default:
  2449. if (length(t1) <= 15)
  2450. t1 = sprintf(" %-15s", t1)
  2451. }
  2452. switch (length(cols[j][i])) {
  2453. case 1: case 2: case 3: case 4:
  2454. t2 = sprintf("- %s ā”‚", ansi("bold", sprintf("%4s", cols[j][i])))
  2455. break
  2456. case 5:
  2457. t2 = sprintf("- %sā”‚", ansi("bold", cols[j][i]))
  2458. break
  2459. case 6:
  2460. t2 = sprintf("-%sā”‚", ansi("bold", cols[j][i]))
  2461. break
  2462. case 7:
  2463. t2 = sprintf("-%s", ansi("bold", cols[j][i]))
  2464. break
  2465. default:
  2466. t2 = ansi("bold", cols[j][i])
  2467. }
  2468. r = r t1 t2
  2469. } else
  2470. r = r sprintf("%23sā”‚", NULLSTR)
  2471. }
  2472. r = r RS
  2473. }
  2474. r = r "ā””" replicate("ā”€", 23) "ā”“" replicate("ā”€", 23) "ā”“" replicate("ā”€", 23) "ā”˜"
  2475. } else {
  2476. r = "ā”Œ" replicate("ā”€", 23) "ā”¬" replicate("ā”€", 23) "ā”¬" replicate("ā”€", 23) "ā”" RS
  2477. for (i = 0; i < rows; i++) {
  2478. r = r "ā”‚"
  2479. for (j = 0; j < 3; j++) {
  2480. if (cols[j][i]) {
  2481. t1 = getName(cols[j][i])
  2482. if (length(t1) > 15)
  2483. t1 = substr(t1, 1, 12) "..."
  2484. t1 = sprintf(" %-15s", t1)
  2485. switch (length(cols[j][i])) {
  2486. case 1: case 2: case 3: case 4:
  2487. t2 = sprintf("- %s ā”‚", ansi("bold", sprintf("%4s", cols[j][i])))
  2488. break
  2489. case 5:
  2490. t2 = sprintf("- %sā”‚", ansi("bold", cols[j][i]))
  2491. break
  2492. case 6:
  2493. t2 = sprintf("-%sā”‚", ansi("bold", cols[j][i]))
  2494. break
  2495. case 7:
  2496. t2 = sprintf("-%s", ansi("bold", cols[j][i]))
  2497. break
  2498. default:
  2499. t2 = ansi("bold", cols[j][i])
  2500. }
  2501. r = r t1 t2
  2502. } else
  2503. r = r sprintf("%23sā”‚", NULLSTR)
  2504. }
  2505. r = r RS
  2506. }
  2507. r = r "ā””" replicate("ā”€", 23) "ā”“" replicate("ā”€", 23) "ā”“" replicate("ā”€", 23) "ā”˜"
  2508. }
  2509. return r
  2510. }
  2511. function getList(codes,    code, i, r, saveSortedIn) {
  2512. r = NULLSTR
  2513. if (!isarray(codes))
  2514. r = getDetails(codes)
  2515. else if (anything(codes)) {
  2516. saveSortedIn = PROCINFO["sorted_in"]
  2517. PROCINFO["sorted_in"] = "@ind_num_asc"
  2518. for (i in codes)
  2519. r = (r ? r RS prettify("target-seperator", replicate(Option["chr-target-seperator"], Option["width"])) RS\
  2520. : r) getDetails(codes[i])
  2521. PROCINFO["sorted_in"] = saveSortedIn
  2522. } else
  2523. r = getDetails(Option["hl"])
  2524. return r
  2525. }
  2526. function tokenize(returnTokens, string,
  2527. delimiters,
  2528. newlines,
  2529. quotes,
  2530. escapeChars,
  2531. leftBlockComments,
  2532. rightBlockComments,
  2533. lineComments,
  2534. reservedOperators,
  2535. reservedPatterns,
  2536. blockCommenting,
  2537. c,
  2538. currentToken,
  2539. escaping,
  2540. i,
  2541. lineCommenting,
  2542. p,
  2543. quoting,
  2544. r,
  2545. s,
  2546. tempGroup,
  2547. tempPattern,
  2548. tempString) {
  2549. if (!delimiters[0]) {
  2550. delimiters[0] = " "
  2551. delimiters[1] = "\t"
  2552. delimiters[2] = "\v"
  2553. }
  2554. if (!newlines[0]) {
  2555. newlines[0] = "\n"
  2556. newlines[1] = "\r"
  2557. }
  2558. if (!quotes[0]) {
  2559. quotes[0] = "\""
  2560. }
  2561. if (!escapeChars[0]) {
  2562. escapeChars[0] = "\\"
  2563. }
  2564. if (!leftBlockComments[0]) {
  2565. leftBlockComments[0] = "#|"
  2566. leftBlockComments[1] = "/*"
  2567. leftBlockComments[2] = "(*"
  2568. }
  2569. if (!rightBlockComments[0]) {
  2570. rightBlockComments[0] = "|#"
  2571. rightBlockComments[1] = "*/"
  2572. rightBlockComments[2] = "*)"
  2573. }
  2574. if (!lineComments[0]) {
  2575. lineComments[0] = ";"
  2576. lineComments[1] = "//"
  2577. lineComments[2] = "#"
  2578. }
  2579. if (!reservedOperators[0]) {
  2580. reservedOperators[0] = "("
  2581. reservedOperators[1] = ")"
  2582. reservedOperators[2] = "["
  2583. reservedOperators[3] = "]"
  2584. reservedOperators[4] = "{"
  2585. reservedOperators[5] = "}"
  2586. reservedOperators[6] = ","
  2587. }
  2588. if (!reservedPatterns[0]) {
  2589. reservedPatterns[0] = "[+-]?((0|[1-9][0-9]*)|[.][0-9]*|(0|[1-9][0-9]*)[.][0-9]*)([Ee][+-]?[0-9]+)?"
  2590. reservedPatterns[1] = "[+-]?0[0-7]+([.][0-7]*)?"
  2591. reservedPatterns[2] = "[+-]?0[Xx][0-9A-Fa-f]+([.][0-9A-Fa-f]*)?"
  2592. }
  2593. split(string, s, "")
  2594. currentToken = ""
  2595. quoting = escaping = blockCommenting = lineCommenting = 0
  2596. p = 0
  2597. i = 1
  2598. while (i <= length(s)) {
  2599. c = s[i]
  2600. r = substr(string, i)
  2601. if (blockCommenting) {
  2602. if (tempString = startsWithAny(r, rightBlockComments))
  2603. blockCommenting = 0
  2604. i++
  2605. } else if (lineCommenting) {
  2606. if (belongsTo(c, newlines))
  2607. lineCommenting = 0
  2608. i++
  2609. } else if (quoting) {
  2610. currentToken = currentToken c
  2611. if (escaping) {
  2612. escaping = 0
  2613. } else {
  2614. if (belongsTo(c, quotes)) {
  2615. if (currentToken) {
  2616. returnTokens[p++] = currentToken
  2617. currentToken = ""
  2618. }
  2619. quoting = 0
  2620. } else if (belongsTo(c, escapeChars)) {
  2621. escaping = 1
  2622. } else {
  2623. }
  2624. }
  2625. i++
  2626. } else {
  2627. if (belongsTo(c, delimiters) || belongsTo(c, newlines)) {
  2628. if (currentToken) {
  2629. returnTokens[p++] = currentToken
  2630. currentToken = ""
  2631. }
  2632. i++
  2633. } else if (belongsTo(c, quotes)) {
  2634. if (currentToken) {
  2635. returnTokens[p++] = currentToken
  2636. }
  2637. currentToken = c
  2638. quoting = 1
  2639. i++
  2640. } else if (tempString = startsWithAny(r, leftBlockComments)) {
  2641. if (currentToken) {
  2642. returnTokens[p++] = currentToken
  2643. currentToken = ""
  2644. }
  2645. blockCommenting = 1
  2646. i += length(tempString)
  2647. } else if (tempString = startsWithAny(r, lineComments)) {
  2648. if (currentToken) {
  2649. returnTokens[p++] = currentToken
  2650. currentToken = ""
  2651. }
  2652. lineCommenting = 1
  2653. i += length(tempString)
  2654. } else if (tempString = startsWithAny(r, reservedOperators)) {
  2655. if (currentToken) {
  2656. returnTokens[p++] = currentToken
  2657. currentToken = ""
  2658. }
  2659. returnTokens[p++] = tempString
  2660. i += length(tempString)
  2661. } else if (tempPattern = matchesAny(r, reservedPatterns)) {
  2662. if (currentToken) {
  2663. returnTokens[p++] = currentToken
  2664. currentToken = ""
  2665. }
  2666. match(r, "^" tempPattern, tempGroup)
  2667. returnTokens[p++] = tempGroup[0]
  2668. i += length(tempGroup[0])
  2669. } else {
  2670. currentToken = currentToken c
  2671. i++
  2672. }
  2673. }
  2674. }
  2675. if (currentToken)
  2676. returnTokens[p++] = currentToken
  2677. }
  2678. function parseJsonArray(returnAST, tokens,
  2679. leftBrackets,
  2680. rightBrackets,
  2681. separators,
  2682. i, j, key, p, stack, token) {
  2683. if (!leftBrackets[0]) {
  2684. leftBrackets[0] = "("
  2685. leftBrackets[1] = "["
  2686. leftBrackets[2] = "{"
  2687. }
  2688. if (!rightBrackets[0]) {
  2689. rightBrackets[0] = ")"
  2690. rightBrackets[1] = "]"
  2691. rightBrackets[2] = "}"
  2692. }
  2693. if (!separators[0]) {
  2694. separators[0] = ","
  2695. }
  2696. stack[p = 0] = 0
  2697. for (i = 0; i < length(tokens); i++) {
  2698. token = tokens[i]
  2699. if (belongsTo(token, leftBrackets))
  2700. stack[++p] = 0
  2701. else if (belongsTo(token, rightBrackets))
  2702. --p
  2703. else if (belongsTo(token, separators))
  2704. stack[p]++
  2705. else {
  2706. key = stack[0]
  2707. for (j = 1; j <= p; j++)
  2708. key = key SUBSEP stack[j]
  2709. returnAST[key] = token
  2710. }
  2711. }
  2712. }
  2713. function parseJson(returnAST, tokens,
  2714. arrayStartTokens, arrayEndTokens,
  2715. objectStartTokens, objectEndTokens,
  2716. commas, colons,
  2717. flag, i, j, key, name, p, stack, token) {
  2718. if (!arrayStartTokens[0])  arrayStartTokens[0]  = "["
  2719. if (!arrayEndTokens[0])    arrayEndTokens[0]    = "]"
  2720. if (!objectStartTokens[0]) objectStartTokens[0] = "{"
  2721. if (!objectEndTokens[0])   objectEndTokens[0]   = "}"
  2722. if (!commas[0])            commas[0]            = ","
  2723. if (!colons[0])            colons[0]            = ":"
  2724. stack[p = 0] = 0
  2725. flag = 0
  2726. for (i = 0; i < length(tokens); i++) {
  2727. token = tokens[i]
  2728. if (belongsTo(token, arrayStartTokens)) {
  2729. stack[++p] = 0
  2730. } else if (belongsTo(token, objectStartTokens)) {
  2731. stack[++p] = NULLSTR
  2732. flag = 0
  2733. } else if (belongsTo(token, objectEndTokens) ||
  2734. belongsTo(token, arrayEndTokens)) {
  2735. --p
  2736. } else if (belongsTo(token, commas)) {
  2737. if (isnum(stack[p]))
  2738. stack[p]++
  2739. else
  2740. flag = 0
  2741. } else if (belongsTo(token, colons)) {
  2742. flag = 1
  2743. } else if (isnum(stack[p]) || flag) {
  2744. key = stack[0]
  2745. for (j = 1; j <= p; j++)
  2746. key = key SUBSEP stack[j]
  2747. returnAST[key] = token
  2748. flag = 0
  2749. } else {
  2750. stack[p] = unparameterize(token)
  2751. }
  2752. }
  2753. }
  2754. function parseList(returnAST, tokens,
  2755. leftBrackets,
  2756. rightBrackets,
  2757. separators,
  2758. i, j, key, p, stack, token) {
  2759. if (!leftBrackets[0]) {
  2760. leftBrackets[0] = "("
  2761. leftBrackets[1] = "["
  2762. leftBrackets[2] = "{"
  2763. }
  2764. if (!rightBrackets[0]) {
  2765. rightBrackets[0] = ")"
  2766. rightBrackets[1] = "]"
  2767. rightBrackets[2] = "}"
  2768. }
  2769. if (!separators[0]) {
  2770. separators[0] = ","
  2771. }
  2772. stack[p = 0] = 0
  2773. for (i = 0; i < length(tokens); i++) {
  2774. token = tokens[i]
  2775. if (belongsTo(token, leftBrackets)) {
  2776. stack[++p] = 0
  2777. } else if (belongsTo(token, rightBrackets)) {
  2778. stack[--p]++
  2779. } else if (belongsTo(token, separators)) {
  2780. } else {
  2781. key = NULLSTR
  2782. if (p > 0) {
  2783. for (j = 0; j < p - 1; j++)
  2784. key = key SUBSEP stack[j]
  2785. returnAST[key][stack[p - 1]] = NULLSTR
  2786. key = key SUBSEP stack[p - 1]
  2787. }
  2788. returnAST[key][stack[p]] = token
  2789. stack[p]++
  2790. }
  2791. }
  2792. }
  2793. function prettify(name, string,    i, temp) {
  2794. temp = string
  2795. if ("sgr-" name in Option)
  2796. if (isarray(Option["sgr-" name]))
  2797. for (i in Option["sgr-" name])
  2798. temp = ansi(Option["sgr-" name][i], temp)
  2799. else
  2800. temp = ansi(Option["sgr-" name], temp)
  2801. return temp
  2802. }
  2803. function randomColor(    i) {
  2804. i = int(5 * rand())
  2805. switch (i) {
  2806. case 0: return "green"
  2807. case 1: return "yellow"
  2808. case 2: return "blue"
  2809. case 3: return "magenta"
  2810. case 4: return "cyan"
  2811. default: return "default"
  2812. }
  2813. }
  2814. function setRandomTheme(    i, n, temp) {
  2815. srand(systime())
  2816. for (i = 0; i < 3; i++) {
  2817. do temp = randomColor(); while (belongsTo(temp, n))
  2818. n[i] = temp
  2819. }
  2820. Option["sgr-prompt-message"] = Option["sgr-languages"] = n[0]
  2821. Option["sgr-original-dictionary-detailed-word-class"][1] = n[0]
  2822. Option["sgr-original-dictionary-detailed-word-class"][2] = "bold"
  2823. Option["sgr-original-dictionary-synonyms"] = n[0]
  2824. Option["sgr-original-dictionary-synonyms-word-class"][1] = n[0]
  2825. Option["sgr-original-dictionary-synonyms-word-class"][2] = "bold"
  2826. Option["sgr-original-dictionary-examples"] = n[0]
  2827. Option["sgr-original-dictionary-see-also"] = n[0]
  2828. Option["sgr-dictionary-word-class"][1] = n[0]
  2829. Option["sgr-dictionary-word-class"][2] = "bold"
  2830. Option["sgr-original"][1] = Option["sgr-original-phonetics"][1] = n[1]
  2831. Option["sgr-original"][2] = Option["sgr-original-phonetics"][2] = "bold"
  2832. Option["sgr-prompt-message-original"][1] = n[1]
  2833. Option["sgr-prompt-message-original"][2] = "bold"
  2834. Option["sgr-languages-sl"] = n[1]
  2835. Option["sgr-original-dictionary-detailed-explanation"][1] = n[1]
  2836. Option["sgr-original-dictionary-detailed-explanation"][2] = "bold"
  2837. Option["sgr-original-dictionary-detailed-example"] = n[1]
  2838. Option["sgr-original-dictionary-detailed-synonyms"] = n[1]
  2839. Option["sgr-original-dictionary-detailed-synonyms-item"][1] = n[1]
  2840. Option["sgr-original-dictionary-detailed-synonyms-item"][2] = "bold"
  2841. Option["sgr-original-dictionary-synonyms-synonyms"] = n[1]
  2842. Option["sgr-original-dictionary-synonyms-synonyms-item"][1] = n[1]
  2843. Option["sgr-original-dictionary-synonyms-synonyms-item"][2] = "bold"
  2844. Option["sgr-original-dictionary-examples-example"] = n[1]
  2845. Option["sgr-original-dictionary-examples-original"][1] = n[1]
  2846. Option["sgr-original-dictionary-examples-original"][2] = "bold"
  2847. Option["sgr-original-dictionary-examples-original"][3] = "underline"
  2848. Option["sgr-original-dictionary-see-also-phrases"] = n[1]
  2849. Option["sgr-original-dictionary-see-also-phrases-item"][1] = n[1]
  2850. Option["sgr-original-dictionary-see-also-phrases-item"][2] = "bold"
  2851. Option["sgr-dictionary-explanation"] = n[1]
  2852. Option["sgr-dictionary-explanation-item"][1] = n[1]
  2853. Option["sgr-dictionary-explanation-item"][2] = "bold"
  2854. Option["sgr-alternatives-original"][1] = n[1]
  2855. Option["sgr-alternatives-original"][2] = "bold"
  2856. Option["sgr-translation"][1] = Option["sgr-translation-phonetics"][1] = n[2]
  2857. Option["sgr-translation"][2] = Option["sgr-translation-phonetics"][2] = "bold"
  2858. Option["sgr-languages-tl"] = n[2]
  2859. Option["sgr-dictionary-word"][1] = n[2]
  2860. Option["sgr-dictionary-word"][2] = "bold"
  2861. Option["sgr-alternatives-translations"] = n[2]
  2862. Option["sgr-alternatives-translations-item"][1] = n[2]
  2863. Option["sgr-alternatives-translations-item"][2] = "bold"
  2864. Option["sgr-brief-translation"][1] = Option["sgr-brief-translation-phonetics"][1] = n[2]
  2865. Option["sgr-brief-translation"][2] = Option["sgr-brief-translation-phonetics"][2] = "bold"
  2866. Option["fmt-welcome-message"] = Name
  2867. Option["sgr-welcome-message"][1] = n[0]
  2868. Option["sgr-welcome-message"][2] = "bold"
  2869. Option["fmt-welcome-submessage"] = "(:q to quit)"
  2870. Option["sgr-welcome-submessage"] = n[0]
  2871. Option["fmt-prompt"] = "%s> "
  2872. Option["sgr-prompt"][1] = n[1]
  2873. Option["sgr-prompt"][2] = "bold"
  2874. }
  2875. function setDefaultTheme() {
  2876. Option["sgr-translation"] = Option["sgr-translation-phonetics"] = "bold"
  2877. Option["sgr-prompt-message-original"] = "underline"
  2878. Option["sgr-languages-sl"] = "underline"
  2879. Option["sgr-languages-tl"] = "bold"
  2880. Option["sgr-original-dictionary-detailed-explanation"] = "bold"
  2881. Option["sgr-original-dictionary-detailed-synonyms-item"] = "bold"
  2882. Option["sgr-original-dictionary-synonyms-synonyms-item"] = "bold"
  2883. Option["sgr-original-dictionary-examples-original"][1] = "bold"
  2884. Option["sgr-original-dictionary-examples-original"][2] = "underline"
  2885. Option["sgr-original-dictionary-see-also-phrases-item"] = "bold"
  2886. Option["sgr-dictionary-word"] = "bold"
  2887. Option["sgr-alternatives-original"] = "underline"
  2888. Option["sgr-alternatives-translations-item"] = "bold"
  2889. Option["fmt-welcome-message"] = Name
  2890. Option["sgr-welcome-message"] = "bold"
  2891. Option["fmt-welcome-submessage"] = "(:q to quit)"
  2892. Option["fmt-prompt"] = "%s> "
  2893. Option["sgr-prompt"] = "bold"
  2894. }
  2895. function setTheme(    file, line, script) {
  2896. if (Option["theme"] && Option["theme"] != "default"\
  2897. && Option["theme"] != "none" && Option["theme"] != "random") {
  2898. file = Option["theme"]
  2899. if (!fileExists(file)) {
  2900. file = ENVIRON["HOME"] "/.translate-shell/" Option["theme"]
  2901. if (!fileExists(file)) {
  2902. file = ENVIRON["HOME"] "/.config/translate-shell/" Option["theme"]
  2903. if (!fileExists(file)) return
  2904. }
  2905. }
  2906. }
  2907. if (file && fileExists(file)) {
  2908. script = NULLSTR
  2909. while (getline line < file)
  2910. script = script "\n" line
  2911. loadOptions(script)
  2912. } else if (Option["theme"] == "none")
  2913. ;
  2914. else if (Option["theme"] == "random")
  2915. setRandomTheme()
  2916. else
  2917. setDefaultTheme()
  2918. }
  2919. function provides(engineName) {
  2920. Translator[tolower(engineName)] = TRUE
  2921. }
  2922. function engineMethod(methodName,    engine, translator) {
  2923. if (!Translator[Option["engine"]]) {
  2924. engine = tolower(Option["engine"])
  2925. if (!Translator[engine])
  2926. for (translator in Translator)
  2927. if (Translator[translator] &&
  2928. translator ~ "^"engine) {
  2929. engine = translator
  2930. break
  2931. }
  2932. if (!Translator[engine]) {
  2933. e("[ERROR] Translator not found: " Option["engine"] "\n"\
  2934. "        Run '-list-engines / -S' to see a list of available engines.")
  2935. exit 1
  2936. }
  2937. Option["engine"] = engine
  2938. }
  2939. return Option["engine"] methodName
  2940. }
  2941. function initAudioPlayer() {
  2942. AudioPlayer = !system("mplayer" SUPOUT SUPERR) ?
  2943. "mplayer" :
  2944. (!system("mpv" SUPOUT SUPERR) ?
  2945. "mpv" :
  2946. (!system("mpg123 --version" SUPOUT SUPERR) ?
  2947. "mpg123" :
  2948. ""))
  2949. }
  2950. function initSpeechSynthesizer() {
  2951. SpeechSynthesizer = !system("say ''" SUPOUT SUPERR) ?
  2952. "say" :
  2953. (!system("espeak ''" SUPOUT SUPERR) ?
  2954. "espeak" :
  2955. "")
  2956. }
  2957. function initPager() {
  2958. Pager = !system("less -V" SUPOUT SUPERR) ?
  2959. "less" :
  2960. (!system("more -V" SUPOUT SUPERR) ?
  2961. "more" :
  2962. (!system("most" SUPOUT SUPERR) ?
  2963. "most" :
  2964. ""))
  2965. }
  2966. function initHttpService() {
  2967. _Init()
  2968. if (Option["proxy"]) {
  2969. match(Option["proxy"], /^(http:\/*)?(([^:]+):([^@]+)@)?([^\/]*):([^\/:]*)/, HttpProxySpec)
  2970. HttpAuthUser = HttpProxySpec[3]
  2971. HttpAuthPass = HttpProxySpec[4]
  2972. HttpAuthCredentials = base64(unquote(HttpAuthUser) ":" HttpAuthPass)
  2973. HttpService = "/inet/tcp/0/" HttpProxySpec[5] "/" HttpProxySpec[6]
  2974. HttpPathPrefix = HttpProtocol HttpHost
  2975. } else {
  2976. HttpService = "/inet/tcp/0/" HttpHost "/" HttpPort
  2977. HttpPathPrefix = ""
  2978. }
  2979. }
  2980. function preprocess(text) {
  2981. return quote(text)
  2982. }
  2983. function postprocess(text) {
  2984. text = gensub(/ ([.,;:?!"])/, "\\1", "g", text)
  2985. text = gensub(/(["]) /, "\\1", "g", text)
  2986. return text
  2987. }
  2988. function getResponse(text, sl, tl, hl,
  2989. content, header, isBody, url, group, status, location) {
  2990. url = _RequestUrl(text, sl, tl, hl)
  2991. header = "GET " url " HTTP/1.1\n"\
  2992. "Host: " HttpHost "\n"\
  2993. "Connection: close\n"
  2994. if (Option["user-agent"])
  2995. header = header "User-Agent: " Option["user-agent"] "\n"
  2996. if (Cookie)
  2997. header = header "Cookie: " Cookie "\n"
  2998. if (HttpAuthUser && HttpAuthPass)
  2999. header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\n"
  3000. content = NULLSTR; isBody = 0
  3001. print header |& HttpService
  3002. while ((HttpService |& getline) > 0) {
  3003. if (isBody)
  3004. content = content ? content "\n" $0 : $0
  3005. else if (length($0) <= 1)
  3006. isBody = 1
  3007. else {
  3008. match($0, /^HTTP[^ ]* ([^ ]*)/, group)
  3009. if (RSTART) status = group[1]
  3010. match($0, /^Location: (.*)/, group)
  3011. if (RSTART) location = squeeze(group[1])
  3012. }
  3013. l(sprintf("%4s bytes > %s", length($0), $0))
  3014. }
  3015. close(HttpService)
  3016. if (status == "301" && location)
  3017. content = curl(location)
  3018. return assert(content, "[ERROR] Null response.")
  3019. }
  3020. function p(string) {
  3021. if (Option["view"])
  3022. print string | Option["pager"]
  3023. else
  3024. print string > Option["output"]
  3025. }
  3026. function play(text, tl,    url) {
  3027. url = _TTSUrl(text, tl)
  3028. system(Option["player"] " " parameterize(url) SUPOUT SUPERR)
  3029. }
  3030. function download_audio(text, tl,    url, output) {
  3031. url = _TTSUrl(text, tl)
  3032. if (Option["download-audio-as"])
  3033. output = Option["download-audio-as"]
  3034. else
  3035. output = text " [" Option["engine"] "] (" Option["narrator"] ").ts"
  3036. if (url ~ /^\//)
  3037. system("mv -- " parameterize(url) " " parameterize(output))
  3038. else
  3039. curl(url, output)
  3040. }
  3041. function getTranslation(text, sl, tl, hl,
  3042. isVerbose, toSpeech, returnPlaylist, returnIl) {
  3043. return _Translate(text, sl, tl, hl,
  3044. isVerbose, toSpeech, returnPlaylist, returnIl)
  3045. }
  3046. function fileTranslation(uri,    group, temp1, temp2) {
  3047. temp1 = Option["input"]
  3048. temp2 = Option["verbose"]
  3049. match(uri, /^file:\/\/(.*)/, group)
  3050. Option["input"] = group[1]
  3051. Option["verbose"] = 0
  3052. translateMain()
  3053. Option["input"] = temp1
  3054. Option["verbose"] = temp2
  3055. }
  3056. function webTranslation(uri, sl, tl, hl) {
  3057. system(Option["browser"] " "\
  3058. parameterize(_WebTranslateUrl(uri, sl, tl, hl)) "&")
  3059. }
  3060. function translate(text, inline,
  3061. i, j, playlist, il, saveSortedIn) {
  3062. if (!getCode(Option["hl"])) {
  3063. w("[WARNING] Unknown language code: " Option["hl"] ", fallback to English: en")
  3064. Option["hl"] = "en"
  3065. } else if (isRTL(Option["hl"])) {
  3066. if (!FriBidi)
  3067. w("[WARNING] " getName(Option["hl"]) " is a right-to-left language, but FriBidi is not found.")
  3068. }
  3069. if (!getCode(Option["sl"])) {
  3070. w("[WARNING] Unknown source language code: " Option["sl"])
  3071. } else if (isRTL(Option["sl"])) {
  3072. if (!FriBidi)
  3073. w("[WARNING] " getName(Option["sl"]) " is a right-to-left language, but FriBidi is not found.")
  3074. }
  3075. saveSortedIn = PROCINFO["sorted_in"]
  3076. PROCINFO["sorted_in"] = "@ind_num_asc"
  3077. for (i in Option["tl"]) {
  3078. if (!Option["interactive"])
  3079. if (Option["verbose"] && i > 1)
  3080. p(prettify("target-seperator", replicate(Option["chr-target-seperator"], Option["width"])))
  3081. if (inline &&
  3082. startsWithAny(text, UriSchemes) == "file://") {
  3083. fileTranslation(text)
  3084. } else if (inline &&
  3085. startsWithAny(text, UriSchemes) == "http://" ||
  3086. startsWithAny(text, UriSchemes) == "https://") {
  3087. webTranslation(text, Option["sl"], Option["tl"][i], Option["hl"])
  3088. } else {
  3089. if (!Option["no-translate"])
  3090. p(getTranslation(text, Option["sl"], Option["tl"][i], Option["hl"], Option["verbose"], Option["play"] || Option["download-audio"], playlist, il))
  3091. else
  3092. il[0] = Option["sl"] == "auto" ? "en" : Option["sl"]
  3093. if (Option["play"] == 1) {
  3094. if (Option["player"])
  3095. for (j in playlist)
  3096. play(playlist[j]["text"], playlist[j]["tl"])
  3097. else if (SpeechSynthesizer)
  3098. for (j in playlist)
  3099. print playlist[j]["text"] | SpeechSynthesizer
  3100. } else if (Option["play"] == 2) {
  3101. if (Option["player"])
  3102. play(text, il[0])
  3103. else if (SpeechSynthesizer)
  3104. print text | SpeechSynthesizer
  3105. }
  3106. if (Option["download-audio"] == 1) {
  3107. if (Option["play"] != 2 && !Option["no-translate"])
  3108. download_audio(playlist[length(playlist) - 1]["text"],\
  3109. playlist[length(playlist) - 1]["tl"])
  3110. else
  3111. download_audio(text, il[0])
  3112. }
  3113. }
  3114. }
  3115. PROCINFO["sorted_in"] = saveSortedIn
  3116. }
  3117. function translateMain(    i, line) {
  3118. if (Option["interactive"])
  3119. prompt()
  3120. if (Option["input"] == STDIN || fileExists(Option["input"])) {
  3121. i = 0
  3122. while (getline line < Option["input"])
  3123. if (line) {
  3124. if (!Option["interactive"])
  3125. if (Option["verbose"] && i++ > 0)
  3126. p(prettify("source-seperator",
  3127. replicate(Option["chr-source-seperator"],
  3128. Option["width"])))
  3129. if (Option["interactive"])
  3130. repl(line)
  3131. else
  3132. translate(line)
  3133. } else {
  3134. if (!Option["interactive"])
  3135. if (!Option["verbose"])
  3136. p(line)
  3137. }
  3138. } else
  3139. e("[ERROR] File not found: " Option["input"])
  3140. }
  3141. function _Init(    vm) {
  3142. vm = engineMethod("Init")
  3143. return @vm()
  3144. }
  3145. function _RequestUrl(text, sl, tl, hl,    vm) {
  3146. vm = engineMethod("RequestUrl")
  3147. return @vm(text, sl, tl, hl)
  3148. }
  3149. function _TTSUrl(text, tl,    vm) {
  3150. vm = engineMethod("TTSUrl")
  3151. return @vm(text, tl)
  3152. }
  3153. function _WebTranslateUrl(uri, sl, tl, hl,    vm) {
  3154. vm = engineMethod("WebTranslateUrl")
  3155. return @vm(uri, sl, tl, hl)
  3156. }
  3157. function _Translate(text, sl, tl, hl,
  3158. isVerbose, toSpeech, returnPlaylist, returnIl,
  3159. vm) {
  3160. vm = engineMethod("Translate")
  3161. return @vm(text, sl, tl, hl,
  3162. isVerbose, toSpeech, returnPlaylist, returnIl)
  3163. }
  3164. BEGIN { provides("google") }
  3165. function genRL(a, x,
  3166. b, c, d, i, y) {
  3167. tokenize(y, x)
  3168. parseList(b, y)
  3169. i = SUBSEP 0
  3170. for (c = 0; c < length(b[i]) - 2; c += 3) {
  3171. d = b[i][c + 2]
  3172. d = d >= 97 ? d - 87 :
  3173. d - 48
  3174. d = b[i][c + 1] == 43 ? rshift(a, d) : lshift(a, d)
  3175. a = b[i][c] == 43 ? and(a + d, 4294967295) : xor(a, d)
  3176. }
  3177. return a
  3178. }
  3179. function genTK(text,
  3180. a, d, dLen, e, tkk, ub, vb) {
  3181. if (TK[text]) return TK[text]
  3182. tkk = systime() / 3600
  3183. ub = "[43,45,51,94,43,98,43,45,102]"
  3184. vb = "[43,45,97,94,43,54]"
  3185. dLen = dump(text, d)
  3186. a = tkk
  3187. for (e = 1; e <= dLen; e++)
  3188. a = genRL(a + d[e], vb)
  3189. a = genRL(a, ub)
  3190. 0 > a && (a = and(a, 2147483647) + 2147483648)
  3191. a %= 1e6
  3192. TK[text] = a "." xor(a, tkk)
  3193. l(text, "text")
  3194. l(tkk, "tkk")
  3195. l(TK[text], "tk")
  3196. return TK[text]
  3197. }
  3198. function googleInit() {
  3199. HttpProtocol = "http://"
  3200. HttpHost = "translate.googleapis.com"
  3201. HttpPort = 80
  3202. }
  3203. function googleRequestUrl(text, sl, tl, hl,    qc) {
  3204. qc = Option["no-autocorrect"] ? "qc" : "qca";
  3205. return HttpPathPrefix "/translate_a/single?client=gtx"\
  3206. "&ie=UTF-8&oe=UTF-8"\
  3207. "&dt=bd&dt=ex&dt=ld&dt=md&dt=rw&dt=rm&dt=ss&dt=t&dt=at"\
  3208. "&dt=" qc "&sl=" sl "&tl=" tl "&hl=" hl\
  3209. "&q=" preprocess(text)
  3210. }
  3211. function googleTTSUrl(text, tl) {
  3212. return HttpProtocol HttpHost "/translate_tts?ie=UTF-8&client=gtx"\
  3213. "&tl=" tl "&q=" preprocess(text)
  3214. }
  3215. function googleWebTranslateUrl(uri, sl, tl, hl) {
  3216. return "https://translate.google.com/translate?"\
  3217. "hl=" hl "&sl=" sl "&tl=" tl "&u=" uri
  3218. }
  3219. function googleTranslate(text, sl, tl, hl,
  3220. isVerbose, toSpeech, returnPlaylist, returnIl,
  3221. r,
  3222. content, tokens, ast,
  3223. _sl, _tl, _hl, il, ils, isPhonetic,
  3224. article, example, explanation, ref, word,
  3225. translation, translations, phonetics,
  3226. wordClasses, words, segments, altTranslations,
  3227. original, oPhonetics, oWordClasses, oWords,
  3228. oRefs, oSynonymClasses, oSynonyms,
  3229. oExamples, oSeeAlso,
  3230. wShowOriginal, wShowOriginalPhonetics,
  3231. wShowTranslation, wShowTranslationPhonetics,
  3232. wShowPromptMessage, wShowLanguages,
  3233. wShowOriginalDictionary, wShowDictionary,
  3234. wShowAlternatives,
  3235. hasWordClasses, hasAltTranslations,
  3236. i, j, k, group, temp, saveSortedIn) {
  3237. isPhonetic = match(tl, /^@/)
  3238. tl = substr(tl, 1 + isPhonetic)
  3239. if (!getCode(tl)) {
  3240. w("[WARNING] Unknown target language code: " tl)
  3241. } else if (isRTL(tl)) {
  3242. if (!FriBidi)
  3243. w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
  3244. }
  3245. _sl = getCode(sl); if (!_sl) _sl = sl
  3246. _tl = getCode(tl); if (!_tl) _tl = tl
  3247. _hl = getCode(hl); if (!_hl) _hl = hl
  3248. content = getResponse(text, _sl, _tl, _hl)
  3249. if (Option["dump"])
  3250. return content
  3251. tokenize(tokens, content)
  3252. parseJsonArray(ast, tokens)
  3253. l(content, "content", 1, 1)
  3254. l(tokens, "tokens", 1, 0, 1)
  3255. l(ast, "ast")
  3256. if (!isarray(ast) || !anything(ast)) {
  3257. e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
  3258. ExitCode = 1
  3259. return
  3260. }
  3261. saveSortedIn = PROCINFO["sorted_in"]
  3262. PROCINFO["sorted_in"] = "compareByIndexFields"
  3263. for (i in ast) {
  3264. if (ast[i] == "null") continue
  3265. if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "0$")
  3266. append(translations, literal(ast[i]))
  3267. if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "1$")
  3268. append(original, literal(ast[i]))
  3269. if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "2$")
  3270. append(phonetics, literal(ast[i]))
  3271. if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "3$")
  3272. append(oPhonetics, literal(ast[i]))
  3273. if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
  3274. wordClasses[group[1]] = literal(ast[i])
  3275. if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "([[:digit:]]+)$", group))
  3276. words[group[1]][group[2]][group[3]] = literal(ast[i])
  3277. if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)$", group))
  3278. words[group[1]][group[2]]["1"][group[3]] = literal(ast[i])
  3279. if (match(i, "^0" SUBSEP "5" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group)) {
  3280. segments[group[1]] = literal(ast[i])
  3281. altTranslations[group[1]][0] = ""
  3282. }
  3283. if (match(i, "^0" SUBSEP "5" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
  3284. altTranslations[group[1]][group[2]] = literal(ast[i])
  3285. if (i ~ "^0" SUBSEP "7" SUBSEP "5$") {
  3286. if (ast[i] == "true")
  3287. w("Showing translation for:  (use -no-auto to disable autocorrect)")
  3288. else
  3289. w("Did you mean: "\
  3290. ansi("bold", unparameterize(ast["0" SUBSEP "7" SUBSEP "1"])))
  3291. }
  3292. if (i ~ "^0" SUBSEP "8" SUBSEP "0" SUBSEP "[[:digit:]]+$" ||
  3293. i ~ "^0" SUBSEP "2$")
  3294. append(ils, literal(ast[i]))
  3295. if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
  3296. oSynonymClasses[group[1]] = literal(ast[i])
  3297. if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "1$", group))
  3298. if (ast[i]) {
  3299. oRefs[literal(ast[i])][1] = group[1]
  3300. oRefs[literal(ast[i])][2] = group[2]
  3301. }
  3302. if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0" SUBSEP "([[:digit:]]+)$", group))
  3303. oSynonyms[group[1]][group[2]][group[3]] = literal(ast[i])
  3304. if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
  3305. oWordClasses[group[1]] = literal(ast[i])
  3306. if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
  3307. oWords[group[1]][group[2]][0] = literal(ast[i])
  3308. if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "1$", group))
  3309. oWords[group[1]][group[2]][1] = literal(ast[i])
  3310. if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2$", group))
  3311. oWords[group[1]][group[2]][2] = literal(ast[i])
  3312. if (match(i, "^0" SUBSEP "13" SUBSEP "0" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
  3313. oExamples[group[1]] = literal(ast[i])
  3314. if (match(i, "^0" SUBSEP "14" SUBSEP "0" SUBSEP "([[:digit:]]+)$", group))
  3315. oSeeAlso[group[1]] = literal(ast[i])
  3316. }
  3317. PROCINFO["sorted_in"] = saveSortedIn
  3318. translation = join(translations)
  3319. returnIl[0] = il = !anything(ils) || belongsTo(sl, ils) ? sl : ils[0]
  3320. if (Option["verbose"] < 0)
  3321. return getList(il)
  3322. if (!isVerbose) {
  3323. r = isPhonetic && anything(phonetics) ?
  3324. prettify("brief-translation-phonetics", join(phonetics, " ")) :
  3325. prettify("brief-translation", s(translation, tl))
  3326. if (toSpeech) {
  3327. returnPlaylist[0]["text"] = translation
  3328. returnPlaylist[0]["tl"] = tl
  3329. }
  3330. } else {
  3331. wShowOriginal = Option["show-original"]
  3332. wShowOriginalPhonetics = Option["show-original-phonetics"]
  3333. wShowTranslation = Option["show-translation"]
  3334. wShowTranslationPhonetics = Option["show-translation-phonetics"]
  3335. wShowPromptMessage = Option["show-prompt-message"]
  3336. wShowLanguages = Option["show-languages"]
  3337. wShowOriginalDictionary = Option["show-original-dictionary"]
  3338. wShowDictionary = Option["show-dictionary"]
  3339. wShowAlternatives = Option["show-alternatives"]
  3340. if (!anything(oPhonetics)) wShowOriginalPhonetics = 0
  3341. if (!anything(phonetics)) wShowTranslationPhonetics = 0
  3342. if (getCode(il) == getCode(tl) &&\
  3343. (isarray(oWordClasses) || isarray(oSynonymClasses) ||\
  3344. isarray(oExamples) || isarray(oSeeAlso))) {
  3345. wShowOriginalDictionary = 1
  3346. wShowTranslation = 0
  3347. }
  3348. hasWordClasses = exists(wordClasses)
  3349. hasAltTranslations = exists(altTranslations[0])
  3350. if (!hasWordClasses && !hasAltTranslations)
  3351. wShowPromptMessage = wShowLanguages = 0
  3352. if (!hasWordClasses) wShowDictionary = 0
  3353. if (!hasAltTranslations) wShowAlternatives = 0
  3354. if (wShowOriginal) {
  3355. if (r) r = r RS RS
  3356. r = r m("-- display original text & phonetics")
  3357. r = r prettify("original", s(join(original, " "), il))
  3358. if (wShowOriginalPhonetics)
  3359. r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
  3360. }
  3361. if (wShowTranslation) {
  3362. if (r) r = r RS RS
  3363. r = r m("-- display major translation & phonetics")
  3364. r = r prettify("translation", s(translation, tl))
  3365. if (wShowTranslationPhonetics)
  3366. r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
  3367. }
  3368. if (wShowPromptMessage || wShowLanguages)
  3369. if (r) r = r RS
  3370. if (wShowPromptMessage) {
  3371. if (hasWordClasses) {
  3372. if (r) r = r RS
  3373. r = r m("-- display prompt message (Definitions of ...)")
  3374. if (isRTL(hl))
  3375. r = r prettify("prompt-message", s(showDefinitionsOf(hl, join(original, " "))))
  3376. else {
  3377. split(showDefinitionsOf(hl, "\0%s\0"), group, "\0")
  3378. for (i = 1; i <= length(group); i++) {
  3379. if (group[i] == "%s")
  3380. r = r prettify("prompt-message-original", show(join(original, " "), il))
  3381. else
  3382. r = r prettify("prompt-message", group[i])
  3383. }
  3384. }
  3385. } else if (hasAltTranslations) {
  3386. if (r) r = r RS
  3387. r = r m("-- display prompt message (Translations of ...)")
  3388. if (isRTL(hl))
  3389. r = r prettify("prompt-message", s(showTranslationsOf(hl, join(original, " "))))
  3390. else {
  3391. split(showTranslationsOf(hl, "\0%s\0"), group, "\0")
  3392. for (i = 1; i <= length(group); i++) {
  3393. if (group[i] == "%s")
  3394. r = r prettify("prompt-message-original", show(join(original, " "), il))
  3395. else
  3396. r = r prettify("prompt-message", group[i])
  3397. }
  3398. }
  3399. }
  3400. }
  3401. if (wShowLanguages) {
  3402. if (r) r = r RS
  3403. r = r m("-- display source language -> target language")
  3404. temp = Option["fmt-languages"]
  3405. if (!temp) temp = "[ %s -> %t ]"
  3406. split(temp, group, /(%s|%S|%t|%T)/)
  3407. r = r prettify("languages", group[1])
  3408. if (temp ~ /%s/)
  3409. r = r prettify("languages-sl", getDisplay(il))
  3410. if (temp ~ /%S/)
  3411. r = r prettify("languages-sl", getName(il))
  3412. r = r prettify("languages", group[2])
  3413. if (temp ~ /%t/)
  3414. r = r prettify("languages-tl", getDisplay(tl))
  3415. if (temp ~ /%T/)
  3416. r = r prettify("languages-tl", getName(tl))
  3417. r = r prettify("languages", group[3])
  3418. }
  3419. if (wShowOriginalDictionary) {
  3420. if (exists(oWordClasses)) {
  3421. if (r) r = r RS
  3422. r = r m("-- display original dictionary (detailed explanations)")
  3423. for (i = 0; i < length(oWordClasses); i++) {
  3424. r = (i > 0 ? r RS : r) RS prettify("original-dictionary-detailed-word-class", s(oWordClasses[i], hl))
  3425. for (j = 0; j < length(oWords[i]); j++) {
  3426. explanation = oWords[i][j][0]
  3427. ref = oWords[i][j][1]
  3428. example = oWords[i][j][2]
  3429. r = (j > 0 ? r RS : r) RS prettify("original-dictionary-detailed-explanation", ins(1, explanation, il))
  3430. if (example)
  3431. r = r RS prettify("original-dictionary-detailed-example", ins(2, "- \"" example "\"", il))
  3432. if (ref && isarray(oRefs[ref])) {
  3433. temp = prettify("original-dictionary-detailed-synonyms", ins(1, show(showSynonyms(hl), hl) ": "))
  3434. temp = temp prettify("original-dictionary-detailed-synonyms-item", show(oSynonyms[oRefs[ref][1]][oRefs[ref][2]][0], il))
  3435. for (k = 1; k < length(oSynonyms[oRefs[ref][1]][oRefs[ref][2]]); k++)
  3436. temp = temp prettify("original-dictionary-detailed-synonyms", ", ")\
  3437. prettify("original-dictionary-detailed-synonyms-item", show(oSynonyms[oRefs[ref][1]][oRefs[ref][2]][k], il))
  3438. r = r RS temp
  3439. }
  3440. }
  3441. }
  3442. }
  3443. if (exists(oSynonymClasses)) {
  3444. r = r RS RS
  3445. r = r m("-- display original dictionary (synonyms)")
  3446. r = r prettify("original-dictionary-synonyms", s(showSynonyms(hl), hl))
  3447. for (i = 0; i < length(oSynonymClasses); i++) {
  3448. r = (i > 0 ? r RS : r) RS prettify("original-dictionary-synonyms-word-class", ins(1, oSynonymClasses[i], hl))
  3449. for (j = 0; j < length(oSynonyms[i]); j++) {
  3450. temp = prettify("original-dictionary-synonyms-synonyms", ins(2, "- "))
  3451. temp = temp prettify("original-dictionary-synonyms-synonyms-item", show(oSynonyms[i][j][0], il))
  3452. for (k = 1; k < length(oSynonyms[i][j]); k++)
  3453. temp = temp prettify("original-dictionary-synonyms-synonyms", ", ")\
  3454. prettify("original-dictionary-synonyms-synonyms-item", show(oSynonyms[i][j][k], il))
  3455. r = r RS temp
  3456. }
  3457. }
  3458. }
  3459. if (exists(oExamples)) {
  3460. r = r RS RS
  3461. r = r m("-- display original dictionary (examples)")
  3462. r = r prettify("original-dictionary-examples", s(showExamples(hl), hl))
  3463. for (i = 0; i < length(oExamples); i++) {
  3464. example = oExamples[i]
  3465. temp = prettify("original-dictionary-examples-example", ins(1, "- "))
  3466. split(example, group, /(<b>|<\/b>)/)
  3467. if (isRTL(il))
  3468. temp = temp show(group[1] group[2] group[3], il)
  3469. else
  3470. temp = temp prettify("original-dictionary-examples-example", group[1])\
  3471. prettify("original-dictionary-examples-original", group[2])\
  3472. prettify("original-dictionary-examples-example", group[3])
  3473. r = (i > 0 ? r RS : r) RS temp
  3474. }
  3475. }
  3476. if (exists(oSeeAlso)) {
  3477. r = r RS RS
  3478. r = r m("-- display original dictionary (see also)")
  3479. r = r prettify("original-dictionary-see-also", s(showSeeAlso(hl), hl))
  3480. temp = ins(1, prettify("original-dictionary-see-also-phrases-item", show(oSeeAlso[0], il)))
  3481. for (k = 1; k < length(oSeeAlso); k++)
  3482. temp = temp prettify("original-dictionary-see-also-phrases", ", ")\
  3483. prettify("original-dictionary-see-also-phrases-item", show(oSeeAlso[k], il))
  3484. r = r RS temp
  3485. }
  3486. }
  3487. if (wShowDictionary) {
  3488. if (r) r = r RS
  3489. r = r m("-- display dictionary entries")
  3490. for (i = 0; i < length(wordClasses); i++) {
  3491. r = (i > 0 ? r RS : r) RS prettify("dictionary-word-class", s(wordClasses[i], hl))
  3492. for (j = 0; j < length(words[i]); j++) {
  3493. word = words[i][j][0]
  3494. article = words[i][j][4]
  3495. if (isRTL(il))
  3496. explanation = join(words[i][j][1], ", ")
  3497. else {
  3498. explanation = prettify("dictionary-explanation-item", words[i][j][1][0])
  3499. for (k = 1; k < length(words[i][j][1]); k++)
  3500. explanation = explanation prettify("dictionary-explanation", ", ")\
  3501. prettify("dictionary-explanation-item", words[i][j][1][k])
  3502. }
  3503. r = r RS prettify("dictionary-word", ins(1, (article ? "(" article ") " : "") word, tl))
  3504. if (isRTL(il))
  3505. r = r RS prettify("dictionary-explanation-item", ins(2, explanation, il))
  3506. else
  3507. r = r RS ins(2, explanation)
  3508. }
  3509. }
  3510. }
  3511. if (wShowAlternatives) {
  3512. if (r) r = r RS RS
  3513. r = r m("-- display alternative translations")
  3514. for (i = 0; i < length(altTranslations); i++) {
  3515. r = (i > 0 ? r RS : r) prettify("alternatives-original", show(segments[i], il))
  3516. if (isRTL(tl)) {
  3517. temp = join(altTranslations[i], ", ")
  3518. r = r RS prettify("alternatives-translations-item", ins(1, temp, tl))
  3519. } else {
  3520. temp = prettify("alternatives-translations-item", altTranslations[i][0])
  3521. for (j = 1; j < length(altTranslations[i]); j++)
  3522. temp = temp prettify("alternatives-translations", ", ")\
  3523. prettify("alternatives-translations-item", altTranslations[i][j])
  3524. r = r RS ins(1, temp)
  3525. }
  3526. }
  3527. }
  3528. if (toSpeech) {
  3529. if (index(showTranslationsOf(hl, "%s"), "%s") > 2) {
  3530. returnPlaylist[0]["text"] = showTranslationsOf(hl)
  3531. returnPlaylist[0]["tl"] = hl
  3532. returnPlaylist[1]["text"] = join(original)
  3533. returnPlaylist[1]["tl"] = il
  3534. } else {
  3535. returnPlaylist[0]["text"] = join(original)
  3536. returnPlaylist[0]["tl"] = il
  3537. returnPlaylist[1]["text"] = showTranslationsOf(hl)
  3538. returnPlaylist[1]["tl"] = hl
  3539. }
  3540. returnPlaylist[2]["text"] = translation
  3541. returnPlaylist[2]["tl"] = tl
  3542. }
  3543. }
  3544. return r
  3545. }
  3546. BEGIN { provides("bing") }
  3547. function bingInit() {
  3548. HttpProtocol = "http://"
  3549. HttpHost = "www.bing.com"
  3550. HttpPort = 80
  3551. }
  3552. function bingSetCookie(    cookie, group, header, url) {
  3553. url = HttpPathPrefix "/translator"
  3554. header = "GET " url " HTTP/1.1\n"\
  3555. "Host: " HttpHost "\n"\
  3556. "Connection: close\n"
  3557. if (Option["user-agent"])
  3558. header = header "User-Agent: " Option["user-agent"] "\n"
  3559. cookie = NULLSTR
  3560. print header |& HttpService
  3561. while ((HttpService |& getline) > 0 && length($0) > 1) {
  3562. match($0, /Set-Cookie: ([^;]*);/, group)
  3563. if (group[1]) {
  3564. cookie = cookie (cookie ?  "; " : NULLSTR) group[1]
  3565. }
  3566. l(sprintf("%4s bytes > %s", length($0), length($0) < 1024 ? $0 : "..."))
  3567. }
  3568. close(HttpService)
  3569. Cookie = cookie
  3570. }
  3571. function bingTTSUrl(text, tl,
  3572. country, gender, i, group,
  3573. header, content, isBody) {
  3574. gender = "female"
  3575. country = NULLSTR
  3576. split(Option["narrator"], group, ",")
  3577. for (i in group) {
  3578. if (group[i] ~ /^(f(emale)?|w(oman)?)$/)
  3579. gender = "female"
  3580. else if (group[i] ~ /^m(ale|an)?$/)
  3581. gender = "male"
  3582. else
  3583. country = group[i]
  3584. }
  3585. if (country) tl = tl "-" country
  3586. else if (tl == "ar") tl = tl "-EG"
  3587. else if (tl == "da") tl = tl "-DK"
  3588. else if (tl == "de") tl = tl "-DE"
  3589. else if (tl == "en") tl = tl "-US"
  3590. else if (tl == "es") tl = tl "-ES"
  3591. else if (tl == "fi") tl = tl "-FI"
  3592. else if (tl == "fr") tl = tl "-FR"
  3593. else if (tl == "it") tl = tl "-IT"
  3594. else if (tl == "ja") tl = tl "-JP"
  3595. else if (tl == "ko") tl = tl "-KR"
  3596. else if (tl == "nl") tl = tl "-NL"
  3597. else if (tl == "nb") tl = tl "-NO"
  3598. else if (tl == "pl") tl = tl "-PL"
  3599. else if (tl == "pt") tl = tl "-PT"
  3600. else if (tl == "ru") tl = tl "-RU"
  3601. else if (tl == "sv") tl = tl "-SE"
  3602. else if (tl == "yue") ;
  3603. else if (tl == "zh") tl = tl "-CN"
  3604. header = "GET " "/translator/api/language/Speak?"\
  3605. "locale=" tl "&text=" preprocess(text)\
  3606. "&gender=" gender "&media=audio/mp3" " HTTP/1.1\n"\
  3607. "Host: " HttpHost "\n"\
  3608. "Connection: close\n"
  3609. if (Option["user-agent"])
  3610. header = header "User-Agent: " Option["user-agent"] "\n"
  3611. if (Cookie)
  3612. header = header "Cookie: " Cookie "\n"
  3613. content = NULLSTR; isBody = 0
  3614. print header |& HttpService
  3615. while ((HttpService |& getline) > 0) {
  3616. if (isBody)
  3617. content = content ? content "\n" $0 : $0
  3618. else if (length($0) <= 1)
  3619. isBody = 1
  3620. }
  3621. close(HttpService)
  3622. if (!TempFile)
  3623. TempFile = getOutput("mktemp")
  3624. printf("%s", content) > TempFile
  3625. close(TempFile)
  3626. return TempFile
  3627. }
  3628. function bingWebTranslateUrl(uri, sl, tl, hl) {
  3629. return "http://www.microsofttranslator.com/bv.aspx?"\
  3630. "from=" sl "&to=" tl "&a=" uri
  3631. }
  3632. function bingPost(text, sl, tl, hl,
  3633. content, contentLength, group,
  3634. header, isBody, reqBody, url) {
  3635. reqBody = "[{" parameterize("text") ":" parameterize(text, "\"") "}]"
  3636. if (DumpContentengths[reqBody])
  3637. contentLength = DumpContentengths[reqBody]
  3638. else
  3639. contentLength = DumpContentengths[reqBody] = dump(reqBody, group)
  3640. url = HttpPathPrefix "/translator/api/Translate/TranslateArray?"\
  3641. "from=" sl "&to=" tl
  3642. header = "POST " url " HTTP/1.1\n"\
  3643. "Host: " HttpHost "\n"\
  3644. "Connection: close\n"\
  3645. "Content-Length: " contentLength "\n"\
  3646. "Content-Type: application/json\n"
  3647. if (Option["user-agent"])
  3648. header = header "User-Agent: " Option["user-agent"] "\n"
  3649. if (Cookie)
  3650. header = header "Cookie: " Cookie "\n"
  3651. content = NULLSTR; isBody = 0
  3652. print (header "\n" reqBody) |& HttpService
  3653. while ((HttpService |& getline) > 0) {
  3654. if (isBody)
  3655. content = content ? content "\n" $0 : $0
  3656. else if (length($0) <= 1)
  3657. isBody = 1
  3658. l(sprintf("%4s bytes > %s", length($0), $0))
  3659. }
  3660. close(HttpService)
  3661. return assert(content, "[ERROR] Null response.")
  3662. }
  3663. function bingRequestUrl(text, sl, tl, hl) {
  3664. return HttpPathPrefix "/translator/api/Dictionary/Lookup?"\
  3665. "from=" sl "&to=" tl "&text=" preprocess(text)
  3666. }
  3667. function bingTranslate(text, sl, tl, hl,
  3668. isVerbose, toSpeech, returnPlaylist, returnIl,
  3669. r,
  3670. content, tokens, ast,
  3671. _sl, _tl, _hl, il,
  3672. translation,
  3673. wShowOriginal, wShowTranslation, wShowLanguages,
  3674. group, temp) {
  3675. if (!getCode(tl)) {
  3676. w("[WARNING] Unknown target language code: " tl)
  3677. } else if (isRTL(tl)) {
  3678. if (!FriBidi)
  3679. w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
  3680. }
  3681. _sl = getCode(sl); if (!_sl) _sl = sl
  3682. _tl = getCode(tl); if (!_tl) _tl = tl
  3683. _hl = getCode(hl); if (!_hl) _hl = hl
  3684. if (_sl == "auto")  _sl = "-"
  3685. if (_sl == "bs")    _sl = "bs-Latn"
  3686. if (_sl == "zh-CN") _sl = "zh-CHS"
  3687. if (_sl == "zh-TW") _sl = "zh-CHT"
  3688. if (_tl == "bs")    _tl = "bs-Latn"
  3689. if (_tl == "zh-CN") _tl = "zh-CHS"
  3690. if (_tl == "zh-TW") _tl = "zh-CHT"
  3691. bingSetCookie()
  3692. content = bingPost(text, _sl, _tl, _hl)
  3693. if (Option["dump"])
  3694. return content
  3695. tokenize(tokens, content)
  3696. parseJson(ast, tokens)
  3697. l(content, "content", 1, 1)
  3698. l(tokens, "tokens", 1, 0, 1)
  3699. l(ast, "ast")
  3700. if (!isarray(ast) || !anything(ast)) {
  3701. e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
  3702. ExitCode = 1
  3703. return
  3704. } else if (ast[0 SUBSEP "Message"]) {
  3705. e("[ERROR] " unparameterize(ast[0 SUBSEP "Message"]))
  3706. e("[ERROR] " unparameterize(ast[0 SUBSEP "Details" SUBSEP 0]))
  3707. ExitCode = 1
  3708. return
  3709. }
  3710. translation = unparameterize(ast[0 SUBSEP "items" SUBSEP 0 SUBSEP "text"])
  3711. returnIl[0] = il = unparameterize(ast[0 SUBSEP "from"])
  3712. if (Option["verbose"] < 0)
  3713. return getList(il)
  3714. if (!isVerbose) {
  3715. r = translation
  3716. } else {
  3717. wShowOriginal = Option["show-original"]
  3718. wShowTranslation = Option["show-translation"]
  3719. wShowLanguages = Option["show-languages"]
  3720. wShowDictionary = Option["show-dictionary"]
  3721. if (wShowOriginal) {
  3722. if (r) r = r RS RS
  3723. r = r m("-- display original text")
  3724. r = r prettify("original", s(text, il))
  3725. }
  3726. if (wShowTranslation) {
  3727. if (r) r = r RS RS
  3728. r = r m("-- display major translation")
  3729. r = r prettify("translation", s(translation, tl))
  3730. }
  3731. if (wShowLanguages) {
  3732. if (r) r = r RS RS
  3733. r = r m("-- display source language -> target language")
  3734. temp = Option["fmt-languages"]
  3735. if (!temp) temp = "[ %s -> %t ]"
  3736. split(temp, group, /(%s|%S|%t|%T)/)
  3737. r = r prettify("languages", group[1])
  3738. if (temp ~ /%s/)
  3739. r = r prettify("languages-sl", getDisplay(il))
  3740. if (temp ~ /%S/)
  3741. r = r prettify("languages-sl", getName(il))
  3742. r = r prettify("languages", group[2])
  3743. if (temp ~ /%t/)
  3744. r = r prettify("languages-tl", getDisplay(tl))
  3745. if (temp ~ /%T/)
  3746. r = r prettify("languages-tl", getName(tl))
  3747. r = r prettify("languages", group[3])
  3748. }
  3749. if (wShowDictionary && false) {
  3750. dicContent = getResponse(text, il, _tl, _hl)
  3751. tokenize(dicTokens, dicContent)
  3752. parseJson(dicAst, dicTokens)
  3753. if (anything(dicAst)) {
  3754. if (r) r = r RS
  3755. r = r m("-- display dictionary entries")
  3756. }
  3757. }
  3758. }
  3759. if (toSpeech) {
  3760. returnPlaylist[0]["text"] = translation
  3761. returnPlaylist[0]["tl"] = tl
  3762. }
  3763. return r
  3764. }
  3765. BEGIN { provides("yandex") }
  3766. function genSID(    content, group, temp) {
  3767. content = curl("http://translate.yandex.com")
  3768. match(content, /SID:[[:space:]]*'([^']+)'/, group)
  3769. if (group[1]) {
  3770. split(group[1], temp, ".")
  3771. SID = reverse(temp[1]) "." reverse(temp[2]) "." reverse(temp[3])
  3772. } else {
  3773. e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
  3774. exit 1
  3775. }
  3776. }
  3777. function yandexInit() {
  3778. genSID()
  3779. YandexWebTranslate = "z5h64q92x9.net"
  3780. HttpProtocol = "http://"
  3781. HttpHost = "translate.yandex.net"
  3782. HttpPort = 80
  3783. }
  3784. function yandexRequestUrl(text, sl, tl, hl,    group) {
  3785. split(sl, group, "-"); sl = group[1]
  3786. split(tl, group, "-"); tl = group[1]
  3787. return HttpPathPrefix "/api/v1/tr.json/translate?"\
  3788. "id=" SID "-0-0&srv=tr-text"\
  3789. "&text=" preprocess(text) "&lang=" (sl == "auto" ? tl : sl "-" tl)
  3790. }
  3791. function yandexGetDictionaryResponse(text, sl, tl, hl,    content, header, isBody, url) {
  3792. split(sl, group, "-"); sl = group[1]
  3793. split(tl, group, "-"); tl = group[1]
  3794. url = HttpPathPrefix "/dicservice.json/lookup?"\
  3795. "sid=" SID\
  3796. "&text=" preprocess(text) "&lang=" (sl == "auto" ? tl : sl "-" tl)
  3797. header = "GET " url " HTTP/1.1\n"\
  3798. "Host: " "dictionary.yandex.net" "\n"\
  3799. "Connection: close\n"
  3800. if (Option["user-agent"])
  3801. header = header "User-Agent: " Option["user-agent"] "\n"
  3802. content = NULLSTR; isBody = 0
  3803. print header |& HttpService
  3804. while ((HttpService |& getline) > 0) {
  3805. if (isBody)
  3806. content = content ? content "\n" $0 : $0
  3807. else if (length($0) <= 1)
  3808. isBody = 1
  3809. l(sprintf("%4s bytes > %s", length($0), $0))
  3810. }
  3811. close(HttpService)
  3812. return assert(content, "[ERROR] Null response.")
  3813. }
  3814. function yandexTTSUrl(text, tl,
  3815. speaker, emotion, i, group) {
  3816. speaker = NULLSTR
  3817. emotion = NULLSTR
  3818. split(Option["narrator"], group, ",")
  3819. for (i in group) {
  3820. if (group[i] ~ /^(g(ood)?|n(eutral)?|e(vil)?)$/)
  3821. emotion = group[i]
  3822. else if (group[i] ~ /^(f(emale)?|w(oman)?)$/)
  3823. speaker = "alyss"
  3824. else if (group[i] ~ /^m(ale|an)?$/)
  3825. speaker = "zahar"
  3826. else
  3827. speaker = group[i]
  3828. }
  3829. switch (tl) {
  3830. case "ar": tl = "ar_AE"; break
  3831. case "cs": tl = "cs_CZ"; break
  3832. case "da": tl = "da_DK"; break
  3833. case "de": tl = "de_DE"; break
  3834. case "el": tl = "el_GR"; break
  3835. case "en": tl = "en_GB"; break
  3836. case "es": tl = "es_ES"; break
  3837. case "fi": tl = "fi_FI"; break
  3838. case "fr": tl = "fr_FR"; break
  3839. case "it": tl = "it_IT"; break
  3840. case "nl": tl = "nl_NL"; break
  3841. case "no": tl = "no_NO"; break
  3842. case "pl": tl = "pl_PL"; break
  3843. case "pt": tl = "pt_PT"; break
  3844. case "ru": tl = "ru_RU"; break
  3845. case "sv": tl = "sv_SE"; break
  3846. case "tr": tl = "tr_TR"; break
  3847. default: tl = NULLSTR
  3848. }
  3849. return HttpProtocol "tts.voicetech.yandex.net" "/tts?"\
  3850. "text=" preprocess(text) (tl ? "&lang=" tl : tl)\
  3851. (speaker ? "&speaker=" speaker : speaker)\
  3852. (emotion ? "&emotion=" emotion : emotion)\
  3853. "&format=mp3" "&quality=hi"
  3854. }
  3855. function yandexWebTranslateUrl(uri, sl, tl, hl) {
  3856. gsub(/:\/\//, "/", uri)
  3857. return HttpProtocol YandexWebTranslate "/proxy_u/"\
  3858. (sl == "auto" ? tl : sl "-" tl)"/" uri
  3859. }
  3860. function yandexTranslate(text, sl, tl, hl,
  3861. isVerbose, toSpeech, returnPlaylist, returnIl,
  3862. r,
  3863. content, tokens, ast,
  3864. _sl, _tl, _hl, il,
  3865. translation,
  3866. wShowOriginal, wShowTranslation, wShowLanguages,
  3867. wShowDictionary, dicContent, dicTokens, dicAst,
  3868. i, syn, mean,
  3869. group, temp) {
  3870. if (!getCode(tl)) {
  3871. w("[WARNING] Unknown target language code: " tl)
  3872. } else if (isRTL(tl)) {
  3873. if (!FriBidi)
  3874. w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
  3875. }
  3876. _sl = getCode(sl); if (!_sl) _sl = sl
  3877. _tl = getCode(tl); if (!_tl) _tl = tl
  3878. _hl = getCode(hl); if (!_hl) _hl = hl
  3879. content = getResponse(text, _sl, _tl, _hl)
  3880. if (Option["dump"])
  3881. return content
  3882. tokenize(tokens, content)
  3883. parseJson(ast, tokens)
  3884. l(content, "content", 1, 1)
  3885. l(tokens, "tokens", 1, 0, 1)
  3886. l(ast, "ast")
  3887. if (!isarray(ast) || !anything(ast)) {
  3888. e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
  3889. ExitCode = 1
  3890. return
  3891. }
  3892. if (ast[0 SUBSEP "code"] != "200") {
  3893. e("[ERROR] " unparameterize(ast[0 SUBSEP "message"]))
  3894. ExitCode = 1
  3895. return
  3896. }
  3897. translation = unparameterize(ast[0 SUBSEP "text" SUBSEP 0])
  3898. split(unparameterize(ast[0 SUBSEP "lang"]), group, "-")
  3899. returnIl[0] = il = group[1]
  3900. if (Option["verbose"] < 0)
  3901. return getList(il)
  3902. if (!isVerbose) {
  3903. r = translation
  3904. } else {
  3905. wShowOriginal = Option["show-original"]
  3906. wShowTranslation = Option["show-translation"]
  3907. wShowLanguages = Option["show-languages"]
  3908. wShowDictionary = Option["show-dictionary"]
  3909. if (wShowOriginal) {
  3910. if (r) r = r RS RS
  3911. r = r m("-- display original text")
  3912. r = r prettify("original", s(text, il))
  3913. }
  3914. if (wShowTranslation) {
  3915. if (r) r = r RS RS
  3916. r = r m("-- display major translation")
  3917. r = r prettify("translation", s(translation, tl))
  3918. }
  3919. if (wShowLanguages) {
  3920. if (r) r = r RS RS
  3921. r = r m("-- display source language -> target language")
  3922. temp = Option["fmt-languages"]
  3923. if (!temp) temp = "[ %s -> %t ]"
  3924. split(temp, group, /(%s|%S|%t|%T)/)
  3925. r = r prettify("languages", group[1])
  3926. if (temp ~ /%s/)
  3927. r = r prettify("languages-sl", getDisplay(il))
  3928. if (temp ~ /%S/)
  3929. r = r prettify("languages-sl", getName(il))
  3930. r = r prettify("languages", group[2])
  3931. if (temp ~ /%t/)
  3932. r = r prettify("languages-tl", getDisplay(tl))
  3933. if (temp ~ /%T/)
  3934. r = r prettify("languages-tl", getName(tl))
  3935. r = r prettify("languages", group[3])
  3936. }
  3937. if (wShowDictionary) {
  3938. dicContent = yandexGetDictionaryResponse(text, _sl, _tl, _hl)
  3939. tokenize(dicTokens, dicContent)
  3940. parseJson(dicAst, dicTokens)
  3941. if (anything(dicAst)) {
  3942. if (r) r = r RS
  3943. r = r m("-- display dictionary entries")
  3944. saveSortedIn = PROCINFO["sorted_in"]
  3945. PROCINFO["sorted_in"] = "@ind_num_asc"
  3946. for (i in dicAst) {
  3947. if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
  3948. "pos$") {
  3949. r = r RS prettify("dictionary-word-class", s((literal(dicAst[i])), hl))
  3950. syn = mean = ""
  3951. }
  3952. if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
  3953. "tr" SUBSEP "[[:digit:]]+" SUBSEP\
  3954. "mean" SUBSEP "[[:digit:]]+" SUBSEP "text") {
  3955. if (mean) {
  3956. mean = mean prettify("dictionary-explanation", ", ")\
  3957. prettify("dictionary-explanation-item", s((literal(dicAst[i])), sl))
  3958. } else {
  3959. mean = prettify("dictionary-explanation-item", s((literal(dicAst[i])), sl))
  3960. }
  3961. }
  3962. if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
  3963. "tr" SUBSEP "[[:digit:]]+" SUBSEP\
  3964. "syn" SUBSEP "[[:digit:]]+" SUBSEP "text") {
  3965. if (syn) {
  3966. syn = syn prettify("dictionary-explanation", ", ")\
  3967. prettify("dictionary-word", s((literal(dicAst[i])), il))
  3968. } else {
  3969. syn = prettify("dictionary-word", s((literal(dicAst[i])), il))
  3970. }
  3971. }
  3972. if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
  3973. "tr" SUBSEP "[[:digit:]]+" SUBSEP "text$") {
  3974. text = prettify("dictionary-word", s((literal(dicAst[i])), il))
  3975. if (syn) {
  3976. r = r RS ins(1, text prettify("dictionary-explanation", ", ") syn)
  3977. } else {
  3978. r = r RS ins(1, text)
  3979. }
  3980. r = r RS ins(2, mean)
  3981. syn = mean = ""
  3982. }
  3983. }
  3984. PROCINFO["sorted_in"] = saveSortedIn
  3985. }
  3986. }
  3987. }
  3988. if (toSpeech) {
  3989. returnPlaylist[0]["text"] = translation
  3990. returnPlaylist[0]["tl"] = tl
  3991. }
  3992. return r
  3993. }
  3994. BEGIN { provides("apertium") }
  3995. function apertiumInit() {
  3996. HttpProtocol = "http://"
  3997. HttpHost = "www.apertium.org"
  3998. HttpPort = 80
  3999. }
  4000. function apertiumRequestUrl(text, sl, tl, hl) {
  4001. return HttpPathPrefix "/apy/translate?"\
  4002. "langpair=" preprocess(sl) "|" preprocess(tl)\
  4003. "&q=" preprocess(text)
  4004. }
  4005. function apertiumTTSUrl(text, tl,    narrator) {
  4006. }
  4007. function apertiumWebTranslateUrl(uri, sl, tl, hl) {
  4008. }
  4009. function apertiumTranslate(text, sl, tl, hl,
  4010. isVerbose, toSpeech, returnPlaylist, returnIl,
  4011. r,
  4012. content, tokens, ast,
  4013. _sl, _tl, _hl, il,
  4014. translation,
  4015. wShowOriginal, wShowTranslation, wShowLanguages,
  4016. group, temp) {
  4017. if (!getCode(tl)) {
  4018. w("[WARNING] Unknown target language code: " tl)
  4019. } else if (isRTL(tl)) {
  4020. if (!FriBidi)
  4021. w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
  4022. }
  4023. _sl = getCode(sl); if (!_sl) _sl = sl
  4024. _tl = getCode(tl); if (!_tl) _tl = tl
  4025. _hl = getCode(hl); if (!_hl) _hl = hl
  4026. _sl = "auto" == _sl ? "en" : _sl
  4027. content = getResponse(text, _sl, _tl, _hl)
  4028. if (Option["dump"])
  4029. return content
  4030. tokenize(tokens, content)
  4031. parseJson(ast, tokens)
  4032. l(content, "content", 1, 1)
  4033. l(tokens, "tokens", 1, 0, 1)
  4034. l(ast, "ast")
  4035. if (!isarray(ast) || !anything(ast)) {
  4036. e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
  4037. ExitCode = 1
  4038. return
  4039. }
  4040. translation = uprintf(unquote(unparameterize(ast[0 SUBSEP "responseData" SUBSEP "translatedText"])))
  4041. returnIl[0] = il = _sl
  4042. if (Option["verbose"] < 0)
  4043. return getList(il)
  4044. if (!isVerbose) {
  4045. r = translation
  4046. } else {
  4047. wShowOriginal = Option["show-original"]
  4048. wShowTranslation = Option["show-translation"]
  4049. wShowLanguages = Option["show-languages"]
  4050. if (wShowOriginal) {
  4051. if (r) r = r RS RS
  4052. r = r m("-- display original text")
  4053. r = r prettify("original", s(text, il))
  4054. }
  4055. if (wShowTranslation) {
  4056. if (r) r = r RS RS
  4057. r = r m("-- display major translation")
  4058. r = r prettify("translation", s(translation, tl))
  4059. }
  4060. if (wShowLanguages) {
  4061. if (r) r = r RS RS
  4062. r = r m("-- display source language -> target language")
  4063. temp = Option["fmt-languages"]
  4064. if (!temp) temp = "[ %s -> %t ]"
  4065. split(temp, group, /(%s|%S|%t|%T)/)
  4066. r = r prettify("languages", group[1])
  4067. if (temp ~ /%s/)
  4068. r = r prettify("languages-sl", getDisplay(il))
  4069. if (temp ~ /%S/)
  4070. r = r prettify("languages-sl", getName(il))
  4071. r = r prettify("languages", group[2])
  4072. if (temp ~ /%t/)
  4073. r = r prettify("languages-tl", getDisplay(tl))
  4074. if (temp ~ /%T/)
  4075. r = r prettify("languages-tl", getName(tl))
  4076. r = r prettify("languages", group[3])
  4077. }
  4078. }
  4079. if (toSpeech) {
  4080. returnPlaylist[0]["text"] = translation
  4081. returnPlaylist[0]["tl"] = tl
  4082. }
  4083. return r
  4084. }
  4085. BEGIN {
  4086. provides("spell")
  4087. provides("aspell")
  4088. provides("hunspell")
  4089. }
  4090. function spellInit() {
  4091. Ispell = detectProgram("aspell", "--version") ? "aspell" :
  4092. (detectProgram("hunspell", "--version") ? "hunspell" : "")
  4093. if (!Ispell) {
  4094. e("[ERROR] Spell checker (aspell or hunspell) not found.")
  4095. exit 1
  4096. }
  4097. }
  4098. function aspellInit() {
  4099. if (!(Ispell = detectProgram("aspell", "--version") ? "aspell" : "")) {
  4100. e("[ERROR] Spell checker (aspell) not found.")
  4101. exit 1
  4102. }
  4103. }
  4104. function hunspellInit() {
  4105. if (!(Ispell = detectProgram("hunspell", "--version") ? "hunspell" : "")) {
  4106. e("[ERROR] Spell checker (hunspell) not found.")
  4107. exit 1
  4108. }
  4109. }
  4110. function spellTranslate(text, sl, tl, hl,
  4111. isVerbose, toSpeech, returnPlaylist, returnIl,
  4112. args, i, j, r, line, group, word, sug) {
  4113. args = " -a" (sl != "auto" ? " -d " sl : "")
  4114. if (system("echo" PIPE Ispell args SUPOUT SUPERR)) {
  4115. e("[ERROR] No dictionary for language: " sl)
  4116. exit 1
  4117. }
  4118. i = 1
  4119. r = ""
  4120. while ((("echo " parameterize(text) PIPE Ispell args SUPERR) |& getline line) > 0) {
  4121. match(line,
  4122. /^& (.*) [[:digit:]]+ [[:digit:]]+: ([^,]+)(, ([^,]+))?(, ([^,]+))?/,
  4123. group)
  4124. if (RSTART) {
  4125. ExitCode = 1
  4126. word = group[1]
  4127. sug = "[" group[2]
  4128. if (group[4]) sug = sug "|" group[4]
  4129. if (group[6]) sug = sug "|" group[6]
  4130. sug = sug "]"
  4131. j = i + index(substr(text, i), word) - 1
  4132. r = r substr(text, i, j - i)
  4133. r = r ansi("bold", ansi("red", word)) ansi("yellow", sug)
  4134. i = j + length(word)
  4135. }
  4136. }
  4137. r = r substr(text, i)
  4138. return r
  4139. }
  4140. function aspellTranslate(text, sl, tl, hl,
  4141. isVerbose, toSpeech, returnPlaylist, returnIl) {
  4142. return spellTranslate(text, sl, tl, hl)
  4143. }
  4144. function hunspellTranslate(text, sl, tl, hl,
  4145. isVerbose, toSpeech, returnPlaylist, returnIl) {
  4146. return spellTranslate(text, sl, tl, hl)
  4147. }
  4148. BEGIN { provides("deepl") }
  4149. function deeplInit() {
  4150. HttpProtocol = "http://"
  4151. HttpHost = "www.deepl.com"
  4152. HttpPort = 80
  4153. }
  4154. function deeplRequestUrl(text, sl, tl, hl) {
  4155. }
  4156. function deeplTTSUrl(text, tl,    narrator) {
  4157. }
  4158. function deeplWebTranslateUrl(uri, sl, tl, hl) {
  4159. }
  4160. function deeplPost(text, sl, tl, hl,
  4161. content, data, url) {
  4162. data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_handle_jobs\","
  4163. data = data "\"params\":{\"jobs\":[{\"kind\":\"default\","
  4164. data = data "\"raw_en_sentence\":" parameterize(text, "\"") "}],"
  4165. data = data "\"lang\":{\"user_preferred_langs\":[\"" hl "\"],"
  4166. data = data "\"source_lang_user_selected\":\"" sl "\","
  4167. data = data "\"target_lang\":\"" tl "\"},"
  4168. data = data "\"priority\":1},\"id\":1}"
  4169. l(data)
  4170. url = "https://www.deepl.com/jsonrpc"
  4171. content = curlPost(url, data)
  4172. return assert(content, "[ERROR] Null response.")
  4173. }
  4174. function deeplTranslate(text, sl, tl, hl,
  4175. isVerbose, toSpeech, returnPlaylist, returnIl,
  4176. r,
  4177. content, tokens, ast,
  4178. _sl, _tl, _hl, il,
  4179. translation, translations,
  4180. wShowOriginal, wShowTranslation,
  4181. wShowLanguages, wShowAlternatives,
  4182. group, temp) {
  4183. if (!getCode(tl)) {
  4184. w("[WARNING] Unknown target language code: " tl)
  4185. } else if (isRTL(tl)) {
  4186. if (!FriBidi)
  4187. w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
  4188. }
  4189. _sl = getCode(sl); if (!_sl) _sl = sl
  4190. _tl = getCode(tl); if (!_tl) _tl = tl
  4191. _hl = getCode(hl); if (!_hl) _hl = hl
  4192. if (_sl != "auto") _sl = toupper(_sl)
  4193. if (_tl != "auto") _tl = toupper(_tl)
  4194. if (_hl != "auto") _hl = toupper(_hl)
  4195. content = deeplPost(text, _sl, _tl, _hl)
  4196. if (Option["dump"])
  4197. return content
  4198. tokenize(tokens, content)
  4199. parseJson(ast, tokens)
  4200. l(content, "content", 1, 1)
  4201. l(tokens, "tokens", 1, 0, 1)
  4202. l(ast, "ast")
  4203. if (!isarray(ast) || !anything(ast)) {
  4204. e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
  4205. ExitCode = 1
  4206. return
  4207. }
  4208. saveSortedIn = PROCINFO["sorted_in"]
  4209. PROCINFO["sorted_in"] = "compareByIndexFields"
  4210. for (i in ast) {
  4211. if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP 0 SUBSEP "beams" SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") {
  4212. append(translations, uprintf(unquote(unparameterize(ast[i]))))
  4213. }
  4214. }
  4215. PROCINFO["sorted_in"] = saveSortedIn
  4216. translation = translations[0]
  4217. returnIl[0] = il = tolower(unparameterize(ast[0 SUBSEP "result" SUBSEP "source_lang"]))
  4218. if (Option["verbose"] < 0)
  4219. return getList(il)
  4220. if (!isVerbose) {
  4221. r = translation
  4222. } else {
  4223. wShowOriginal = Option["show-original"]
  4224. wShowTranslation = Option["show-translation"]
  4225. wShowLanguages = Option["show-languages"]
  4226. wShowAlternatives = Option["show-alternatives"]
  4227. if (length(translations) <= 1) wShowAlternatives = 0
  4228. if (wShowOriginal) {
  4229. if (r) r = r RS RS
  4230. r = r m("-- display original text")
  4231. r = r prettify("original", s(text, il))
  4232. }
  4233. if (wShowTranslation) {
  4234. if (r) r = r RS RS
  4235. r = r m("-- display major translation")
  4236. r = r prettify("translation", s(translation, tl))
  4237. }
  4238. if (wShowLanguages) {
  4239. if (r) r = r RS RS
  4240. r = r m("-- display source language -> target language")
  4241. temp = Option["fmt-languages"]
  4242. if (!temp) temp = "[ %s -> %t ]"
  4243. split(temp, group, /(%s|%S|%t|%T)/)
  4244. r = r prettify("languages", group[1])
  4245. if (temp ~ /%s/)
  4246. r = r prettify("languages-sl", getDisplay(il))
  4247. if (temp ~ /%S/)
  4248. r = r prettify("languages-sl", getName(il))
  4249. r = r prettify("languages", group[2])
  4250. if (temp ~ /%t/)
  4251. r = r prettify("languages-tl", getDisplay(tl))
  4252. if (temp ~ /%T/)
  4253. r = r prettify("languages-tl", getName(tl))
  4254. r = r prettify("languages", group[3])
  4255. }
  4256. if (wShowAlternatives) {
  4257. if (r) r = r RS
  4258. r = r m("-- display alternative translations")
  4259. r = r RS ins(1, prettify("alternatives-translations-item", translations[1]))
  4260. for (i = 2; i < length(translations); i++)
  4261. r = r RS ins(1, prettify("alternatives-translations-item", translations[i]))
  4262. }
  4263. }
  4264. if (toSpeech) {
  4265. returnPlaylist[0]["text"] = translation
  4266. returnPlaylist[0]["tl"] = tl
  4267. }
  4268. return r
  4269. }
  4270. function loadOptions(script,    i, j, tokens, name, value) {
  4271. tokenize(tokens, script)
  4272. for (i in tokens) {
  4273. if (tokens[i] ~ /^:/) {
  4274. name = substr(tokens[i], 2)
  4275. value = tokens[i + 1]
  4276. if (value ~ /^[+-]?((0|[1-9][0-9]*)|[.][0-9]*|(0|[1-9][0-9]*)[.][0-9]*)([Ee][+-]?[0-9]+)?$/) {
  4277. delete Option[name]
  4278. Option[name] = value
  4279. } else if (value == "false" || value == "true") {
  4280. delete Option[name]
  4281. Option[name] = yn(value)
  4282. } else if (value ~ /^".*"$/) {
  4283. delete Option[name]
  4284. Option[name] = literal(value)
  4285. } else if (value == "[") {
  4286. delete Option[name]
  4287. for (j = 1; tokens[i + j + 1] && tokens[i + j + 1] != "]"; j++) {
  4288. if (tokens[i + j + 1] ~ /^".*"$/)
  4289. Option[name][j] = literal(tokens[i + j + 1])
  4290. else {
  4291. e("[ERROR] Malformed configuration.")
  4292. return
  4293. }
  4294. }
  4295. } else {
  4296. e("[ERROR] Malformed configuration.")
  4297. return
  4298. }
  4299. }
  4300. }
  4301. }
  4302. function upgrade(    i, newVersion, registry, tokens) {
  4303. RegistryIndex = "https://raw.githubusercontent.com/soimort/translate-shell/registry/index.trans"
  4304. registry = curl(RegistryIndex)
  4305. if (!registry) {
  4306. e("[ERROR] Failed to check for upgrade.")
  4307. ExitCode = 1
  4308. return
  4309. }
  4310. tokenize(tokens, registry)
  4311. for (i in tokens)
  4312. if (tokens[i] == ":translate-shell")
  4313. newVersion = literal(tokens[i + 1])
  4314. if (newerVersion(newVersion, Version)) {
  4315. w("Current version: \t" Version)
  4316. w("New version available: \t" newVersion)
  4317. w("Download from: \t" "https://www.soimort.org/translate-shell/trans")
  4318. } else {
  4319. w("Current version: \t" Version)
  4320. w("Already up-to-date.")
  4321. }
  4322. }
  4323. function welcome() {
  4324. if (Option["fmt-welcome-message"])
  4325. print prettify("welcome-message", Option["fmt-welcome-message"]) > STDERR
  4326. if (Option["fmt-welcome-submessage"])
  4327. print prettify("welcome-submessage", Option["fmt-welcome-submessage"]) > STDERR
  4328. }
  4329. function prompt(    i, p, temp) {
  4330. p = Option["fmt-prompt"]
  4331. if (p ~ /%a/) gsub(/%a/, strftime("%a"), p)
  4332. if (p ~ /%A/) gsub(/%A/, strftime("%A"), p)
  4333. if (p ~ /%b/) gsub(/%b/, strftime("%b"), p)
  4334. if (p ~ /%B/) gsub(/%B/, strftime("%B"), p)
  4335. if (p ~ /%c/) gsub(/%c/, strftime("%c"), p)
  4336. if (p ~ /%C/) gsub(/%C/, strftime("%C"), p)
  4337. if (p ~ /%d/) gsub(/%d/, strftime("%d"), p)
  4338. if (p ~ /%D/) gsub(/%D/, strftime("%D"), p)
  4339. if (p ~ /%e/) gsub(/%e/, strftime("%e"), p)
  4340. if (p ~ /%F/) gsub(/%F/, strftime("%F"), p)
  4341. if (p ~ /%g/) gsub(/%g/, strftime("%g"), p)
  4342. if (p ~ /%G/) gsub(/%G/, strftime("%G"), p)
  4343. if (p ~ /%h/) gsub(/%h/, strftime("%h"), p)
  4344. if (p ~ /%H/) gsub(/%H/, strftime("%H"), p)
  4345. if (p ~ /%I/) gsub(/%I/, strftime("%I"), p)
  4346. if (p ~ /%j/) gsub(/%j/, strftime("%j"), p)
  4347. if (p ~ /%m/) gsub(/%m/, strftime("%m"), p)
  4348. if (p ~ /%M/) gsub(/%M/, strftime("%M"), p)
  4349. if (p ~ /%n/) gsub(/%n/, strftime("%n"), p)
  4350. if (p ~ /%p/) gsub(/%p/, strftime("%p"), p)
  4351. if (p ~ /%r/) gsub(/%r/, strftime("%r"), p)
  4352. if (p ~ /%R/) gsub(/%R/, strftime("%R"), p)
  4353. if (p ~ /%u/) gsub(/%u/, strftime("%u"), p)
  4354. if (p ~ /%U/) gsub(/%U/, strftime("%U"), p)
  4355. if (p ~ /%V/) gsub(/%V/, strftime("%V"), p)
  4356. if (p ~ /%w/) gsub(/%w/, strftime("%w"), p)
  4357. if (p ~ /%W/) gsub(/%W/, strftime("%W"), p)
  4358. if (p ~ /%x/) gsub(/%x/, strftime("%x"), p)
  4359. if (p ~ /%X/) gsub(/%X/, strftime("%X"), p)
  4360. if (p ~ /%y/) gsub(/%y/, strftime("%y"), p)
  4361. if (p ~ /%Y/) gsub(/%Y/, strftime("%Y"), p)
  4362. if (p ~ /%z/) gsub(/%z/, strftime("%z"), p)
  4363. if (p ~ /%Z/) gsub(/%Z/, strftime("%Z"), p)
  4364. if (p ~ /%_/)
  4365. gsub(/%_/, showTranslationsOf(Option["hl"]), p)
  4366. if (p ~ /%l/)
  4367. gsub(/%l/, getDisplay(Option["hl"]), p)
  4368. if (p ~ /%L/)
  4369. gsub(/%L/, getName(Option["hl"]), p)
  4370. if (p ~ /%S/)
  4371. gsub(/%S/, getName(Option["sl"]), p)
  4372. if (p ~ /%t/) {
  4373. temp = getDisplay(Option["tl"][1])
  4374. for (i = 2; i <= length(Option["tl"]); i++)
  4375. temp = temp "+" getDisplay(Option["tl"][i])
  4376. gsub(/%t/, temp, p)
  4377. }
  4378. if (p ~ /%T/) {
  4379. temp = getName(Option["tl"][1])
  4380. for (i = 2; i <= length(Option["tl"]); i++)
  4381. temp = temp "+" getName(Option["tl"][i])
  4382. gsub(/%T/, temp, p)
  4383. }
  4384. if (p ~ /%,/) {
  4385. temp = getDisplay(Option["tl"][1])
  4386. for (i = 2; i <= length(Option["tl"]); i++)
  4387. temp = temp "," getDisplay(Option["tl"][i])
  4388. gsub(/%,/, temp, p)
  4389. }
  4390. if (p ~ /%</) {
  4391. temp = getName(Option["tl"][1])
  4392. for (i = 2; i <= length(Option["tl"]); i++)
  4393. temp = temp "," getName(Option["tl"][i])
  4394. gsub(/%</, temp, p)
  4395. }
  4396. if (p ~ /%\//) {
  4397. temp = getDisplay(Option["tl"][1])
  4398. for (i = 2; i <= length(Option["tl"]); i++)
  4399. temp = temp "/" getDisplay(Option["tl"][i])
  4400. gsub(/%\//, temp, p)
  4401. }
  4402. if (p ~ /%\?/) {
  4403. temp = getName(Option["tl"][1])
  4404. for (i = 2; i <= length(Option["tl"]); i++)
  4405. temp = temp "/" getName(Option["tl"][i])
  4406. gsub(/%\?/, temp, p)
  4407. }
  4408. printf(prettify("prompt", p), getDisplay(Option["sl"])) > STDERR
  4409. }
  4410. function repl(line,    command, group, name, i, value, words) {
  4411. split(line, words, " ")
  4412. command = words[1]
  4413. if (command ~ /^:(q|quit)$/) {
  4414. exit
  4415. } else if (command ~ /^:set$/) {
  4416. name = words[2]
  4417. value = words[3]
  4418. Option[name] = value
  4419. } else if (command ~ /^:show$/) {
  4420. name = words[2]
  4421. print prettify("welcome-submessage", toString(Option[name], 1, 0, 1))
  4422. } else if (command ~ /^:engine$/) {
  4423. value = words[2]
  4424. Option["engine"] = value
  4425. initHttpService()
  4426. } else {
  4427. match(command, /^[{(\[]?([[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group)
  4428. if (RSTART) {
  4429. if (group[1]) Option["sl"] = group[1]
  4430. if (group[4]) split(group[4], Option["tl"], "+")
  4431. line = words[2]
  4432. for (i = 3; i <= length(words); i++)
  4433. line = line " " words[i]
  4434. }
  4435. if (line) {
  4436. translate(line)
  4437. if (Option["verbose"]) printf RS
  4438. }
  4439. }
  4440. prompt()
  4441. }
  4442. function init() {
  4443. initGawk()
  4444. initBiDi()
  4445. initLocale()
  4446. initUserLang()
  4447. RS = "\n"
  4448. ExitCode = 0
  4449. Option["debug"] = 0
  4450. Option["engine"] = "google"
  4451. Option["verbose"] = 1
  4452. Option["show-original"] = 1
  4453. Option["show-original-phonetics"] = 1
  4454. Option["show-translation"] = 1
  4455. Option["show-translation-phonetics"] = 1
  4456. Option["show-prompt-message"] = 1
  4457. Option["show-languages"] = 1
  4458. Option["show-original-dictionary"] = 0
  4459. Option["show-dictionary"] = 1
  4460. Option["show-alternatives"] = 1
  4461. Option["width"] = ENVIRON["COLUMNS"] ? ENVIRON["COLUMNS"] - 2 : 0
  4462. Option["indent"] = 4
  4463. Option["no-ansi"] = 0
  4464. Option["no-autocorrect"] = 0
  4465. Option["no-bidi"] = 0
  4466. Option["no-warn"] = 0
  4467. Option["theme"] = "default"
  4468. Option["dump"] = 0
  4469. Option["play"] = 0
  4470. Option["narrator"] = "female"
  4471. Option["player"] = ENVIRON["PLAYER"]
  4472. Option["no-translate"] = 0
  4473. Option["download-audio"] = 0
  4474. Option["download-audio-as"] = NULLSTR
  4475. Option["view"] = 0
  4476. Option["pager"] = ENVIRON["PAGER"]
  4477. Option["browser"] = ENVIRON["BROWSER"]
  4478. Option["proxy"] = ENVIRON["HTTP_PROXY"] ? ENVIRON["HTTP_PROXY"] : ENVIRON["http_proxy"]
  4479. Option["user-agent"] = ENVIRON["USER_AGENT"] ? ENVIRON["USER_AGENT"] :
  4480. "Mozilla/5.0 (X11; Linux x86_64) "\
  4481. "AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 "\
  4482. "Safari/602.1 Epiphany/3.18.2"
  4483. Option["no-rlwrap"] = 0
  4484. Option["interactive"] = 0
  4485. Option["emacs"] = 0
  4486. Option["input"] = NULLSTR
  4487. Option["output"] = STDOUT
  4488. Option["hl"] = ENVIRON["HOME_LANG"] ? ENVIRON["HOME_LANG"] : UserLang
  4489. Option["sl"] = ENVIRON["SOURCE_LANG"] ? ENVIRON["SOURCE_LANG"] : "auto"
  4490. Option["tl"][1] = ENVIRON["TARGET_LANG"] ? ENVIRON["TARGET_LANG"] : UserLang
  4491. }
  4492. function initScript(    file, line, script, temp) {
  4493. file = ".trans"
  4494. if (!fileExists(file)) {
  4495. file = ENVIRON["HOME"] "/.translate-shell/init.trans"
  4496. if (!fileExists(file)) {
  4497. file = ENVIRON["XDG_CONFIG_HOME"] "/translate-shell/init.trans"
  4498. if (!fileExists(file)) {
  4499. file = ENVIRON["HOME"] "/.config/translate-shell/init.trans"
  4500. if (!fileExists(file)) {
  4501. file = "/etc/translate-shell"
  4502. if (!fileExists(file)) return
  4503. }
  4504. }
  4505. }
  4506. }
  4507. InitScript = file
  4508. script = NULLSTR
  4509. while (getline line < InitScript)
  4510. script = script "\n" line
  4511. loadOptions(script)
  4512. if (!isarray(Option["tl"])) {
  4513. temp = Option["tl"]
  4514. delete Option["tl"]
  4515. Option["tl"][1] = temp
  4516. }
  4517. }
  4518. function initMisc(    group, temp) {
  4519. initHttpService()
  4520. if (!Option["width"] && detectProgram("tput", "-V")) {
  4521. "tput cols" SUPERR | getline temp
  4522. Option["width"] = temp ? temp - 2 : 64
  4523. }
  4524. if (Option["no-ansi"])
  4525. delete AnsiCode
  4526. if (Option["no-bidi"])
  4527. BiDi = BiDiNoPad = NULLSTR
  4528. if (Option["no-warn"])
  4529. STDERR = "/dev/null"
  4530. if (Option["play"]) {
  4531. if (!Option["player"]) {
  4532. initAudioPlayer()
  4533. Option["player"] = AudioPlayer ? AudioPlayer : Option["player"]
  4534. if (!Option["player"])
  4535. initSpeechSynthesizer()
  4536. }
  4537. if (!Option["player"] && !SpeechSynthesizer) {
  4538. w("[WARNING] No available audio player or speech synthesizer.")
  4539. Option["play"] = 0
  4540. }
  4541. }
  4542. if (Option["view"]) {
  4543. if (!Option["pager"]) {
  4544. initPager()
  4545. Option["pager"] = Pager
  4546. }
  4547. if (!Option["pager"]) {
  4548. w("[WARNING] No available terminal pager.")
  4549. Option["view"] = 0
  4550. }
  4551. }
  4552. if (!Option["browser"]) {
  4553. "xdg-mime query default text/html" SUPERR | getline Option["browser"]
  4554. match(Option["browser"], "(.*).desktop$", group)
  4555. Option["browser"] = group[1]
  4556. }
  4557. }
  4558. BEGIN {
  4559. init()
  4560. if (!(belongsTo("-no-init", ARGV) || belongsTo("--no-init", ARGV)))
  4561. initScript()
  4562. pos = 0
  4563. noargc = 0
  4564. while (ARGV[++pos]) {
  4565. match(ARGV[pos], /^--?(V|vers(i(on?)?)?)$/)
  4566. if (RSTART) {
  4567. InfoOnly = "version"
  4568. continue
  4569. }
  4570. match(ARGV[pos], /^--?(H|h(e(lp?)?)?)$/)
  4571. if (RSTART) {
  4572. InfoOnly = "help"
  4573. continue
  4574. }
  4575. match(ARGV[pos], /^--?(M|m(a(n(u(al?)?)?)?)?)$/)
  4576. if (RSTART) {
  4577. InfoOnly = "manual"
  4578. continue
  4579. }
  4580. match(ARGV[pos], /^--?(T|ref(e(r(e(n(ce?)?)?)?)?)?)$/)
  4581. if (RSTART) {
  4582. InfoOnly = "reference"
  4583. continue
  4584. }
  4585. match(ARGV[pos], /^--?r$/)
  4586. if (RSTART) {
  4587. w("[WARNING] Option '-r' has been deprecated since version 0.9.\n"\
  4588. "          Use option '-T' or '-reference' instead.")
  4589. exit 1
  4590. }
  4591. match(ARGV[pos], /^--?(R|reference-e(n(g(l(i(sh?)?)?)?)?)?)$/)
  4592. if (RSTART) {
  4593. InfoOnly = "reference-english"
  4594. continue
  4595. }
  4596. match(ARGV[pos], /^--?(L|list)(=(.*)?)?$/, group)
  4597. if (RSTART) {
  4598. InfoOnly = "list"
  4599. if (group[2]) {
  4600. if (group[3]) split(group[3], Option["tl"], "+")
  4601. } else
  4602. split(ARGV[++pos], Option["tl"], "+")
  4603. continue
  4604. }
  4605. match(ARGV[pos], /^--?(S|list-e(n(g(i(n(es?)?)?)?)?)?)$/)
  4606. if (RSTART) {
  4607. InfoOnly = "list-engines"
  4608. continue
  4609. }
  4610. match(ARGV[pos], /^--?(U|upgrade)$/)
  4611. if (RSTART) {
  4612. InfoOnly = "upgrade"
  4613. continue
  4614. }
  4615. match(ARGV[pos], /^--?(N|nothing)$/)
  4616. if (RSTART) {
  4617. InfoOnly = "nothing"
  4618. continue
  4619. }
  4620. match(ARGV[pos], /^--?(e|engine)(=(.*)?)?$/, group)
  4621. if (RSTART) {
  4622. Option["engine"] = group[2] ?
  4623. (group[3] ? group[3] : Option["engine"]) :
  4624. ARGV[++pos]
  4625. continue
  4626. }
  4627. match(ARGV[pos], /^\/(.*)$/, group)
  4628. if (RSTART) {
  4629. Option["engine"] = group[1]
  4630. continue
  4631. }
  4632. match(ARGV[pos], /^--?verbose$/)
  4633. if (RSTART) {
  4634. Option["verbose"] = 1
  4635. continue
  4636. }
  4637. match(ARGV[pos], /^--?b(r(i(ef?)?)?)?$/)
  4638. if (RSTART) {
  4639. Option["verbose"] = 0
  4640. continue
  4641. }
  4642. match(ARGV[pos], /^--?d(i(c(t(i(o(n(a(ry?)?)?)?)?)?)?)?)?$/)
  4643. if (RSTART) {
  4644. Option["show-original-dictionary"] = 1
  4645. Option["show-dictionary"] = 0
  4646. Option["show-alternatives"] = 0
  4647. continue
  4648. }
  4649. match(ARGV[pos], /^--?id(e(n(t(i(fy?)?)?)?)?)?$/)
  4650. if (RSTART) {
  4651. Option["verbose"] = -1
  4652. continue
  4653. }
  4654. match(ARGV[pos], /^--?show-original(=(.*)?)?$/, group)
  4655. if (RSTART) {
  4656. Option["show-original"] = yn(group[1] ? group[2] : ARGV[++pos])
  4657. continue
  4658. }
  4659. match(ARGV[pos], /^--?show-original-phonetics(=(.*)?)?$/, group)
  4660. if (RSTART) {
  4661. Option["show-original-phonetics"] = yn(group[1] ? group[2] : ARGV[++pos])
  4662. continue
  4663. }
  4664. match(ARGV[pos], /^--?show-translation(=(.*)?)?$/, group)
  4665. if (RSTART) {
  4666. Option["show-translation"] = yn(group[1] ? group[2] : ARGV[++pos])
  4667. continue
  4668. }
  4669. match(ARGV[pos], /^--?show-translation-phonetics(=(.*)?)?$/, group)
  4670. if (RSTART) {
  4671. Option["show-translation-phonetics"] = yn(group[1] ? group[2] : ARGV[++pos])
  4672. continue
  4673. }
  4674. match(ARGV[pos], /^--?show-prompt-message(=(.*)?)?$/, group)
  4675. if (RSTART) {
  4676. Option["show-prompt-message"] = yn(group[1] ? group[2] : ARGV[++pos])
  4677. continue
  4678. }
  4679. match(ARGV[pos], /^--?show-languages(=(.*)?)?$/, group)
  4680. if (RSTART) {
  4681. Option["show-languages"] = yn(group[1] ? group[2] : ARGV[++pos])
  4682. continue
  4683. }
  4684. match(ARGV[pos], /^--?show-original-dictionary(=(.*)?)?$/, group)
  4685. if (RSTART) {
  4686. Option["show-original-dictionary"] = yn(group[1] ? group[2] : ARGV[++pos])
  4687. continue
  4688. }
  4689. match(ARGV[pos], /^--?show-dictionary(=(.*)?)?$/, group)
  4690. if (RSTART) {
  4691. Option["show-dictionary"] = yn(group[1] ? group[2] : ARGV[++pos])
  4692. continue
  4693. }
  4694. match(ARGV[pos], /^--?show-alternatives(=(.*)?)?$/, group)
  4695. if (RSTART) {
  4696. Option["show-alternatives"] = yn(group[1] ? group[2] : ARGV[++pos])
  4697. continue
  4698. }
  4699. match(ARGV[pos], /^--?w(i(d(th?)?)?)?(=(.*)?)?$/, group)
  4700. if (RSTART) {
  4701. Option["width"] = group[4] ?
  4702. (group[5] ? group[5] : Option["width"]) :
  4703. ARGV[++pos]
  4704. continue
  4705. }
  4706. match(ARGV[pos], /^--?indent(=(.*)?)?$/, group)
  4707. if (RSTART) {
  4708. Option["indent"] = group[1] ?
  4709. (group[2] ? group[2] : Option["indent"]) :
  4710. ARGV[++pos]
  4711. continue
  4712. }
  4713. match(ARGV[pos], /^--?theme(=(.*)?)?$/, group)
  4714. if (RSTART) {
  4715. Option["theme"] = group[1] ?
  4716. (group[2] ? group[2] : Option["theme"]) :
  4717. ARGV[++pos]
  4718. continue
  4719. }
  4720. match(ARGV[pos], /^--?no-theme$/)
  4721. if (RSTART) {
  4722. Option["theme"] = NULLSTR
  4723. continue
  4724. }
  4725. match(ARGV[pos], /^--?no-ansi$/)
  4726. if (RSTART) {
  4727. Option["no-ansi"] = 1
  4728. continue
  4729. }
  4730. match(ARGV[pos], /^--?no-auto(correct)?$/)
  4731. if (RSTART) {
  4732. Option["no-autocorrect"] = 1
  4733. continue
  4734. }
  4735. match(ARGV[pos], /^--?no-bidi/)
  4736. if (RSTART) {
  4737. Option["no-bidi"] = 1
  4738. continue
  4739. }
  4740. match(ARGV[pos], /^--?no-warn/)
  4741. if (RSTART) {
  4742. Option["no-warn"] = 1
  4743. continue
  4744. }
  4745. match(ARGV[pos], /^--?dump/)
  4746. if (RSTART) {
  4747. Option["dump"] = 1
  4748. continue
  4749. }
  4750. match(ARGV[pos], /^--?p(l(ay?)?)?$/)
  4751. if (RSTART) {
  4752. Option["play"] = 1
  4753. continue
  4754. }
  4755. match(ARGV[pos], /^--?sp(e(ak?)?)?$/)
  4756. if (RSTART) {
  4757. Option["play"] = 2
  4758. continue
  4759. }
  4760. match(ARGV[pos], /^--?(n|narrator)(=(.*)?)?$/, group)
  4761. if (RSTART) {
  4762. if (!Option["play"]) Option["play"] = 1
  4763. Option["narrator"] = group[2] ?
  4764. (group[3] ? group[3] : Option["narrator"]) :
  4765. ARGV[++pos]
  4766. continue
  4767. }
  4768. match(ARGV[pos], /^--?player(=(.*)?)?$/, group)
  4769. if (RSTART) {
  4770. if (!Option["play"]) Option["play"] = 1
  4771. Option["player"] = group[1] ?
  4772. (group[2] ? group[2] : Option["player"]) :
  4773. ARGV[++pos]
  4774. continue
  4775. }
  4776. match(ARGV[pos], /^--?no-play$/)
  4777. if (RSTART) {
  4778. Option["play"] = 0
  4779. continue
  4780. }
  4781. match(ARGV[pos], /^--?no-tran(s(l(a(te?)?)?)?)?$/)
  4782. if (RSTART) {
  4783. Option["no-translate"] = 1
  4784. continue
  4785. }
  4786. match(ARGV[pos], /^--?download-a(u(d(io?)?)?)?$/)
  4787. if (RSTART) {
  4788. Option["download-audio"] = 1
  4789. continue
  4790. }
  4791. match(ARGV[pos], /^--?download-audio-as(=(.*)?)?$/, group)
  4792. if (RSTART) {
  4793. if (!Option["download-audio"]) Option["download-audio"] = 1
  4794. Option["download-audio-as"] = group[1] ?
  4795. (group[2] ? group[2] : Option["download-audio-as"]) :
  4796. ARGV[++pos]
  4797. continue
  4798. }
  4799. match(ARGV[pos], /^--?v(i(ew?)?)?$/)
  4800. if (RSTART) {
  4801. Option["view"] = 1
  4802. continue
  4803. }
  4804. match(ARGV[pos], /^--?pager(=(.*)?)?$/, group)
  4805. if (RSTART) {
  4806. Option["view"] = 1
  4807. Option["pager"] = group[1] ?
  4808. (group[2] ? group[2] : Option["pager"]) :
  4809. ARGV[++pos]
  4810. continue
  4811. }
  4812. match(ARGV[pos], /^--?no-view$/)
  4813. if (RSTART) {
  4814. Option["view"] = 0
  4815. continue
  4816. }
  4817. match(ARGV[pos], /^--?browser(=(.*)?)?$/, group)
  4818. if (RSTART) {
  4819. Option["browser"] = group[1] ?
  4820. (group[2] ? group[2] : Option["browser"]) :
  4821. ARGV[++pos]
  4822. continue
  4823. }
  4824. match(ARGV[pos], /^--?(x|proxy)(=(.*)?)?$/, group)
  4825. if (RSTART) {
  4826. Option["proxy"] = group[2] ?
  4827. (group[3] ? group[3] : Option["proxy"]) :
  4828. ARGV[++pos]
  4829. continue
  4830. }
  4831. match(ARGV[pos], /^--?(u|user-agent)(=(.*)?)?$/, group)
  4832. if (RSTART) {
  4833. Option["user-agent"] = group[2] ?
  4834. (group[3] ? group[3] : Option["user-agent"]) :
  4835. ARGV[++pos]
  4836. continue
  4837. }
  4838. match(ARGV[pos], /^--?(I|int(e(r(a(c(t(i(ve?)?)?)?)?)?)?)?|shell)$/)
  4839. if (RSTART) {
  4840. Option["interactive"] = 1
  4841. continue
  4842. }
  4843. match(ARGV[pos], /^--?(E|emacs)$/)
  4844. if (RSTART) {
  4845. Option["emacs"] = 1
  4846. continue
  4847. }
  4848. match(ARGV[pos], /^--?no-rlwrap$/)
  4849. if (RSTART) {
  4850. Option["no-rlwrap"] = 1
  4851. continue
  4852. }
  4853. match(ARGV[pos], /^--?prompt(=(.*)?)?$/, group)
  4854. if (RSTART) {
  4855. w("[ERROR] Option '-prompt' has been deprecated since version 0.9.\n"\
  4856. "        Use configuration variable 'fmt-prompt' instead.")
  4857. exit 1
  4858. }
  4859. match(ARGV[pos], /^--?prompt-color(=(.*)?)?$/, group)
  4860. if (RSTART) {
  4861. w("[ERROR] Option '-prompt-color' has been deprecated since version 0.9.\n"\
  4862. "        Use configuration variable 'sgr-prompt' instead.")
  4863. exit 1
  4864. }
  4865. match(ARGV[pos], /^--?i(n(p(ut?)?)?)?(=(.*)?)?$/, group)
  4866. if (RSTART) {
  4867. Option["input"] = group[4] ?
  4868. (group[5] ? group[5] : Option["input"]) :
  4869. ARGV[++pos]
  4870. continue
  4871. }
  4872. match(ARGV[pos], /^--?o(u(t(p(ut?)?)?)?)?(=(.*)?)?$/, group)
  4873. if (RSTART) {
  4874. Option["output"] = group[5] ?
  4875. (group[6] ? group[6] : Option["output"]) :
  4876. ARGV[++pos]
  4877. continue
  4878. }
  4879. match(ARGV[pos], /^--?(l(a(ng?)?)?|hl)(=(.*)?)?$/, group)
  4880. if (RSTART) {
  4881. Option["hl"] = group[4] ?
  4882. (group[5] ? group[5] : Option["hl"]) :
  4883. ARGV[++pos]
  4884. continue
  4885. }
  4886. match(ARGV[pos], /^--?(s(o(u(r(ce?)?)?)?|l)?|f|from)(=(.*)?)?$/, group)
  4887. if (RSTART) {
  4888. Option["sl"] = group[6] ?
  4889. (group[7] ? group[7] : Option["sl"]) :
  4890. ARGV[++pos]
  4891. continue
  4892. }
  4893. match(ARGV[pos], /^--?t(a(r(g(et?)?)?)?|l|o)?(=(.*)?)?$/, group)
  4894. if (RSTART) {
  4895. if (group[5]) {
  4896. if (group[6]) split(group[6], Option["tl"], "+")
  4897. } else
  4898. split(ARGV[++pos], Option["tl"], "+")
  4899. continue
  4900. }
  4901. match(ARGV[pos], /^[{(\[]?([[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group)
  4902. if (RSTART) {
  4903. if (group[1]) Option["sl"] = group[1]
  4904. if (group[4]) split(group[4], Option["tl"], "+")
  4905. continue
  4906. }
  4907. match(ARGV[pos], /^--?(D|debug)$/)
  4908. if (RSTART) {
  4909. Option["debug"] = 1
  4910. continue
  4911. }
  4912. match(ARGV[pos], /^--?no-init/)
  4913. if (RSTART) continue
  4914. match(ARGV[pos], /^-(-?no-op)?$/)
  4915. if (RSTART) continue
  4916. match(ARGV[pos], /^--$/)
  4917. if (RSTART) {
  4918. ++pos
  4919. break
  4920. }
  4921. noargv[noargc++] = ARGV[pos]
  4922. }
  4923. if (Option["interactive"] && !Option["no-rlwrap"])
  4924. rlwrapMe()
  4925. else if (Option["emacs"] && !Option["interactive"] && !Option["no-rlwrap"])
  4926. if (emacsMe())
  4927. Option["interactive"] = 1
  4928. initMisc()
  4929. switch (InfoOnly) {
  4930. case "version":
  4931. print getVersion()
  4932. exit ExitCode
  4933. case "help":
  4934. print getHelp()
  4935. exit ExitCode
  4936. case "manual":
  4937. showMan()
  4938. exit ExitCode
  4939. case "reference":
  4940. print getReference("endonym")
  4941. exit ExitCode
  4942. case "reference-english":
  4943. print getReference("name")
  4944. exit ExitCode
  4945. case "list":
  4946. print getList(Option["tl"])
  4947. exit ExitCode
  4948. case "list-engines":
  4949. for (translator in Translator)
  4950. print (Option["engine"] == translator ? "* " : "  ") translator
  4951. exit ExitCode
  4952. case "upgrade":
  4953. upgrade()
  4954. exit ExitCode
  4955. case "nothing":
  4956. exit ExitCode
  4957. }
  4958. setTheme()
  4959. if (Option["interactive"])
  4960. welcome()
  4961. if (pos < ARGC)
  4962. for (i = pos; i < ARGC; i++)
  4963. noargv[noargc++] = ARGV[i]
  4964. if (noargc) {
  4965. for (i = 0; i < noargc; i++) {
  4966. if (Option["verbose"] && i > pos)
  4967. p(prettify("source-seperator", replicate(Option["chr-source-seperator"], Option["width"])))
  4968. translate(noargv[i], 1)
  4969. }
  4970. } else {
  4971. if (!Option["input"]) Option["input"] = STDIN
  4972. }
  4973. if (Option["input"])
  4974. translateMain()
  4975. exit ExitCode
  4976. }
  4977. EOF
  4978. read -r -d '' TRANS_MANPAGE << 'EOF'
  4979. .\" Automatically generated by Pandoc 2.0
  4980. .\"
  4981. .TH "TRANS" "1" "2017\-12\-17" "0.9.6.6" ""
  4982. .hy
  4983. .SH NAME
  4984. .PP
  4985. trans \- Command\-line translator using Google Translate, Bing
  4986. Translator, Yandex.Translate, DeepL Translator, etc.
  4987. .SH SYNOPSIS
  4988. .PP
  4989. \f[B]trans\f[] [\f[I]OPTIONS\f[]] [\f[I]SOURCE\f[]]:[\f[I]TARGETS\f[]]
  4990. [\f[I]TEXT\f[]]...
  4991. .SH DESCRIPTION
  4992. .PP
  4993. This tool translates text into any language from the command\-line,
  4994. using a translation engine such as Google Translate, Bing Translator and
  4995. Yandex.Translate.
  4996. .PP
  4997. Each argument which is not a valid option is treated as \f[I]TEXT\f[] to
  4998. be translated.
  4999. .PP
  5000. If neither \f[I]TEXT\f[] nor the input file is specified by
  5001. command\-line arguments, the program will read and translate from
  5002. standard input.
  5003. .SH OPTIONS
  5004. .SS Information options
  5005. .TP
  5006. .B \f[B]\-V\f[], \f[B]\-version\f[]
  5007. Print version and exit.
  5008. .RS
  5009. .RE
  5010. .TP
  5011. .B \f[B]\-H\f[], \f[B]\-help\f[]
  5012. Print help message and exit.
  5013. .RS
  5014. .RE
  5015. .TP
  5016. .B \f[B]\-M\f[], \f[B]\-man\f[]
  5017. Show man page and exit.
  5018. .RS
  5019. .RE
  5020. .TP
  5021. .B \f[B]\-T\f[], \f[B]\-reference\f[]
  5022. Print reference table of all supported languages and codes, and exit.
  5023. Names of languages are displayed in their endonyms (language name in the
  5024. language itself).
  5025. .RS
  5026. .RE
  5027. .TP
  5028. .B \f[B]\-R\f[], \f[B]\-reference\-english\f[]
  5029. Print reference table of all supported languages and codes, and exit.
  5030. Names of languages are displayed in English.
  5031. .RS
  5032. .RE
  5033. .TP
  5034. .B \f[B]\-L\f[] \f[I]CODES\f[], \f[B]\-list\f[] \f[I]CODES\f[]
  5035. Print details of languages and exit.
  5036. When specifying two or more language codes, concatenate them by plus
  5037. sign "+".
  5038. .RS
  5039. .RE
  5040. .TP
  5041. .B \f[B]\-S\f[], \f[B]\-list\-engines\f[]
  5042. List available translation engines and exit.
  5043. .RS
  5044. .RE
  5045. .TP
  5046. .B \f[B]\-U\f[], \f[B]\-upgrade\f[]
  5047. Check for upgrade of this program.
  5048. .RS
  5049. .RE
  5050. .SS Translator options
  5051. .TP
  5052. .B \f[B]\-e\f[] \f[I]ENGINE\f[], \f[B]\-engine\f[] \f[I]ENGINE\f[]
  5053. Specify the translation engine to use.
  5054. (default: google)
  5055. .RS
  5056. .RE
  5057. .SS Display options
  5058. .TP
  5059. .B \f[B]\-verbose\f[]
  5060. Verbose mode.
  5061. .RS
  5062. .PP
  5063. Show the original text and its most relevant translation, then its
  5064. phonetic notation (if any), then its alternative translations (if any)
  5065. or its definition in the dictionary (if it is a word).
  5066. .PP
  5067. This option is unnecessary in most cases since verbose mode is enabled
  5068. by default.
  5069. .RE
  5070. .TP
  5071. .B \f[B]\-b\f[], \f[B]\-brief\f[]
  5072. Brief mode.
  5073. .RS
  5074. .PP
  5075. Show the most relevant translation or its phonetic notation only.
  5076. .RE
  5077. .TP
  5078. .B \f[B]\-d\f[], \f[B]\-dictionary\f[]
  5079. Dictionary mode.
  5080. .RS
  5081. .PP
  5082. Show the definition of the original word in the dictionary.
  5083. .RE
  5084. .TP
  5085. .B \f[B]\-identify\f[]
  5086. Language identification.
  5087. .RS
  5088. .PP
  5089. Show the identified language of the original text.
  5090. .RE
  5091. .TP
  5092. .B \f[B]\-show\-original\f[] \f[I]Y/n\f[]
  5093. Show original text or not.
  5094. (default: yes)
  5095. .RS
  5096. .RE
  5097. .TP
  5098. .B \f[B]\-show\-original\-phonetics\f[] \f[I]Y/n\f[]
  5099. Show phonetic notation of original text or not.
  5100. (default: yes)
  5101. .RS
  5102. .RE
  5103. .TP
  5104. .B \f[B]\-show\-translation\f[] \f[I]Y/n\f[]
  5105. Show translation or not.
  5106. (default: yes)
  5107. .RS
  5108. .RE
  5109. .TP
  5110. .B \f[B]\-show\-translation\-phonetics\f[] \f[I]Y/n\f[]
  5111. Show phonetic notation of translation or not.
  5112. (default: yes)
  5113. .RS
  5114. .RE
  5115. .TP
  5116. .B \f[B]\-show\-prompt\-message\f[] \f[I]Y/n\f[]
  5117. Show prompt message or not.
  5118. (default: yes)
  5119. .RS
  5120. .RE
  5121. .TP
  5122. .B \f[B]\-show\-languages\f[] \f[I]Y/n\f[]
  5123. Show source and target languages or not.
  5124. (default: yes)
  5125. .RS
  5126. .RE
  5127. .TP
  5128. .B \f[B]\-show\-original\-dictionary\f[] \f[I]y/N\f[]
  5129. Show dictionary entry of original text or not.
  5130. (default: no)
  5131. .RS
  5132. .PP
  5133. This option is enabled in dictionary mode.
  5134. .RE
  5135. .TP
  5136. .B \f[B]\-show\-dictionary\f[] \f[I]Y/n\f[]
  5137. Show dictionary entry of translation or not.
  5138. (default: yes)
  5139. .RS
  5140. .RE
  5141. .TP
  5142. .B \f[B]\-show\-alternatives\f[] \f[I]Y/n\f[]
  5143. Show alternative translations or not.
  5144. (default: yes)
  5145. .RS
  5146. .RE
  5147. .TP
  5148. .B \f[B]\-w\f[] \f[I]NUM\f[], \f[B]\-width\f[] \f[I]NUM\f[]
  5149. Specify the screen width for padding.
  5150. .RS
  5151. .PP
  5152. This option overrides the setting of environment variable
  5153. $\f[B]COLUMNS\f[].
  5154. .RE
  5155. .TP
  5156. .B \f[B]\-indent\f[] \f[I]NUM\f[]
  5157. Specify the size of indent (number of spaces).
  5158. (default: 4)
  5159. .RS
  5160. .RE
  5161. .TP
  5162. .B \f[B]\-theme\f[] \f[I]FILENAME\f[]
  5163. Specify the theme to use.
  5164. (default: default)
  5165. .RS
  5166. .RE
  5167. .TP
  5168. .B \f[B]\-no\-theme\f[]
  5169. Do not use any other theme than default.
  5170. .RS
  5171. .RE
  5172. .TP
  5173. .B \f[B]\-no\-ansi\f[]
  5174. Do not use ANSI escape codes.
  5175. .RS
  5176. .RE
  5177. .TP
  5178. .B \f[B]\-no\-autocorrect\f[]
  5179. Do not autocorrect.
  5180. (if defaulted by the translation engine)
  5181. .RS
  5182. .RE
  5183. .TP
  5184. .B \f[B]\-no\-bidi\f[]
  5185. Do not convert bidirectional texts.
  5186. .RS
  5187. .RE
  5188. .TP
  5189. .B \f[B]\-no\-warn\f[]
  5190. Do not write warning messages to stderr.
  5191. .RS
  5192. .RE
  5193. .TP
  5194. .B \f[B]\-dump\f[]
  5195. Print raw API response instead.
  5196. .RS
  5197. .RE
  5198. .SS Audio options
  5199. .TP
  5200. .B \f[B]\-p\f[], \f[B]\-play\f[]
  5201. Listen to the translation.
  5202. .RS
  5203. .PP
  5204. You must have at least one of the supported audio players
  5205. (\f[B]mplayer\f[], \f[B]mpv\f[] or \f[B]mpg123\f[]) installed to stream
  5206. from Google Text\-to\-Speech engine.
  5207. Otherwise, a local speech synthesizer may be used instead (\f[B]say\f[]
  5208. on macOS, \f[B]espeak\f[] on Linux or other platforms).
  5209. .RE
  5210. .TP
  5211. .B \f[B]\-speak\f[]
  5212. Listen to the original text.
  5213. .RS
  5214. .RE
  5215. .TP
  5216. .B \f[B]\-n\f[] \f[I]VOICE\f[], \f[B]\-narrator\f[] \f[I]VOICE\f[]
  5217. Specify the narrator, and listen to the translation.
  5218. .RS
  5219. .PP
  5220. Common values for this option are \f[B]male\f[] and \f[B]female\f[].
  5221. .RE
  5222. .TP
  5223. .B \f[B]\-player\f[] \f[I]PROGRAM\f[]
  5224. Specify the audio player to use, and listen to the translation.
  5225. .RS
  5226. .PP
  5227. Option \f[B]\-play\f[] will try to use \f[B]mplayer\f[], \f[B]mpv\f[] or
  5228. \f[B]mpg123\f[] by default, since these players are known to work for
  5229. streaming URLs.
  5230. Not all command\-line audio players can work this way.
  5231. Use this option only when you have your own preference.
  5232. .PP
  5233. This option overrides the setting of environment variable
  5234. $\f[B]PLAYER\f[].
  5235. .RE
  5236. .TP
  5237. .B \f[B]\-no\-play\f[]
  5238. Do not listen to the translation.
  5239. .RS
  5240. .RE
  5241. .TP
  5242. .B \f[B]\-no\-translate\f[]
  5243. Do not translate anything when using \-speak.
  5244. .RS
  5245. .RE
  5246. .TP
  5247. .B \f[B]\-download\-audio\f[]
  5248. Download the audio to the current directory.
  5249. .RS
  5250. .RE
  5251. .TP
  5252. .B \f[B]\-download\-audio\-as\f[] \f[I]FILENAME\f[]
  5253. Download the audio to the specified file.
  5254. .RS
  5255. .RE
  5256. .SS Terminal paging and browsing options
  5257. .TP
  5258. .B \f[B]\-v\f[], \f[B]\-view\f[]
  5259. View the translation in a terminal pager (\f[B]less\f[], \f[B]more\f[]
  5260. or \f[B]most\f[]).
  5261. .RS
  5262. .RE
  5263. .TP
  5264. .B \f[B]\-pager\f[] \f[I]PROGRAM\f[]
  5265. Specify the terminal pager to use, and view the translation.
  5266. .RS
  5267. .PP
  5268. This option overrides the setting of environment variable
  5269. $\f[B]PAGER\f[].
  5270. .RE
  5271. .TP
  5272. .B \f[B]\-no\-view\f[]
  5273. Do not view the translation in a terminal pager.
  5274. .RS
  5275. .RE
  5276. .TP
  5277. .B \f[B]\-browser\f[] \f[I]PROGRAM\f[]
  5278. Specify the web browser to use.
  5279. .RS
  5280. .PP
  5281. This option overrides the setting of environment variable
  5282. $\f[B]BROWSER\f[].
  5283. .RE
  5284. .SS Networking options
  5285. .TP
  5286. .B \f[B]\-x\f[] \f[I]HOST:PORT\f[], \f[B]\-proxy\f[] \f[I]HOST:PORT\f[]
  5287. Use HTTP proxy on given port.
  5288. .RS
  5289. .PP
  5290. This option overrides the setting of environment variables
  5291. $\f[B]HTTP_PROXY\f[] and $\f[B]http_proxy\f[].
  5292. .RE
  5293. .TP
  5294. .B \f[B]\-u\f[] \f[I]STRING\f[], \f[B]\-user\-agent\f[] \f[I]STRING\f[]
  5295. Specify the User\-Agent to identify as.
  5296. .RS
  5297. .PP
  5298. This option overrides the setting of environment variables
  5299. $\f[B]USER_AGENT\f[].
  5300. .RE
  5301. .SS Interactive shell options
  5302. .TP
  5303. .B \f[B]\-I\f[], \f[B]\-interactive\f[], \f[B]\-shell\f[]
  5304. Start an interactive shell, invoking \f[B]rlwrap\f[] whenever possible
  5305. (unless \f[B]\-no\-rlwrap\f[] is specified).
  5306. .RS
  5307. .RE
  5308. .TP
  5309. .B \f[B]\-E\f[], \f[B]\-emacs\f[]
  5310. Start the GNU Emacs front\-end for an interactive shell.
  5311. .RS
  5312. .PP
  5313. This option does not need to, and cannot be used along with \f[B]\-I\f[]
  5314. or \f[B]\-no\-rlwrap\f[].
  5315. .RE
  5316. .TP
  5317. .B \f[B]\-no\-rlwrap\f[]
  5318. Do not invoke \f[B]rlwrap\f[] when starting an interactive shell.
  5319. .RS
  5320. .PP
  5321. This option is useful when your terminal type is not supported by
  5322. \f[B]rlwrap\f[] (e.g.
  5323. \f[B]emacs\f[]).
  5324. .RE
  5325. .SS I/O options
  5326. .TP
  5327. .B \f[B]\-i\f[] \f[I]FILENAME\f[], \f[B]\-input\f[] \f[I]FILENAME\f[]
  5328. Specify the input file.
  5329. .RS
  5330. .PP
  5331. Source text to be translated will be read from the input file, instead
  5332. of standard input.
  5333. .RE
  5334. .TP
  5335. .B \f[B]\-o\f[] \f[I]FILENAME\f[], \f[B]\-output\f[] \f[I]FILENAME\f[]
  5336. Specify the output file.
  5337. .RS
  5338. .PP
  5339. Translations will be written to the output file, instead of standard
  5340. output.
  5341. .RE
  5342. .SS Language preference options
  5343. .TP
  5344. .B \f[B]\-l\f[] \f[I]CODE\f[], \f[B]\-hl\f[] \f[I]CODE\f[], \f[B]\-lang\f[] \f[I]CODE\f[]
  5345. Specify your home language (the language you would like to see for
  5346. displaying prompt messages in the translation).
  5347. .RS
  5348. .PP
  5349. This option affects only the display in verbose mode (anything other
  5350. than source language and target language will be displayed in your home
  5351. language).
  5352. This option has no effect in brief mode.
  5353. .PP
  5354. This option is optional.
  5355. When its setting is omitted, English will be used.
  5356. .PP
  5357. This option overrides the setting of environment variables
  5358. $\f[B]LANGUAGE\f[], $\f[B]LC_ALL\f[], $\f[B]LANG\f[] and
  5359. $\f[B]HOME_LANG\f[].
  5360. .RE
  5361. .TP
  5362. .B \f[B]\-s\f[] \f[I]CODE\f[], \f[B]\-sl\f[] \f[I]CODE\f[], \f[B]\-source\f[] \f[I]CODE\f[], \f[B]\-from\f[] \f[I]CODE\f[]
  5363. Specify the source language (the language of original text).
  5364. .RS
  5365. .PP
  5366. This option is optional.
  5367. When its setting is omitted, the language of original text will be
  5368. identified automatically (with a possibility of misidentification).
  5369. .PP
  5370. This option overrides the setting of environment variable
  5371. $\f[B]SOURCE_LANG\f[].
  5372. .RE
  5373. .TP
  5374. .B \f[B]\-t\f[] \f[I]CODES\f[], \f[B]\-tl\f[] \f[I]CODE\f[], \f[B]\-target\f[] \f[I]CODES\f[], \f[B]\-to\f[] \f[I]CODES\f[]
  5375. Specify the target language(s) (the language(s) of translated text).
  5376. When specifying two or more language codes, concatenate them by plus
  5377. sign "+".
  5378. .RS
  5379. .PP
  5380. This option is optional.
  5381. When its setting is omitted, everything will be translated into English.
  5382. .PP
  5383. This option overrides the setting of environment variables
  5384. $\f[B]LANGUAGE\f[], $\f[B]LC_ALL\f[], $\f[B]LANG\f[] and
  5385. $\f[B]TARGET_LANG\f[].
  5386. .RE
  5387. .TP
  5388. .B [\f[I]SOURCE\f[]]:[\f[I]TARGETS\f[]]
  5389. A simpler, alternative way to specify the source language and target
  5390. language(s) is to use a shortcut formatted string:
  5391. .RS
  5392. .IP \[bu] 2
  5393. \f[I]SOURCE\-CODE\f[]:\f[I]TARGET\-CODE\f[]
  5394. .IP \[bu] 2
  5395. \f[I]SOURCE\-CODE\f[]:\f[I]TARGET\-CODE1\f[]+\f[I]TARGET\-CODE2\f[]+...
  5396. .IP \[bu] 2
  5397. \f[I]SOURCE\-CODE\f[]=\f[I]TARGET\-CODE\f[]
  5398. .IP \[bu] 2
  5399. \f[I]SOURCE\-CODE\f[]=\f[I]TARGET\-CODE1\f[]+\f[I]TARGET\-CODE2\f[]+...
  5400. .PP
  5401. Delimiter ":" and "=" can be used interchangeably.
  5402. .PP
  5403. Either \f[I]SOURCE\f[] or \f[I]TARGETS\f[] may be omitted, but the
  5404. delimiter character must be kept.
  5405. .RE
  5406. .SS Other options
  5407. .TP
  5408. .B \f[B]\-no\-init\f[]
  5409. Do not load any initialization script.
  5410. .RS
  5411. .RE
  5412. .TP
  5413. .B \f[B]\-\-\f[]
  5414. End\-of\-options.
  5415. .RS
  5416. .PP
  5417. All arguments after this option are treated as \f[I]TEXT\f[] to be
  5418. translated.
  5419. .RE
  5420. .SH EXIT STATUS
  5421. .TP
  5422. .B \f[B]0\f[]
  5423. Successful translation.
  5424. .RS
  5425. .RE
  5426. .TP
  5427. .B \f[B]1\f[]
  5428. Error.
  5429. .RS
  5430. .RE
  5431. .SH ENVIRONMENT
  5432. .TP
  5433. .B \f[B]PAGER\f[]
  5434. Equivalent to option setting \f[B]\-pager\f[].
  5435. .RS
  5436. .RE
  5437. .TP
  5438. .B \f[B]BROWSER\f[]
  5439. Equivalent to option setting \f[B]\-browser\f[].
  5440. .RS
  5441. .RE
  5442. .TP
  5443. .B \f[B]PLAYER\f[]
  5444. Equivalent to option setting \f[B]\-player\f[].
  5445. .RS
  5446. .RE
  5447. .TP
  5448. .B \f[B]HTTP_PROXY\f[]
  5449. Equivalent to option setting \f[B]\-proxy\f[].
  5450. .RS
  5451. .RE
  5452. .TP
  5453. .B \f[B]USER_AGENT\f[]
  5454. Equivalent to option setting \f[B]\-user\-agent\f[].
  5455. .RS
  5456. .RE
  5457. .TP
  5458. .B \f[B]HOME_LANG\f[]
  5459. Equivalent to option setting \f[B]\-lang\f[].
  5460. .RS
  5461. .RE
  5462. .TP
  5463. .B \f[B]SOURCE_LANG\f[]
  5464. Equivalent to option setting \f[B]\-source\f[].
  5465. .RS
  5466. .RE
  5467. .TP
  5468. .B \f[B]TARGET_LANG\f[]
  5469. Equivalent to option setting \f[B]\-target\f[].
  5470. .RS
  5471. .RE
  5472. .SH FILES
  5473. .TP
  5474. .B \f[I]/etc/translate\-shell\f[]
  5475. Initialization script.
  5476. (system\-wide)
  5477. .RS
  5478. .RE
  5479. .TP
  5480. .B \f[I]$HOME/.translate\-shell/init.trans\f[]
  5481. Initialization script.
  5482. (user\-specific)
  5483. .RS
  5484. .RE
  5485. .TP
  5486. .B \f[I]$XDG_CONFIG_HOME/translate\-shell/init.trans\f[]
  5487. Initialization script.
  5488. (user\-specific)
  5489. .RS
  5490. .RE
  5491. .TP
  5492. .B \f[I]./.trans\f[]
  5493. Initialization script.
  5494. (current directory)
  5495. .RS
  5496. .RE
  5497. .SH REPORTING BUGS
  5498. .PP
  5499. <https://github.com/soimort/translate-shell/issues>
  5500. .SH AUTHORS
  5501. Mort Yao <soi@mort.ninja>.
  5502. EOF
  5503. export TRANS_MANPAGE
  5504. export TRANS_BUILD=release
  5505. gawk -f <(echo -E "$TRANS_PROGRAM") - "$@"
Add Comment
Please, Sign In to add comment