From f0ec5c69f656c6d6d0a75465b767a5ba6968ed78 Mon Sep 17 00:00:00 2001 From: fluks Date: Wed, 13 Oct 2021 00:35:31 +0300 Subject: [PATCH 001/119] Add bash completion --- translate-shell | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 translate-shell diff --git a/translate-shell b/translate-shell new file mode 100644 index 00000000..cb90b206 --- /dev/null +++ b/translate-shell @@ -0,0 +1,20 @@ +_translate() { + COMPREPLY=() + cur=`_get_cword` + + if [ $COMP_CWORD -eq 1 ]; then + COMPREPLY=($(compgen -W "$(trans -help \ + | awk '{ gsub(/\x1b\[([0-9]{1,3}(;[0-9]{1,2})?)?m/, ""); print }' \ + | awk '{\ + for (i = 1; i <= NF; i++) {\ + if (index($i, "-") == 1) {\ + sub(/[,\.]$/, "", $i);\ + print $i\ + }\ + }\ + }')" -- "$cur")) + fi + + return 0 +} && +complete -F _translate default trans From 66e3d37ac938b861491883b6d844306de078a3b1 Mon Sep 17 00:00:00 2001 From: fluks Date: Wed, 13 Oct 2021 11:33:46 +0300 Subject: [PATCH 002/119] Drop colors using -no-ansi option --- translate-shell | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/translate-shell b/translate-shell index cb90b206..ca704981 100644 --- a/translate-shell +++ b/translate-shell @@ -3,8 +3,7 @@ _translate() { cur=`_get_cword` if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=($(compgen -W "$(trans -help \ - | awk '{ gsub(/\x1b\[([0-9]{1,3}(;[0-9]{1,2})?)?m/, ""); print }' \ + COMPREPLY=($(compgen -W "$(trans -help -no-ansi \ | awk '{\ for (i = 1; i <= NF; i++) {\ if (index($i, "-") == 1) {\ From 5b81b42e4d58e31a29a172d993d64dce6b80b594 Mon Sep 17 00:00:00 2001 From: Levy9Collision Date: Sat, 29 Jan 2022 20:15:26 +0300 Subject: [PATCH 003/119] add swap command to repl --- include/REPL.awk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/REPL.awk b/include/REPL.awk index 26c719d7..5c61b803 100644 --- a/include/REPL.awk +++ b/include/REPL.awk @@ -147,6 +147,10 @@ function repl(line, command, group, name, i, value, words) { } else if (command ~ /^:show$/) { name = words[2] print prettify("welcome-submessage", toString(Option[name], 1, 0, 1)) + } else if (command ~ /^:swap$/) { + tl = Option["tl"][1] + Option["tl"][1] = Option["sls"][1] + Option["sls"][1] = tl } else if (command ~ /^:engine$/) { value = words[2] Option["engine"] = value From 6cb545d6c4f1f1a31e942f143ec2bb282f99fe03 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 7 Jun 2022 17:30:40 +0200 Subject: [PATCH 004/119] Languages: update Assamese (Google support) --- include/Languages.awk | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index f0873ec4..15e524d4 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -80,6 +80,19 @@ function initLocale() { Locale["hy"]["glotto"] = "nucl1235" Locale["hy"]["script"] = "Armn" + # Assamese + Locale["as"]["name"] = "Assamese" + Locale["as"]["endonym"] = "অসমীয়া" + #Locale["as"]["translations-of"] + #Locale["as"]["definitions-of"] + #Locale["as"]["synonyms"] + #Locale["as"]["examples"] + #Locale["as"]["see-also"] + Locale["as"]["family"] = "Indo-European" + Locale["as"]["iso"] = "asm" + Locale["as"]["glotto"] = "assa1263" + Locale["as"]["script"] = "Beng" + #6 Azerbaijani (North Azerbaijani) Locale["az"]["name"] = "Azerbaijani" Locale["az"]["endonym"] = "Azərbaycanca" @@ -1590,20 +1603,6 @@ function initLocale() { Locale["kmr"]["glotto"] = "nort2641" Locale["kmr"]["script"] = "Latn" - #? Assamese - Locale["as"]["support"] = "unstable" - Locale["as"]["name"] = "Assamese" - Locale["as"]["endonym"] = "অসমীয়া" - #Locale["as"]["translations-of"] - #Locale["as"]["definitions-of"] - #Locale["as"]["synonyms"] - #Locale["as"]["examples"] - #Locale["as"]["see-also"] - Locale["as"]["family"] = "Indo-European" - Locale["as"]["iso"] = "asm" - Locale["as"]["glotto"] = "assa1263" - Locale["as"]["script"] = "Beng" - #? Bashkir Locale["ba"]["support"] = "yandex-only" Locale["ba"]["name"] = "Bashkir" From 71e740c016e7d86d9b2684afd5af98e170f3f0a5 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 7 Jun 2022 18:02:00 +0200 Subject: [PATCH 005/119] Languages: add Aymara --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 15e524d4..e810c47f 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -93,6 +93,19 @@ function initLocale() { Locale["as"]["glotto"] = "assa1263" Locale["as"]["script"] = "Beng" + # Aymara + Locale["ay"]["name"] = "Aymara" + Locale["ay"]["endonym"] = "Aymar aru" + #Locale["ay"]["translations-of"] + #Locale["ay"]["definitions-of"] + #Locale["ay"]["synonyms"] + #Locale["ay"]["examples"] + #Locale["ay"]["see-also"] + Locale["ay"]["family"] = "Aymaran" + Locale["ay"]["iso"] = "aym" + Locale["ay"]["glotto"] = "nucl1667" + Locale["ay"]["script"] = "Latn" + #6 Azerbaijani (North Azerbaijani) Locale["az"]["name"] = "Azerbaijani" Locale["az"]["endonym"] = "Azərbaycanca" From dbe89f71b90b1dff8bc68ccc5edfd800ac903ac7 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 7 Jun 2022 18:15:43 +0200 Subject: [PATCH 006/119] Languages: add Bambara --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index e810c47f..76d087e8 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -119,6 +119,19 @@ function initLocale() { Locale["az"]["glotto"] = "nort2697" Locale["az"]["script"] = "Latn" + # Bambara + Locale["bm"]["name"] = "Bambara" + Locale["bm"]["endonym"] = "Bamanankan" + #Locale["bm"]["translations-of"] + #Locale["bm"]["definitions-of"] + #Locale["bm"]["synonyms"] + #Locale["bm"]["examples"] + #Locale["bm"]["see-also"] + Locale["bm"]["family"] = "Mande" + Locale["bm"]["iso"] = "bam" + Locale["bm"]["glotto"] = "bamb1269" + Locale["bm"]["script"] = "Latn" + #7 Basque Locale["eu"]["name"] = "Basque" Locale["eu"]["endonym"] = "Euskara" From 6d24c0e1aa5c5e9419341985e87c43fb6aa7b70c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 7 Jun 2022 18:25:52 +0200 Subject: [PATCH 007/119] Languages: add Bhojpuri --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 76d087e8..ddb70d11 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -172,6 +172,19 @@ function initLocale() { Locale["bn"]["glotto"] = "beng1280" Locale["bn"]["script"] = "Beng" + # Bhojpuri + Locale["bho"]["name"] = "Bhojpuri" + Locale["bho"]["endonym"] = "भोजपुरी" + #Locale["bho"]["translations-of"] + #Locale["bho"]["definitions-of"] + #Locale["bho"]["synonyms"] + #Locale["bho"]["examples"] + #Locale["bho"]["see-also"] + Locale["bho"]["family"] = "Indo-European" + Locale["bho"]["iso"] = "bho" + Locale["bho"]["glotto"] = "bhoj1246" + Locale["bho"]["script"] = "Deva" + #10 Bosnian, Latin alphabet Locale["bs"]["name"] = "Bosnian" Locale["bs"]["endonym"] = "Bosanski" From 151544bb0160a69dfa6179dd97e9650d017b789f Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 13:42:44 +0200 Subject: [PATCH 008/119] Languages: add Dhivehi --- include/Languages.awk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index ddb70d11..f4704a5e 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -330,6 +330,21 @@ function initLocale() { Locale["da"]["glotto"] = "dani1285" Locale["da"]["script"] = "Latn" + # Dhivehi + Locale["dv"]["name"] = "Dhivehi" + Locale["dv"]["name2"] = "Divehi" + Locale["dv"]["endonym"] = "ދިވެހި" + #Locale["dv"]["translations-of"] + #Locale["dv"]["definitions-of"] + #Locale["dv"]["synonyms"] + #Locale["dv"]["examples"] + #Locale["dv"]["see-also"] + Locale["dv"]["family"] = "Indo-European" + Locale["dv"]["iso"] = "div" + Locale["dv"]["glotto"] = "dhiv1236" + Locale["dv"]["script"] = "Thaa" + Locale["dv"]["rtl"] = "true" # RTL language + #20 Dutch Locale["nl"]["name"] = "Dutch" Locale["nl"]["endonym"] = "Nederlands" @@ -2095,6 +2110,7 @@ function scriptName(code) { case "Sinh": return "Sinhala" case "Taml": return "Tamil" case "Telu": return "Telugu" + case "Thaa": return "Thaana" case "Thai": return "Thai" case "Tibt": return "Tibetan" default: return "Unknown" From 86de45898f99728b8747da0601125971470792bb Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 13:55:54 +0200 Subject: [PATCH 009/119] Languages: add Dogri --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index f4704a5e..4290e137 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -345,6 +345,19 @@ function initLocale() { Locale["dv"]["script"] = "Thaa" Locale["dv"]["rtl"] = "true" # RTL language + # Dogri + Locale["doi"]["name"] = "Dogri" + Locale["doi"]["endonym"] = "डोगरी" + #Locale["doi"]["translations-of"] + #Locale["doi"]["definitions-of"] + #Locale["doi"]["synonyms"] + #Locale["doi"]["examples"] + #Locale["doi"]["see-also"] + Locale["doi"]["family"] = "Indo-European" + Locale["doi"]["iso"] = "doi" + Locale["doi"]["glotto"] = "indo1311" + Locale["doi"]["script"] = "Deva" + #20 Dutch Locale["nl"]["name"] = "Dutch" Locale["nl"]["endonym"] = "Nederlands" From d8cac5b379874d4ef38af2cc7127f17dee3122f2 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 14:25:14 +0200 Subject: [PATCH 010/119] Languages: add Ewe --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 4290e137..5df59a6b 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -412,6 +412,19 @@ function initLocale() { Locale["et"]["glotto"] = "esto1258" Locale["et"]["script"] = "Latn" + # Ewe + Locale["ee"]["name"] = "Ewe" + Locale["ee"]["endonym"] = "Eʋegbe" + #Locale["ee"]["translations-of"] + #Locale["ee"]["definitions-of"] + #Locale["ee"]["synonyms"] + #Locale["ee"]["examples"] + #Locale["ee"]["see-also"] + Locale["ee"]["family"] = "Atlantic-Congo" + Locale["ee"]["iso"] = "ewe" + Locale["ee"]["glotto"] = "ewee1241" + Locale["ee"]["script"] = "Latn" + #24 Filipino / Tagalog Locale["tl"]["name"] = "Filipino" Locale["tl"]["name2"] = "Tagalog" From 87700d1a4cfaeb77af89479bcef9bbe68b949dc1 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 14:26:38 +0200 Subject: [PATCH 011/119] Languages: update Guarani (Google support) --- include/Languages.awk | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index 5df59a6b..d357c0d0 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -519,6 +519,19 @@ function initLocale() { Locale["el"]["glotto"] = "mode1248" Locale["el"]["script"] = "Grek" + # Guarani + Locale["gn"]["name"] = "Guarani" + Locale["gn"]["endonym"] = "Avañe'ẽ" + #Locale["gn"]["translations-of"] + #Locale["gn"]["definitions-of"] + #Locale["gn"]["synonyms"] + #Locale["gn"]["examples"] + #Locale["gn"]["see-also"] + Locale["gn"]["family"] = "Tupian" + Locale["gn"]["iso"] = "gug" + Locale["gn"]["glotto"] = "para1311" + Locale["gn"]["script"] = "Latn" + #31 Gujarati Locale["gu"]["name"] = "Gujarati" Locale["gu"]["endonym"] = "ગુજરાતી" @@ -1753,20 +1766,6 @@ function initLocale() { Locale["fo"]["glotto"] = "faro1244" Locale["fo"]["script"] = "Latn" - #? Guarani - Locale["gn"]["support"] = "unstable" - Locale["gn"]["name"] = "Guarani" - Locale["gn"]["endonym"] = "Avañe'ẽ" - #Locale["gn"]["translations-of"] - #Locale["gn"]["definitions-of"] - #Locale["gn"]["synonyms"] - #Locale["gn"]["examples"] - #Locale["gn"]["see-also"] - Locale["gn"]["family"] = "Tupian" - Locale["gn"]["iso"] = "grn" - Locale["gn"]["glotto"] = "para1311" - Locale["gn"]["script"] = "Latn" - #? Hill Mari Locale["mrj"]["support"] = "yandex-only" Locale["mrj"]["name"] = "Hill Mari" From 772dc0b628c9b2bd29f30721430f6afdccccca99 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 14:39:30 +0200 Subject: [PATCH 012/119] Languages: add Ilocano --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index d357c0d0..9f46cd5e 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -663,6 +663,19 @@ function initLocale() { Locale["ig"]["glotto"] = "nucl1417" Locale["ig"]["script"] = "Latn" + # Ilocano + Locale["ilo"]["name"] = "Ilocano" + Locale["ilo"]["endonym"] = "Ilokano" + #Locale["ilo"]["translations-of"] + #Locale["ilo"]["definitions-of"] + #Locale["ilo"]["synonyms"] + #Locale["ilo"]["examples"] + #Locale["ilo"]["see-also"] + Locale["ilo"]["family"] = "Austronesian" + Locale["ilo"]["iso"] = "ilo" + Locale["ilo"]["glotto"] = "ilok1237" + Locale["ilo"]["script"] = "Latn" + #41 Indonesian Locale["id"]["name"] = "Indonesian" Locale["id"]["endonym"] = "Bahasa Indonesia" From 9afa0ae15d92d89121728056910210c9dc240b88 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 14:51:06 +0200 Subject: [PATCH 013/119] Languages: add Konkani --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 9f46cd5e..e0c233b3 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -795,6 +795,19 @@ function initLocale() { Locale["rw"]["glotto"] = "kiny1244" Locale["rw"]["script"] = "Latn" + # Konkani (Goan Konkani) + Locale["gom"]["name"] = "Konkani" + Locale["gom"]["endonym"] = "कोंकणी" + #Locale["gom"]["translations-of"] + #Locale["gom"]["definitions-of"] + #Locale["gom"]["synonyms"] + #Locale["gom"]["examples"] + #Locale["gom"]["see-also"] + Locale["gom"]["family"] = "Indo-European" + Locale["gom"]["iso"] = "gom" + Locale["gom"]["glotto"] = "goan1235" + Locale["gom"]["script"] = "Deva" + #50 Korean Locale["ko"]["name"] = "Korean" Locale["ko"]["endonym"] = "한국어" From aefd8fbc8828054657d601e892d1359be4d45423 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 15:01:34 +0200 Subject: [PATCH 014/119] Languages: add Krio --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index e0c233b3..9f865b08 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -822,6 +822,19 @@ function initLocale() { Locale["ko"]["script"] = "Kore" Locale["ko"]["dictionary"] = "true" # has dictionary + # Krio + Locale["kri"]["name"] = "Krio" + Locale["kri"]["endonym"] = "Krio" + #Locale["kri"]["translations-of"] + #Locale["kri"]["definitions-of"] + #Locale["kri"]["synonyms"] + #Locale["kri"]["examples"] + #Locale["kri"]["see-also"] + Locale["kri"]["family"] = "Indo-European" + Locale["kri"]["iso"] = "kri" + Locale["kri"]["glotto"] = "krio1253" + Locale["kri"]["script"] = "Latn" + #51 Kurdish (Central Kurdish / Sorani), Latin alphabet (Arabic alphabet for Bing) Locale["ku"]["name"] = "Kurdish (Central)" Locale["ku"]["name2"] = "Sorani" From 07988f008de15a1434603ccd82ffefd741232dcd Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 15:52:03 +0200 Subject: [PATCH 015/119] Languages: update Kurdish dialects (Google support) --- include/Languages.awk | 46 ++++++++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index 9f865b08..f64754b0 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -420,10 +420,10 @@ function initLocale() { #Locale["ee"]["synonyms"] #Locale["ee"]["examples"] #Locale["ee"]["see-also"] - Locale["ee"]["family"] = "Atlantic-Congo" - Locale["ee"]["iso"] = "ewe" - Locale["ee"]["glotto"] = "ewee1241" - Locale["ee"]["script"] = "Latn" + Locale["ee"]["family"] = "Atlantic-Congo" + Locale["ee"]["iso"] = "ewe" + Locale["ee"]["glotto"] = "ewee1241" + Locale["ee"]["script"] = "Latn" #24 Filipino / Tagalog Locale["tl"]["name"] = "Filipino" @@ -835,10 +835,10 @@ function initLocale() { Locale["kri"]["glotto"] = "krio1253" Locale["kri"]["script"] = "Latn" - #51 Kurdish (Central Kurdish / Sorani), Latin alphabet (Arabic alphabet for Bing) - Locale["ku"]["name"] = "Kurdish (Central)" - Locale["ku"]["name2"] = "Sorani" - Locale["ku"]["endonym"] = "Soranî" + #51 Kurdish (Northern) / Kurmanji + Locale["ku"]["name"] = "Kurdish (Northern)" + Locale["ku"]["name2"] = "Kurmanji" + Locale["ku"]["endonym"] = "Kurmancî" Locale["ku"]["endonym2"] = "Kurdî" #Locale["ku"]["translations-of"] #Locale["ku"]["definitions-of"] @@ -846,10 +846,26 @@ function initLocale() { #Locale["ku"]["examples"] #Locale["ku"]["see-also"] Locale["ku"]["family"] = "Indo-European" - Locale["ku"]["iso"] = "kur" - Locale["ku"]["glotto"] = "kurd1259" + Locale["ku"]["iso"] = "kmr" + Locale["ku"]["glotto"] = "nort2641" Locale["ku"]["script"] = "Latn" + # Kurdish (Central) / Sorani + Locale["ckb"]["name"] = "Kurdish (Central)" + Locale["ckb"]["name2"] = "Sorani" + Locale["ckb"]["endonym"] = "سۆرانی" + Locale["ckb"]["endonym2"] = "کوردیی ناوەندی" + #Locale["ckb"]["translations-of"] + #Locale["ckb"]["definitions-of"] + #Locale["ckb"]["synonyms"] + #Locale["ckb"]["examples"] + #Locale["ckb"]["see-also"] + Locale["ckb"]["family"] = "Indo-European" + Locale["ckb"]["iso"] = "ckb" + Locale["ckb"]["glotto"] = "cent1972" + Locale["ckb"]["script"] = "Arab" + Locale["ckb"]["rtl"] = "true" # RTL language + #52 Kyrgyz Locale["ky"]["name"] = "Kyrgyz" Locale["ky"]["endonym"] = "Кыргызча" @@ -1725,16 +1741,6 @@ function initLocale() { #Locale["tlh-Qaak"]["glotto"] Locale["tlh-Qaak"]["script"] = "Piqd" - #* Kurdish (Northern Kurdish / Kurmanji), Latin alphabet - Locale["kmr"]["support"] = "bing-only" - Locale["kmr"]["name"] = "Kurdish (Northern)" - Locale["kmr"]["name2"] = "Kurmanji" - Locale["kmr"]["endonym"] = "Kurmancî" - Locale["kmr"]["family"] = "Indo-European" - Locale["kmr"]["iso"] = "kmr" - Locale["kmr"]["glotto"] = "nort2641" - Locale["kmr"]["script"] = "Latn" - #? Bashkir Locale["ba"]["support"] = "yandex-only" Locale["ba"]["name"] = "Bashkir" From 30b0e84b39c34cc7b3e35c6081a64e242cc7ea6f Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:02:13 +0200 Subject: [PATCH 016/119] Languages: add Lingala --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index f64754b0..4def77b8 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -918,6 +918,19 @@ function initLocale() { Locale["lv"]["glotto"] = "latv1249" Locale["lv"]["script"] = "Latn" + # Lingala + Locale["ln"]["name"] = "Lingala" + Locale["ln"]["endonym"] = "Lingála" + #Locale["ln"]["translations-of"] + #Locale["ln"]["definitions-of"] + #Locale["ln"]["synonyms"] + #Locale["ln"]["examples"] + #Locale["ln"]["see-also"] + Locale["ln"]["family"] = "Atlantic-Congo" + Locale["ln"]["iso"] = "lin" + Locale["ln"]["glotto"] = "ling1269" + Locale["ln"]["script"] = "Latn" + #56 Lithuanian Locale["lt"]["name"] = "Lithuanian" Locale["lt"]["endonym"] = "Lietuvių" From 4570ccfa89b2187c8da2de08bddaa42129abbdbe Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:08:12 +0200 Subject: [PATCH 017/119] Languages: add Luganda --- include/Languages.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 4def77b8..98067062 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -944,6 +944,20 @@ function initLocale() { Locale["lt"]["glotto"] = "lith1251" Locale["lt"]["script"] = "Latn" + # Luganda + Locale["lg"]["name"] = "Luganda" + Locale["lg"]["endonym"] = "Luganda" + Locale["lg"]["endonym2"] = "Oluganda" + #Locale["lg"]["translations-of"] + #Locale["lg"]["definitions-of"] + #Locale["lg"]["synonyms"] + #Locale["lg"]["examples"] + #Locale["lg"]["see-also"] + Locale["lg"]["family"] = "Atlantic-Congo" + Locale["lg"]["iso"] = "lug" + Locale["lg"]["glotto"] = "gand1255" + Locale["lg"]["script"] = "Latn" + #57 Luxembourgish Locale["lb"]["name"] = "Luxembourgish" Locale["lb"]["endonym"] = "Lëtzebuergesch" From 394bf08be77fc2d1b3b75544608d80963a33bb6d Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:13:22 +0200 Subject: [PATCH 018/119] Languages: add Maithili --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 98067062..f7826795 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -984,6 +984,19 @@ function initLocale() { Locale["mk"]["glotto"] = "mace1250" Locale["mk"]["script"] = "Cyrl" + # Maithili + Locale["mai"]["name"] = "Maithili" + Locale["mai"]["endonym"] = "मैथिली" + #Locale["mai"]["translations-of"] + #Locale["mai"]["definitions-of"] + #Locale["mai"]["synonyms"] + #Locale["mai"]["examples"] + #Locale["mai"]["see-also"] + Locale["mai"]["family"] = "Indo-European" + Locale["mai"]["iso"] = "mai" + Locale["mai"]["glotto"] = "mait1250" + Locale["mai"]["script"] = "Deva" + #59 Malagasy (Plateau Malagasy) Locale["mg"]["name"] = "Malagasy" Locale["mg"]["endonym"] = "Malagasy" From 703b1a7715bb301f47882f79e5133589ea2f59ff Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:36:32 +0200 Subject: [PATCH 019/119] Languages: add Meiteilon --- include/Languages.awk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index f7826795..58c9d046 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1088,6 +1088,22 @@ function initLocale() { Locale["mn"]["glotto"] = "mong1331" Locale["mn"]["script"] = "Cyrl" + # Meiteilon / Manipuri + Locale["mni-Mtei"]["name"] = "Meiteilon" + Locale["mni-Mtei"]["name2"] = "Manipuri" + Locale["mni-Mtei"]["name3"] = "Meitei" + Locale["mni-Mtei"]["name4"] = "Meetei" + Locale["mni-Mtei"]["endonym"] = "ꯃꯤꯇꯩꯂꯣꯟ" + #Locale["mni-Mtei"]["translations-of"] + #Locale["mni-Mtei"]["definitions-of"] + #Locale["mni-Mtei"]["synonyms"] + #Locale["mni-Mtei"]["examples"] + #Locale["mni-Mtei"]["see-also"] + Locale["mni-Mtei"]["family"] = "Sino-Tibetan" + Locale["mni-Mtei"]["iso"] = "mni" + Locale["mni-Mtei"]["glotto"] = "mani1292" + Locale["mni-Mtei"]["script"] = "Mtei" + #66 Myanmar / Burmese Locale["my"]["name"] = "Myanmar" Locale["my"]["name2"] = "Burmese" @@ -2064,6 +2080,7 @@ function initLocaleAlias( i) { LocaleAlias["chinese"] = "zh-CN" LocaleAlias["tlh-Latn"] = "tlh" LocaleAlias["tlh-Piqd"] = "tlh-Qaak" + LocaleAlias["mni"] = "mni-Mtei" # Meitei: default to Meitei Mayek # TODO: more aliases } @@ -2213,6 +2230,7 @@ function scriptName(code) { case "Kore": return "Korean (Hangul + Han)" case "Laoo": return "Lao" case "Latn": return "Latin" + case "Mtei": return "Meitei Mayek" case "Mlym": return "Malayalam" case "Mymr": return "Myanmar" case "Orya": return "Oriya" From 0f3a39f3250dffe6ff2d98c80db73881b11d612b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:42:01 +0200 Subject: [PATCH 020/119] Languages: add Mizo --- include/Languages.awk | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index 58c9d046..97b8f5f9 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1075,19 +1075,6 @@ function initLocale() { Locale["mr"]["glotto"] = "mara1378" Locale["mr"]["script"] = "Deva" - #65 Mongolian, Cyrillic alphabet - Locale["mn"]["name"] = "Mongolian" - Locale["mn"]["endonym"] = "Монгол" - Locale["mn"]["translations-of"] = "%s-н орчуулга" - Locale["mn"]["definitions-of"] = "%s үгийн тодорхойлолт" - Locale["mn"]["synonyms"] = "Ойролцоо утгатай" - Locale["mn"]["examples"] = "Жишээнүүд" - Locale["mn"]["see-also"] = "Мөн харах" - Locale["mn"]["family"] = "Mongolic" - Locale["mn"]["iso"] = "mon" - Locale["mn"]["glotto"] = "mong1331" - Locale["mn"]["script"] = "Cyrl" - # Meiteilon / Manipuri Locale["mni-Mtei"]["name"] = "Meiteilon" Locale["mni-Mtei"]["name2"] = "Manipuri" @@ -1104,6 +1091,32 @@ function initLocale() { Locale["mni-Mtei"]["glotto"] = "mani1292" Locale["mni-Mtei"]["script"] = "Mtei" + # Mizo + Locale["lus"]["name"] = "Mizo" + Locale["lus"]["endonym"] = "Mizo ṭawng" + #Locale["lus"]["translations-of"] + #Locale["lus"]["definitions-of"] + #Locale["lus"]["synonyms"] + #Locale["lus"]["examples"] + #Locale["lus"]["see-also"] + Locale["lus"]["family"] = "Sino-Tibetan" + Locale["lus"]["iso"] = "lus" + Locale["lus"]["glotto"] = "lush1249" + Locale["lus"]["script"] = "Latn" + + #65 Mongolian, Cyrillic alphabet + Locale["mn"]["name"] = "Mongolian" + Locale["mn"]["endonym"] = "Монгол" + Locale["mn"]["translations-of"] = "%s-н орчуулга" + Locale["mn"]["definitions-of"] = "%s үгийн тодорхойлолт" + Locale["mn"]["synonyms"] = "Ойролцоо утгатай" + Locale["mn"]["examples"] = "Жишээнүүд" + Locale["mn"]["see-also"] = "Мөн харах" + Locale["mn"]["family"] = "Mongolic" + Locale["mn"]["iso"] = "mon" + Locale["mn"]["glotto"] = "mong1331" + Locale["mn"]["script"] = "Cyrl" + #66 Myanmar / Burmese Locale["my"]["name"] = "Myanmar" Locale["my"]["name2"] = "Burmese" From 0b9320056ed9db37aab509d0953b12be584ba168 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:45:24 +0200 Subject: [PATCH 021/119] Languages: update Oromo (Google support) --- include/Languages.awk | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index 97b8f5f9..14c2c290 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1170,6 +1170,19 @@ function initLocale() { Locale["or"]["glotto"] = "macr1269" Locale["or"]["script"] = "Orya" + # Oromo + Locale["om"]["name"] = "Oromo" + Locale["om"]["endonym"] = "Afaan Oromoo" + #Locale["om"]["translations-of"] + #Locale["om"]["definitions-of"] + #Locale["om"]["synonyms"] + #Locale["om"]["examples"] + #Locale["om"]["see-also"] + Locale["om"]["family"] = "Afro-Asiatic" + Locale["om"]["iso"] = "orm" + Locale["om"]["glotto"] = "nucl1736" + Locale["om"]["script"] = "Latn" + #70 Pashto / Pushto Locale["ps"]["name"] = "Pashto" Locale["ps"]["name2"] = "Pushto" @@ -1922,20 +1935,6 @@ function initLocale() { Locale["oc"]["glotto"] = "occi1239" Locale["oc"]["script"] = "Latn" - #? Oromo - Locale["om"]["support"] = "unstable" - Locale["om"]["name"] = "Oromo" - Locale["om"]["endonym"] = "Afaan Oromoo" - #Locale["om"]["translations-of"] - #Locale["om"]["definitions-of"] - #Locale["om"]["synonyms"] - #Locale["om"]["examples"] - #Locale["om"]["see-also"] - Locale["om"]["family"] = "Afro-Asiatic" - Locale["om"]["iso"] = "orm" - Locale["om"]["glotto"] = "nucl1736" - Locale["om"]["script"] = "Latn" - #? Papiamento Locale["pap"]["support"] = "yandex-only" Locale["pap"]["name"] = "Papiamento" From 7946cd86e049d1a5c95d722ff21c36b2e4ec5461 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:46:43 +0200 Subject: [PATCH 022/119] Languages: update Odia / Oriya (alternative name) --- include/Languages.awk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/Languages.awk b/include/Languages.awk index 14c2c290..1d8526f8 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1159,6 +1159,7 @@ function initLocale() { #69 Odia / Oriya Locale["or"]["name"] = "Odia" + Locale["or"]["name2"] = "Oriya" Locale["or"]["endonym"] = "ଓଡ଼ିଆ" #Locale["or"]["translations-of"] #Locale["or"]["definitions-of"] From 4af3b1287436947e96bb893e6bbc772bc391542d Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 16:55:31 +0200 Subject: [PATCH 023/119] Languages: add Quechua --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 1d8526f8..0e5bc20a 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1254,6 +1254,19 @@ function initLocale() { Locale["pa"]["glotto"] = "panj1256" Locale["pa"]["script"] = "Guru" + # Quechua + Locale["qu"]["name"] = "Quechua" + Locale["qu"]["endonym"] = "Runasimi" + #Locale["qu"]["translations-of"] + #Locale["qu"]["definitions-of"] + #Locale["qu"]["synonyms"] + #Locale["qu"]["examples"] + #Locale["qu"]["see-also"] + Locale["qu"]["family"] = "Quechuan" + Locale["qu"]["iso"] = "que" + Locale["qu"]["glotto"] = "quec1387" + Locale["qu"]["script"] = "Latn" + #75 Romanian Locale["ro"]["name"] = "Romanian" Locale["ro"]["endonym"] = "Română" From 239fc08292c490d42940a791abe3f6c631b63c16 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 17:09:54 +0200 Subject: [PATCH 024/119] Languages: add Sanskrit --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 0e5bc20a..415a7a28 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1307,6 +1307,19 @@ function initLocale() { Locale["sm"]["glotto"] = "samo1305" Locale["sm"]["script"] = "Latn" + # Sanskrit + Locale["sa"]["name"] = "Sanskrit" + Locale["sa"]["endonym"] = "संस्कृतम्" + #Locale["sa"]["translations-of"] + #Locale["sa"]["definitions-of"] + #Locale["sa"]["synonyms"] + #Locale["sa"]["examples"] + #Locale["sa"]["see-also"] + Locale["sa"]["family"] = "Indo-European" + Locale["sa"]["iso"] = "san" + Locale["sa"]["glotto"] = "sans1269" + Locale["sa"]["script"] = "Deva" + #78 Scots Gaelic Locale["gd"]["name"] = "Scots Gaelic" Locale["gd"]["endonym"] = "Gàidhlig" From b81a5840dab4ea66f4a05c3583823cd6f898711e Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 17:30:38 +0200 Subject: [PATCH 025/119] Languages: add Sepedi --- include/Languages.awk | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 415a7a28..e6986966 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1333,6 +1333,21 @@ function initLocale() { Locale["gd"]["glotto"] = "scot1245" Locale["gd"]["script"] = "Latn" + #80 Sepedi (Northern Sotho) + Locale["nso"]["name"] = "Sepedi" + Locale["nso"]["name2"] = "Pedi" + Locale["nso"]["name3"] = "Northern Sotho" + Locale["nso"]["endonym"] = "Sepedi" + #Locale["nso"]["translations-of"] + #Locale["nso"]["definitions-of"] + #Locale["nso"]["synonyms"] + #Locale["nso"]["examples"] + #Locale["nso"]["see-also"] + Locale["nso"]["family"] = "Atlantic-Congo" + Locale["nso"]["iso"] = "nso" + Locale["nso"]["glotto"] = "nort3233" + Locale["nso"]["script"] = "Latn" + #79a Serbian, Cyrillic alphabet Locale["sr-Cyrl"]["name"] = "Serbian (Cyrillic)" Locale["sr-Cyrl"]["endonym"] = "српски" @@ -1362,6 +1377,8 @@ function initLocale() { #80 Sesotho (Southern Sotho) Locale["st"]["name"] = "Sesotho" + Locale["st"]["name2"] = "Sotho" + Locale["st"]["name3"] = "Southern Sotho" Locale["st"]["endonym"] = "Sesotho" Locale["st"]["translations-of"] = "Liphetolelo tsa %s" Locale["st"]["definitions-of"] = "Meelelo ea %s" From 3c8be0f37f25aaf1c5974dec556e3d9d53c63336 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 17:34:55 +0200 Subject: [PATCH 026/119] Languages: update Tigrinya (Google support) --- include/Languages.awk | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index e6986966..ad8de939 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1590,6 +1590,19 @@ function initLocale() { Locale["th"]["glotto"] = "thai1261" Locale["th"]["script"] = "Thai" + # Tigrinya + Locale["ti"]["name"] = "Tigrinya" + Locale["ti"]["endonym"] = "ትግርኛ" + #Locale["ti"]["translations-of"] + #Locale["ti"]["definitions-of"] + #Locale["ti"]["synonyms"] + #Locale["ti"]["examples"] + #Locale["ti"]["see-also"] + Locale["ti"]["family"] = "Afro-Asiatic" + Locale["ti"]["iso"] = "tir" + Locale["ti"]["glotto"] = "tigr1271" + Locale["ti"]["script"] = "Ethi" + #96 Turkish Locale["tr"]["name"] = "Turkish" Locale["tr"]["endonym"] = "Türkçe" @@ -2007,20 +2020,6 @@ function initLocale() { Locale["rm"]["glotto"] = "roma1326" Locale["rm"]["script"] = "Latn" - #? Tigrinya - Locale["ti"]["support"] = "unstable" - Locale["ti"]["name"] = "Tigrinya" - Locale["ti"]["endonym"] = "ትግርኛ" - #Locale["ti"]["translations-of"] - #Locale["ti"]["definitions-of"] - #Locale["ti"]["synonyms"] - #Locale["ti"]["examples"] - #Locale["ti"]["see-also"] - Locale["ti"]["family"] = "Afro-Asiatic" - Locale["ti"]["iso"] = "tir" - Locale["ti"]["glotto"] = "tigr1271" - Locale["ti"]["script"] = "Ethi" - #? Tibetan (Standard Tibetan) Locale["bo"]["support"] = "unstable" Locale["bo"]["name"] = "Tibetan" From caa435e8184a30c80eeea910c94a20ad48bc1363 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 17:42:21 +0200 Subject: [PATCH 027/119] Languages: add Tsonga --- include/Languages.awk | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index ad8de939..f79a08b4 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1603,6 +1603,19 @@ function initLocale() { Locale["ti"]["glotto"] = "tigr1271" Locale["ti"]["script"] = "Ethi" + # Tsonga + Locale["ts"]["name"] = "Tsonga" + Locale["ts"]["endonym"] = "Xitsonga" + #Locale["ts"]["translations-of"] + #Locale["ts"]["definitions-of"] + #Locale["ts"]["synonyms"] + #Locale["ts"]["examples"] + #Locale["ts"]["see-also"] + Locale["ts"]["family"] = "Atlantic–Congo" + Locale["ts"]["iso"] = "tso" + Locale["ts"]["glotto"] = "tson1249" + Locale["ts"]["script"] = "Latn" + #96 Turkish Locale["tr"]["name"] = "Turkish" Locale["tr"]["endonym"] = "Türkçe" From ed1710266d8bb19a8f40e4ffbf11b17de4710498 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Jun 2022 17:48:48 +0200 Subject: [PATCH 028/119] Languages: add Twi --- include/Languages.awk | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index f79a08b4..007c03a7 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -1642,6 +1642,20 @@ function initLocale() { Locale["tk"]["glotto"] = "turk1304" Locale["tk"]["script"] = "Latn" + # Twi + Locale["tw"]["name"] = "Twi" + Locale["tw"]["name2"] = "Akan Kasa" + Locale["tw"]["endonym"] = "Twi" + #Locale["tw"]["translations-of"] + #Locale["tw"]["definitions-of"] + #Locale["tw"]["synonyms"] + #Locale["tw"]["examples"] + #Locale["tw"]["see-also"] + Locale["tw"]["family"] = "Atlantic-Congo" + Locale["tw"]["iso"] = "twi" + Locale["tw"]["glotto"] = "akua1239" + Locale["tw"]["script"] = "Latn" + #98 Ukrainian Locale["uk"]["name"] = "Ukrainian" Locale["uk"]["endonym"] = "Українська" From d7a635c0323bcd40b46449a913c444b09f398f36 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 14:54:31 +0200 Subject: [PATCH 029/119] Translators/BingTranslator: update (close #319, #406) --- include/Translators/BingTranslator.awk | 41 ++++++++++++++++++++------ 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index c316dea5..833cc7b4 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -2,7 +2,7 @@ # BingTranslator.awk # #################################################################### # -# Last Updated: 25 Jul 2019 +# Last Updated: 8 Jun 2022 BEGIN { provides("bing") } function bingInit() { @@ -11,9 +11,9 @@ function bingInit() { HttpPort = 80 } -# [OBSOLETE?] Retrieve the Cookie and set IG. -function bingSetIG( content, cookie, group, header, isBody, - url, status, location) { +# Set IG, IID, and BingTokenKey (a URL-encoded string containing token and key). +function bingSetup( ast, content, cookie, group, header, isBody, key, + location, status, token, tokens, url) { url = HttpPathPrefix "/translator" header = "GET " url " HTTP/1.1\r\n" \ @@ -46,13 +46,36 @@ function bingSetIG( content, cookie, group, header, isBody, if ((status == "301" || status == "302") && location) content = curl(location) # FIXME: cookie - Cookie = cookie + match(content, /IG:"([^"]+)"/, group) if (group[1]) { IG = group[1] + l(IG, "IG") } else { - e("[ERROR] Oops! Something went wrong and I can't translate it for you :(") + e("[ERROR] Failed to extract IG.") + exit 1 + } + + match(content, /data-iid="([^"]+)"/, group) + if (group[1]) { + IID = group[1] + l(IID, "IID") + } else { + e("[ERROR] Failed to extract IID.") + exit 1 + } + + match(content, /params_RichTranslateHelper = ([^;]+);/, group) + if (group[1]) { + tokenize(tokens, group[1]) + parseJson(ast, tokens) + key = ast[0 SUBSEP 0] + token = unparameterize(ast[0 SUBSEP 1]) + BingTokenKey = sprintf("&token=%s&key=%s", quote(token), quote(key)) + l(BingTokenKey, "BingTokenKey") + } else { + e("[ERROR] Failed to extract token & key.") exit 1 } } @@ -151,7 +174,7 @@ function bingPostRequestUrl(text, sl, tl, hl, type) { #else if (type == "transliterate") # return HttpPathPrefix "/ttransliteratev3" else # type == "translate" - return HttpPathPrefix "/ttranslatev3" + return HttpPathPrefix "/ttranslatev3" sprintf("?IG=%s&IID=%s", IG, IID) } function bingPostRequestContentType(text, sl, tl, hl, type) { @@ -168,7 +191,7 @@ function bingPostRequestBody(text, sl, tl, hl, type) { #else if (type == "transliterate") # return "&text=" quote(text) "&language=" sl "&toScript=" "latn" else # type == "translate" - return "&text=" quote(text) "&fromLang=" sl "&to=" tl + return "&text=" quote(text) "&fromLang=" sl "&to=" tl BingTokenKey } # Get the translation of a string. @@ -199,7 +222,7 @@ function bingTranslate(text, sl, tl, hl, _tl = getCode(tl); if (!_tl) _tl = tl _hl = getCode(hl); if (!_hl) _hl = hl - #bingSetIG() # set IG (no longer needed) + bingSetup() # Hot-patches for Bing's own translator language codes # See: From 63cd59233a4e0273ce4b3fef7bd3199ebb885b85 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 15:02:40 +0200 Subject: [PATCH 030/119] =?UTF-8?q?Languages:=20=E6=AD=A3=E9=AB=94?= =?UTF-8?q?=E4=B8=AD=E6=96=87=20->=20=E7=B9=81=E9=AB=94=E4=B8=AD=E6=96=87?= =?UTF-8?q?=20(close=20#438)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/Languages.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Languages.awk b/include/Languages.awk index 007c03a7..438ed9b9 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -266,7 +266,7 @@ function initLocale() { #15b Chinese (Mandarin), Traditional Locale["zh-TW"]["name"] = "Chinese Traditional" - Locale["zh-TW"]["endonym"] = "正體中文" + Locale["zh-TW"]["endonym"] = "繁體中文" Locale["zh-TW"]["translations-of"] = "「%s」的翻譯" Locale["zh-TW"]["definitions-of"] = "「%s」的定義" Locale["zh-TW"]["synonyms"] = "同義詞" From 7fc12b45937ae9caa70e71d907fd0787115a8f50 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 15:18:25 +0200 Subject: [PATCH 031/119] Languages: add endonym2 to LocaleAlias --- include/Languages.awk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/Languages.awk b/include/Languages.awk index 438ed9b9..30d3db67 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -267,6 +267,7 @@ function initLocale() { #15b Chinese (Mandarin), Traditional Locale["zh-TW"]["name"] = "Chinese Traditional" Locale["zh-TW"]["endonym"] = "繁體中文" + Locale["zh-TW"]["endonym2"] = "正體中文" Locale["zh-TW"]["translations-of"] = "「%s」的翻譯" Locale["zh-TW"]["definitions-of"] = "「%s」的定義" Locale["zh-TW"]["synonyms"] = "同義詞" @@ -2135,6 +2136,8 @@ function initLocaleAlias( i) { if ("name2" in Locale[i]) LocaleAlias[tolower(Locale[i]["name2"])] = i LocaleAlias[tolower(Locale[i]["endonym"])] = i + if ("endonym2" in Locale[i]) + LocaleAlias[tolower(Locale[i]["endonym2"])] = i } # Other aliases From 03a0ca8f3e5679268866d6f793b6e8be655cc787 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 15:34:20 +0200 Subject: [PATCH 032/119] Help: fix formatting of reference table --- include/Help.awk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/Help.awk b/include/Help.awk index 6b848d57..d27d9a46 100644 --- a/include/Help.awk +++ b/include/Help.awk @@ -270,7 +270,10 @@ function getReference(displayName, if (length(t1) > 17) t1 = substr(t1, 1, 14) "..." switch (cols[j][i]) { # fix rendered text width - case "he": + case "sa": + t1 = sprintf(" %-21s", t1) + break + case "he": case "dv": t1 = sprintf(" %-20s", t1) break case "or": case "ur": @@ -278,7 +281,8 @@ function getReference(displayName, break case "hi": case "gu": case "km": case "kn": case "my": case "ne": case "pa": case "si": - case "ta": case "te": case "yi": + case "ta": case "te": case "yi": case "as": + case "bho": case "mai": case "gom": t1 = sprintf(" %-18s", t1) break case "yue": From c615472b6faf52ee3a64f21e3143c797a3899105 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 21:30:05 +0200 Subject: [PATCH 033/119] Languages: update section A --- include/Languages.awk | 79 ++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 27 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index 30d3db67..788ad21b 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -14,7 +14,7 @@ # function initLocale() { - #1 Afrikaans + # Afrikaans Locale["af"]["name"] = "Afrikaans" Locale["af"]["endonym"] = "Afrikaans" Locale["af"]["translations-of"] = "Vertalings van %s" @@ -23,24 +23,31 @@ function initLocale() { Locale["af"]["examples"] = "Voorbeelde" Locale["af"]["see-also"] = "Sien ook" Locale["af"]["family"] = "Indo-European" + Locale["af"]["branch"] = "West Germanic" Locale["af"]["iso"] = "afr" Locale["af"]["glotto"] = "afri1274" Locale["af"]["script"] = "Latn" + Locale["af"]["spoken-in"] = "South Africa; Namibia" + Locale["af"]["supported-by"] = "google; bing; yandex" - #2 Albanian + # Albanian Locale["sq"]["name"] = "Albanian" Locale["sq"]["endonym"] = "Shqip" + Locale["sq"]["endonym2"] = "Gjuha shqipe" Locale["sq"]["translations-of"] = "Përkthimet e %s" Locale["sq"]["definitions-of"] = "Përkufizime të %s" Locale["sq"]["synonyms"] = "Sinonime" Locale["sq"]["examples"] = "Shembuj" Locale["sq"]["see-also"] = "Shihni gjithashtu" Locale["sq"]["family"] = "Indo-European" + Locale["sq"]["branch"] = "Paleo-Balkan" Locale["sq"]["iso"] = "sqi" Locale["sq"]["glotto"] = "alba1267" Locale["sq"]["script"] = "Latn" + Locale["sq"]["spoken-in"] = "Albania; Kosovo; Montenegro; North Macedonia" + Locale["sq"]["supported-by"] = "google; bing; yandex" - #3 Amharic + # Amharic Locale["am"]["name"] = "Amharic" Locale["am"]["endonym"] = "አማርኛ" Locale["am"]["translations-of"] = "የ %s ትርጉሞች" @@ -49,11 +56,14 @@ function initLocale() { Locale["am"]["examples"] = "ምሳሌዎች" Locale["am"]["see-also"] = "የሚከተለውንም ይመልከቱ" Locale["am"]["family"] = "Afro-Asiatic" + Locale["am"]["branch"] = "Semitic" Locale["am"]["iso"] = "amh" Locale["am"]["glotto"] = "amha1245" Locale["am"]["script"] = "Ethi" + Locale["am"]["spoken-in"] = "Ethiopia" + Locale["am"]["supported-by"] = "google; bing; yandex" - #4 Arabic (Standard Arabic) + # Arabic (Modern Standard Arabic) Locale["ar"]["name"] = "Arabic" Locale["ar"]["endonym"] = "العربية" Locale["ar"]["translations-of"] = "ترجمات %s" @@ -62,12 +72,15 @@ function initLocale() { Locale["ar"]["examples"] = "أمثلة" Locale["ar"]["see-also"] = "انظر أيضًا" Locale["ar"]["family"] = "Afro-Asiatic" + Locale["ar"]["branch"] = "Semitic" Locale["ar"]["iso"] = "ara" Locale["ar"]["glotto"] = "stan1318" Locale["ar"]["script"] = "Arab" Locale["ar"]["rtl"] = "true" # RTL language + Locale["ar"]["spoken-in"] = "the Arab world" + Locale["ar"]["supported-by"] = "google; bing; yandex" - #5 Armenian (Modern Armenian) + # Armenian (Eastern Armenian) Locale["hy"]["name"] = "Armenian" Locale["hy"]["endonym"] = "Հայերեն" Locale["hy"]["translations-of"] = "%s-ի թարգմանությունները" @@ -76,9 +89,12 @@ function initLocale() { Locale["hy"]["examples"] = "Օրինակներ" Locale["hy"]["see-also"] = "Տես նաև" Locale["hy"]["family"] = "Indo-European" + #Locale["hy"]["branch"] = "Armenian" Locale["hy"]["iso"] = "hye" Locale["hy"]["glotto"] = "nucl1235" Locale["hy"]["script"] = "Armn" + Locale["hy"]["spoken-in"] = "Armenia" + Locale["hy"]["supported-by"] = "google; bing; yandex" # Assamese Locale["as"]["name"] = "Assamese" @@ -89,9 +105,12 @@ function initLocale() { #Locale["as"]["examples"] #Locale["as"]["see-also"] Locale["as"]["family"] = "Indo-European" + Locale["as"]["branch"] = "Indo-Aryan" Locale["as"]["iso"] = "asm" Locale["as"]["glotto"] = "assa1263" Locale["as"]["script"] = "Beng" + Locale["as"]["spoken-in"] = "the northeast Indian state of Assam" + Locale["as"]["supported-by"] = "google; bing" # Aymara Locale["ay"]["name"] = "Aymara" @@ -102,11 +121,14 @@ function initLocale() { #Locale["ay"]["examples"] #Locale["ay"]["see-also"] Locale["ay"]["family"] = "Aymaran" + #Locale["ay"]["branch"] = "Aymaran" Locale["ay"]["iso"] = "aym" Locale["ay"]["glotto"] = "nucl1667" Locale["ay"]["script"] = "Latn" + Locale["ay"]["spoken-in"] = "Bolivia; Peru" + Locale["ay"]["supported-by"] = "google" - #6 Azerbaijani (North Azerbaijani) + # Azerbaijani (North Azerbaijani) Locale["az"]["name"] = "Azerbaijani" Locale["az"]["endonym"] = "Azərbaycanca" Locale["az"]["translations-of"] = "%s sözünün tərcüməsi" @@ -115,9 +137,12 @@ function initLocale() { Locale["az"]["examples"] = "Nümunələr" Locale["az"]["see-also"] = "Həmçinin, baxın:" Locale["az"]["family"] = "Turkic" + Locale["az"]["branch"] = "Oghuz" Locale["az"]["iso"] = "aze" Locale["az"]["glotto"] = "nort2697" Locale["az"]["script"] = "Latn" + Locale["az"]["spoken-in"] = "Azerbaijan" + Locale["az"]["supported-by"] = "google; bing; yandex" # Bambara Locale["bm"]["name"] = "Bambara" @@ -1823,13 +1848,13 @@ function initLocale() { Locale["prs"]["rtl"] = "true" # RTL language #* Fijian - Locale["fj"]["support"] = "bing-only" - Locale["fj"]["name"] = "Fijian" - Locale["fj"]["endonym"] = "Vosa Vakaviti" - Locale["fj"]["family"] = "Austronesian" - Locale["fj"]["iso"] = "fij" - Locale["fj"]["glotto"] = "fiji1243" - Locale["fj"]["script"] = "Latn" + Locale["fj"]["support"] = "bing-only" + Locale["fj"]["name"] = "Fijian" + Locale["fj"]["endonym"] = "Vosa Vakaviti" + Locale["fj"]["family"] = "Austronesian" + Locale["fj"]["iso"] = "fij" + Locale["fj"]["glotto"] = "fiji1243" + Locale["fj"]["script"] = "Latn" #* Hmong Daw (White Hmong) Locale["mww"]["support"] = "bing-only" @@ -1864,22 +1889,22 @@ function initLocale() { Locale["otq"]["script"] = "Latn" #* Tahitian - Locale["ty"]["support"] = "bing-only" - Locale["ty"]["name"] = "Tahitian" - Locale["ty"]["endonym"] = "Reo Tahiti" - Locale["ty"]["family"] = "Austronesian" - Locale["ty"]["iso"] = "tah" - Locale["ty"]["glotto"] = "tahi1242" - Locale["ty"]["script"] = "Latn" + Locale["ty"]["support"] = "bing-only" + Locale["ty"]["name"] = "Tahitian" + Locale["ty"]["endonym"] = "Reo Tahiti" + Locale["ty"]["family"] = "Austronesian" + Locale["ty"]["iso"] = "tah" + Locale["ty"]["glotto"] = "tahi1242" + Locale["ty"]["script"] = "Latn" #* Tongan - Locale["to"]["support"] = "bing-only" - Locale["to"]["name"] = "Tongan" - Locale["to"]["endonym"] = "Lea faka-Tonga" - Locale["to"]["family"] = "Austronesian" - Locale["to"]["iso"] = "ton" - Locale["to"]["glotto"] = "tong1325" - Locale["to"]["script"] = "Latn" + Locale["to"]["support"] = "bing-only" + Locale["to"]["name"] = "Tongan" + Locale["to"]["endonym"] = "Lea faka-Tonga" + Locale["to"]["family"] = "Austronesian" + Locale["to"]["iso"] = "ton" + Locale["to"]["glotto"] = "tong1325" + Locale["to"]["script"] = "Latn" #* Yucatec Maya Locale["yua"]["support"] = "bing-only" From 7ade29101390ad5bdb68526f3c898b5d89e55f76 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 22:37:39 +0200 Subject: [PATCH 034/119] Languages: improve getDetails() --- include/Languages.awk | 64 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 2 deletions(-) diff --git a/include/Languages.awk b/include/Languages.awk index 788ad21b..eaa2cdf0 100644 --- a/include/Languages.awk +++ b/include/Languages.awk @@ -2281,6 +2281,11 @@ function getFamily(code) { return Locale[getCode(code)]["family"] } +# Return the branch of a language. +function getBranch(code) { + return Locale[getCode(code)]["branch"] +} + # Return the ISO 639-3 code of a language. function getISO(code) { return Locale[getCode(code)]["iso"] @@ -2355,8 +2360,49 @@ function scriptName(code) { } } +# Return the regions that a language is spoken in, as an English string. +function getSpokenIn(code, i, j, r, regions, str) { + r = NULLSTR + str = Locale[getCode(code)]["spoken-in"] + if (str) { + split(str, regions, /\s?;\s?/) + j = 0 + for (i in regions) { + r = r regions[i] + j++ + if (j < length(regions) - 1) + r = r ", " + else if (j == length(regions) - 1) + r = r " and " + } + } + return r +} + +# Return 1 if a language is supported by Google; otherwise return 0. +function isSupportedByGoogle(code, engines, i, str) { + str = Locale[getCode(code)]["supported-by"] + if (str) { + split(str, engines, /\s?;\s?/) + for (i in engines) + if (engines[i] == "google") return 1 + } + return 0 +} + +# Return 1 if a language is supported by Bing; otherwise return 0. +function isSupportedByBing(code, engines, i, str) { + str = Locale[getCode(code)]["supported-by"] + if (str) { + split(str, engines, /\s?;\s?/) + for (i in engines) + if (engines[i] == "bing") return 1 + } + return 0 +} + # Return detailed information of a language as a string. -function getDetails(code, group, iso, script) { +function getDetails(code, article, desc, group, iso, script) { if (code == "auto" || !getCode(code)) { e("[ERROR] Language not found: " code "\n" \ " Run '-reference / -R' to see a list of available languages.") @@ -2367,6 +2413,15 @@ function getDetails(code, group, iso, script) { if (isRTL(code)) script = script " (R-to-L)" split(getISO(code), group, "-") iso = group[1] + + if (getBranch(code)) { + article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" + desc = sprintf("%s is %s %s language spoken mainly in %s.", + getNames(code), article, getBranch(code), getSpokenIn(code)) + } else + desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", + getNames(code), getFamily(code), getSpokenIn(code)) + return ansi("bold", sprintf("%s\n", getDisplay(code))) \ sprintf("%-22s%s\n", "Name", ansi("bold", getNames(code))) \ sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code))) \ @@ -2376,7 +2431,12 @@ function getDetails(code, group, iso, script) { sprintf("%-22s%s\n", "SIL", ansi("bold", "https://iso639-3.sil.org/code/" iso)) \ sprintf("%-22s%s\n", "Glottolog", getGlotto(code) ? ansi("bold", "https://glottolog.org/resource/languoid/id/" getGlotto(code)) : "") \ - sprintf("%-22s%s", "Wikipedia", ansi("bold", "https://en.wikipedia.org/wiki/ISO_639:" iso)) + sprintf("%-22s%s\n", "Wikipedia", ansi("bold", "https://en.wikipedia.org/wiki/ISO_639:" iso)) \ + (Locale[getCode(code)]["supported-by"] ? # FIXME + sprintf("%-22s%s\n", "Translator support", sprintf("Google [%s] Bing [%s]", + isSupportedByGoogle(code) ? "✔" : "✘", isSupportedByBing(code) ? "✔" : "✘")) : "") \ + (Locale[getCode(code)]["spoken-in"] ? # FIXME + ansi("bold", sprintf("\n%s", desc)) : "") } # Add /slashes/ for IPA phonemic notations and (parentheses) for others. From ce0ee52e62ec7cff02a76f936627b930061857cc Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 22:58:14 +0200 Subject: [PATCH 035/119] split Languages to LanguageData and LanguageHelper --- build.awk | 3 +- include/{Languages.awk => LanguageData.awk} | 346 +---------------- include/LanguageHelper.awk | 347 ++++++++++++++++++ include/Main.awk | 4 +- test/Test.awk | 2 +- ...stLanguages.awk => TestLanguageHelper.awk} | 5 +- translate | 3 +- translate.awk | 3 +- 8 files changed, 360 insertions(+), 353 deletions(-) rename include/{Languages.awk => LanguageData.awk} (89%) create mode 100644 include/LanguageHelper.awk rename test/{TestLanguages.awk => TestLanguageHelper.awk} (79%) diff --git a/build.awk b/build.awk index 448397ac..4012ce53 100755 --- a/build.awk +++ b/build.awk @@ -4,7 +4,8 @@ # But the build.awk script and the single build should support gawk 4.0+. @include "include/Commons.awk" @include "include/Utils.awk" -@include "include/Languages.awk" +@include "include/LanguageData.awk" +@include "include/LanguageHelper.awk" @include "metainfo.awk" function init() { diff --git a/include/Languages.awk b/include/LanguageData.awk similarity index 89% rename from include/Languages.awk rename to include/LanguageData.awk index eaa2cdf0..db4de0a3 100644 --- a/include/Languages.awk +++ b/include/LanguageData.awk @@ -1,5 +1,5 @@ #################################################################### -# Languages.awk # +# LanguageData.awk # #################################################################### # Initialize all locales supported. @@ -2200,347 +2200,3 @@ function initLocaleDisplay( i) { Locale[i]["display"] = show(Locale[i]["endonym"], i) } } - -# Get locale key by language code or alias. -function getCode(code, group) { - if (code == "auto" || code in Locale) - return code - else if (code in LocaleAlias) - return LocaleAlias[code] - else if (tolower(code) in LocaleAlias) - return LocaleAlias[tolower(code)] - - # Remove unidentified region or script code - match(code, /^([[:alpha:]][[:alpha:]][[:alpha:]]?)-(.*)$/, group) - if (group[1]) - return group[1] - - return # return nothing if not found -} - -# Return the name of a language. -function getName(code) { - return Locale[getCode(code)]["name"] -} - -# Return all the names of a language, separated by "/" -function getNames(code) { - if ("name2" in Locale[getCode(code)]) - return Locale[getCode(code)]["name"] " / " Locale[getCode(code)]["name2"] - else - return Locale[getCode(code)]["name"] -} - -# Return the endonym of a language. -function getEndonym(code) { - return Locale[getCode(code)]["endonym"] -} - -# Return the string for displaying the endonym of a language. -function getDisplay(code) { - return Locale[getCode(code)]["display"] -} - -# Return formatted text for "translations of". -function showTranslationsOf(code, text, fmt) { - fmt = Locale[getCode(code)]["translations-of"] - if (!fmt) fmt = Locale["en"]["translations-of"] - return sprintf(fmt, text) -} - -# Return formatted text for "definitions of". -function showDefinitionsOf(code, text, fmt) { - fmt = Locale[getCode(code)]["definitions-of"] - if (!fmt) fmt = Locale["en"]["definitions-of"] - return sprintf(fmt, text) -} - -# Return a string of "synonyms". -function showSynonyms(code, tmp) { - tmp = Locale[getCode(code)]["synonyms"] - if (!tmp) tmp = Locale["en"]["synonyms"] - return tmp -} - -# Return a string of "examples". -function showExamples(code, tmp) { - tmp = Locale[getCode(code)]["examples"] - if (!tmp) tmp = Locale["en"]["examples"] - return tmp -} - -# Return a string of "see also". -function showSeeAlso(code, tmp) { - tmp = Locale[getCode(code)]["see-also"] - if (!tmp) tmp = Locale["en"]["see-also"] - return tmp -} - -# Return the family of a language. -function getFamily(code) { - return Locale[getCode(code)]["family"] -} - -# Return the branch of a language. -function getBranch(code) { - return Locale[getCode(code)]["branch"] -} - -# Return the ISO 639-3 code of a language. -function getISO(code) { - return Locale[getCode(code)]["iso"] -} - -# Return the Glottocode of a language. -function getGlotto(code) { - return Locale[getCode(code)]["glotto"] -} - -# Return the ISO 15924 script code of a language. -function getScript(code) { - return Locale[getCode(code)]["script"] -} - -# Return 1 if a language is R-to-L; otherwise return 0. -function isRTL(code) { - return Locale[getCode(code)]["rtl"] ? 1 : 0 -} - -# Return 1 if Google provides dictionary data for a language; otherwise return 0. -function hasDictionary(code) { - return Locale[getCode(code)]["dictionary"] ? 1 : 0 -} - -# Comparator using getName(). -function compName(i1, v1, i2, v2) { - if (getName(i1) < getName(i2)) - return -1 - else - return (getName(i1) != getName(i2)) -} - -# Return the name of script (writing system). -# See: -# -function scriptName(code) { - switch (code) { - case "Arab": return "Arabic" - case "Armn": return "Armenian" - case "Beng": return "Bengali" - case "Cher": return "Cherokee" - case "Cyrl": return "Cyrillic" - case "Deva": return "Devanagari" - case "Ethi": return "Ethiopic (Geʻez)" - case "Geor": return "Georgian (Mkhedruli)" - case "Grek": return "Greek" - case "Gujr": return "Gujarati" - case "Guru": return "Gurmukhi" - case "Hani": return "Han" - case "Hans": return "Han (Simplified)" - case "Hant": return "Han (Traditional)" - case "Hebr": return "Hebrew" - case "Jpan": return "Japanese (Han + Hiragana + Katakana)" - case "Khmr": return "Khmer" - case "Knda": return "Kannada" - case "Kore": return "Korean (Hangul + Han)" - case "Laoo": return "Lao" - case "Latn": return "Latin" - case "Mtei": return "Meitei Mayek" - case "Mlym": return "Malayalam" - case "Mymr": return "Myanmar" - case "Orya": return "Oriya" - case "Piqd": return "Klingon (pIqaD)" - case "Sinh": return "Sinhala" - case "Taml": return "Tamil" - case "Telu": return "Telugu" - case "Thaa": return "Thaana" - case "Thai": return "Thai" - case "Tibt": return "Tibetan" - default: return "Unknown" - } -} - -# Return the regions that a language is spoken in, as an English string. -function getSpokenIn(code, i, j, r, regions, str) { - r = NULLSTR - str = Locale[getCode(code)]["spoken-in"] - if (str) { - split(str, regions, /\s?;\s?/) - j = 0 - for (i in regions) { - r = r regions[i] - j++ - if (j < length(regions) - 1) - r = r ", " - else if (j == length(regions) - 1) - r = r " and " - } - } - return r -} - -# Return 1 if a language is supported by Google; otherwise return 0. -function isSupportedByGoogle(code, engines, i, str) { - str = Locale[getCode(code)]["supported-by"] - if (str) { - split(str, engines, /\s?;\s?/) - for (i in engines) - if (engines[i] == "google") return 1 - } - return 0 -} - -# Return 1 if a language is supported by Bing; otherwise return 0. -function isSupportedByBing(code, engines, i, str) { - str = Locale[getCode(code)]["supported-by"] - if (str) { - split(str, engines, /\s?;\s?/) - for (i in engines) - if (engines[i] == "bing") return 1 - } - return 0 -} - -# Return detailed information of a language as a string. -function getDetails(code, article, desc, group, iso, script) { - if (code == "auto" || !getCode(code)) { - e("[ERROR] Language not found: " code "\n" \ - " Run '-reference / -R' to see a list of available languages.") - exit 1 - } - - script = scriptName(getScript(code)) - if (isRTL(code)) script = script " (R-to-L)" - split(getISO(code), group, "-") - iso = group[1] - - if (getBranch(code)) { - article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" - desc = sprintf("%s is %s %s language spoken mainly in %s.", - getNames(code), article, getBranch(code), getSpokenIn(code)) - } else - desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", - getNames(code), getFamily(code), getSpokenIn(code)) - - return ansi("bold", sprintf("%s\n", getDisplay(code))) \ - sprintf("%-22s%s\n", "Name", ansi("bold", getNames(code))) \ - sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code))) \ - sprintf("%-22s%s\n", "Writing system", ansi("bold", script)) \ - sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code))) \ - sprintf("%-22s%s\n", "ISO 639-3", ansi("bold", iso)) \ - sprintf("%-22s%s\n", "SIL", ansi("bold", "https://iso639-3.sil.org/code/" iso)) \ - sprintf("%-22s%s\n", "Glottolog", getGlotto(code) ? - ansi("bold", "https://glottolog.org/resource/languoid/id/" getGlotto(code)) : "") \ - sprintf("%-22s%s\n", "Wikipedia", ansi("bold", "https://en.wikipedia.org/wiki/ISO_639:" iso)) \ - (Locale[getCode(code)]["supported-by"] ? # FIXME - sprintf("%-22s%s\n", "Translator support", sprintf("Google [%s] Bing [%s]", - isSupportedByGoogle(code) ? "✔" : "✘", isSupportedByBing(code) ? "✔" : "✘")) : "") \ - (Locale[getCode(code)]["spoken-in"] ? # FIXME - ansi("bold", sprintf("\n%s", desc)) : "") -} - -# Add /slashes/ for IPA phonemic notations and (parentheses) for others. -# Parameters: -# code -function showPhonetics(phonetics, code) { - if (code && getCode(code) == "en") - return "/" phonetics "/" - else - return "(" phonetics ")" -} - -# Convert a logical string to visual; don't right justify RTL lines. -# Parameters: -# code: ignore to apply bidirectional algorithm on every string -function show(text, code, command, temp) { - if (!code || isRTL(code)) { - if (Cache[text][0]) - return Cache[text][0] - else { - if ((FriBidi || (code && isRTL(code))) && BiDiNoPad) { - command = "echo " parameterize(text) PIPE BiDiNoPad - command | getline temp - close(command) - } else # non-RTL language, or FriBidi not installed - temp = text - return Cache[text][0] = temp - } - } else - return text -} - -# Convert a logical string to visual and right justify RTL lines. -# Parameters: -# code: ignore to apply bidirectional algorithm on every string -# width: ignore to use default width for padding -function s(text, code, width, command, temp) { - if (!code || isRTL(code)) { - if (!width) width = Option["width"] - if (Cache[text][width]) - return Cache[text][width] - else { - if ((FriBidi || (code && isRTL(code))) && BiDi) { - command = "echo " parameterize(text) PIPE sprintf(BiDi, width) - command | getline temp - close(command) - } else # non-RTL language, or FriBidi not installed - temp = text - return Cache[text][width] = temp - } - } else - return text -} - -# Convert a logical string to visual with a certain level of indentation. -# Parameters: -# level: level of indentation -# code: ignore to apply left indentation -# width: ignore to use default width for padding -function ins(level, text, code, width, i, temp) { - if (code && isRTL(code)) { - if (!width) width = Option["width"] - return s(text, code, width - Option["indent"] * level) - } else - return replicate(" ", Option["indent"] * level) text -} - -# Parse a POSIX locale identifier and return the language code; -# Identified by both language identifier and region identifier. -# Parameters: -# lang = [language[_territory][.codeset][@modifier]] -# See: -function parseLang(lang, code, group) { - match(lang, /^([a-z][a-z][a-z]?)(_|$)/, group) - code = getCode(group[1]) - - # Detect region identifier - ## Regions using Chinese Simplified: China, Singapore - if (lang ~ /^zh_(CN|SG)/) code = "zh-CN" - ## Regions using Chinese Traditional: Taiwan, Hong Kong - else if (lang ~ /^zh_(TW|HK)/) code = "zh-TW" - - # FIXME: handle unrecognized language code - if (!code) code = "en" - - return code -} - -# Initialize `UserLang`. -function initUserLang( lang, utf) { - if (lang = ENVIRON["LC_ALL"]) { - if (!UserLocale) UserLocale = lang - utf = utf || tolower(lang) ~ /utf-?8$/ - } - if (lang = ENVIRON["LANG"]) { - if (!UserLocale) UserLocale = lang - utf = utf || tolower(lang) ~ /utf-?8$/ - } - if (!UserLocale) { - UserLocale = "en_US.UTF-8" - utf = 1 - } - if (!utf) - w("[WARNING] Your locale codeset (" UserLocale ") is not UTF-8.") - - UserLang = parseLang(UserLocale) -} diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk new file mode 100644 index 00000000..233d6de9 --- /dev/null +++ b/include/LanguageHelper.awk @@ -0,0 +1,347 @@ +#################################################################### +# LanguageHelper.awk # +#################################################################### + +# Get locale key by language code or alias. +function getCode(code, group) { + if (code == "auto" || code in Locale) + return code + else if (code in LocaleAlias) + return LocaleAlias[code] + else if (tolower(code) in LocaleAlias) + return LocaleAlias[tolower(code)] + + # Remove unidentified region or script code + match(code, /^([[:alpha:]][[:alpha:]][[:alpha:]]?)-(.*)$/, group) + if (group[1]) + return group[1] + + return # return nothing if not found +} + +# Return the name of a language. +function getName(code) { + return Locale[getCode(code)]["name"] +} + +# Return all the names of a language, separated by "/" +function getNames(code) { + if ("name2" in Locale[getCode(code)]) + return Locale[getCode(code)]["name"] " / " Locale[getCode(code)]["name2"] + else + return Locale[getCode(code)]["name"] +} + +# Return the endonym of a language. +function getEndonym(code) { + return Locale[getCode(code)]["endonym"] +} + +# Return the string for displaying the endonym of a language. +function getDisplay(code) { + return Locale[getCode(code)]["display"] +} + +# Return formatted text for "translations of". +function showTranslationsOf(code, text, fmt) { + fmt = Locale[getCode(code)]["translations-of"] + if (!fmt) fmt = Locale["en"]["translations-of"] + return sprintf(fmt, text) +} + +# Return formatted text for "definitions of". +function showDefinitionsOf(code, text, fmt) { + fmt = Locale[getCode(code)]["definitions-of"] + if (!fmt) fmt = Locale["en"]["definitions-of"] + return sprintf(fmt, text) +} + +# Return a string of "synonyms". +function showSynonyms(code, tmp) { + tmp = Locale[getCode(code)]["synonyms"] + if (!tmp) tmp = Locale["en"]["synonyms"] + return tmp +} + +# Return a string of "examples". +function showExamples(code, tmp) { + tmp = Locale[getCode(code)]["examples"] + if (!tmp) tmp = Locale["en"]["examples"] + return tmp +} + +# Return a string of "see also". +function showSeeAlso(code, tmp) { + tmp = Locale[getCode(code)]["see-also"] + if (!tmp) tmp = Locale["en"]["see-also"] + return tmp +} + +# Return the family of a language. +function getFamily(code) { + return Locale[getCode(code)]["family"] +} + +# Return the branch of a language. +function getBranch(code) { + return Locale[getCode(code)]["branch"] +} + +# Return the ISO 639-3 code of a language. +function getISO(code) { + return Locale[getCode(code)]["iso"] +} + +# Return the Glottocode of a language. +function getGlotto(code) { + return Locale[getCode(code)]["glotto"] +} + +# Return the ISO 15924 script code of a language. +function getScript(code) { + return Locale[getCode(code)]["script"] +} + +# Return 1 if a language is R-to-L; otherwise return 0. +function isRTL(code) { + return Locale[getCode(code)]["rtl"] ? 1 : 0 +} + +# Return 1 if Google provides dictionary data for a language; otherwise return 0. +function hasDictionary(code) { + return Locale[getCode(code)]["dictionary"] ? 1 : 0 +} + +# Comparator using getName(). +function compName(i1, v1, i2, v2) { + if (getName(i1) < getName(i2)) + return -1 + else + return (getName(i1) != getName(i2)) +} + +# Return the name of script (writing system). +# See: +# +function scriptName(code) { + switch (code) { + case "Arab": return "Arabic" + case "Armn": return "Armenian" + case "Beng": return "Bengali" + case "Cher": return "Cherokee" + case "Cyrl": return "Cyrillic" + case "Deva": return "Devanagari" + case "Ethi": return "Ethiopic (Geʻez)" + case "Geor": return "Georgian (Mkhedruli)" + case "Grek": return "Greek" + case "Gujr": return "Gujarati" + case "Guru": return "Gurmukhi" + case "Hani": return "Han" + case "Hans": return "Han (Simplified)" + case "Hant": return "Han (Traditional)" + case "Hebr": return "Hebrew" + case "Jpan": return "Japanese (Han + Hiragana + Katakana)" + case "Khmr": return "Khmer" + case "Knda": return "Kannada" + case "Kore": return "Korean (Hangul + Han)" + case "Laoo": return "Lao" + case "Latn": return "Latin" + case "Mtei": return "Meitei Mayek" + case "Mlym": return "Malayalam" + case "Mymr": return "Myanmar" + case "Orya": return "Oriya" + case "Piqd": return "Klingon (pIqaD)" + case "Sinh": return "Sinhala" + case "Taml": return "Tamil" + case "Telu": return "Telugu" + case "Thaa": return "Thaana" + case "Thai": return "Thai" + case "Tibt": return "Tibetan" + default: return "Unknown" + } +} + +# Return the regions that a language is spoken in, as an English string. +function getSpokenIn(code, i, j, r, regions, str) { + r = NULLSTR + str = Locale[getCode(code)]["spoken-in"] + if (str) { + split(str, regions, /\s?;\s?/) + j = 0 + for (i in regions) { + r = r regions[i] + j++ + if (j < length(regions) - 1) + r = r ", " + else if (j == length(regions) - 1) + r = r " and " + } + } + return r +} + +# Return 1 if a language is supported by Google; otherwise return 0. +function isSupportedByGoogle(code, engines, i, str) { + str = Locale[getCode(code)]["supported-by"] + if (str) { + split(str, engines, /\s?;\s?/) + for (i in engines) + if (engines[i] == "google") return 1 + } + return 0 +} + +# Return 1 if a language is supported by Bing; otherwise return 0. +function isSupportedByBing(code, engines, i, str) { + str = Locale[getCode(code)]["supported-by"] + if (str) { + split(str, engines, /\s?;\s?/) + for (i in engines) + if (engines[i] == "bing") return 1 + } + return 0 +} + +# Return detailed information of a language as a string. +function getDetails(code, article, desc, group, iso, script) { + if (code == "auto" || !getCode(code)) { + e("[ERROR] Language not found: " code "\n" \ + " Run '-reference / -R' to see a list of available languages.") + exit 1 + } + + script = scriptName(getScript(code)) + if (isRTL(code)) script = script " (R-to-L)" + split(getISO(code), group, "-") + iso = group[1] + + if (getBranch(code)) { + article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" + desc = sprintf("%s is %s %s language spoken mainly in %s.", + getNames(code), article, getBranch(code), getSpokenIn(code)) + } else + desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", + getNames(code), getFamily(code), getSpokenIn(code)) + + return ansi("bold", sprintf("%s\n", getDisplay(code))) \ + sprintf("%-22s%s\n", "Name", ansi("bold", getNames(code))) \ + sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code))) \ + sprintf("%-22s%s\n", "Writing system", ansi("bold", script)) \ + sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code))) \ + sprintf("%-22s%s\n", "ISO 639-3", ansi("bold", iso)) \ + sprintf("%-22s%s\n", "SIL", ansi("bold", "https://iso639-3.sil.org/code/" iso)) \ + sprintf("%-22s%s\n", "Glottolog", getGlotto(code) ? + ansi("bold", "https://glottolog.org/resource/languoid/id/" getGlotto(code)) : "") \ + sprintf("%-22s%s\n", "Wikipedia", ansi("bold", "https://en.wikipedia.org/wiki/ISO_639:" iso)) \ + (Locale[getCode(code)]["supported-by"] ? # FIXME + sprintf("%-22s%s\n", "Translator support", sprintf("Google [%s] Bing [%s]", + isSupportedByGoogle(code) ? "✔" : "✘", isSupportedByBing(code) ? "✔" : "✘")) : "") \ + (Locale[getCode(code)]["spoken-in"] ? # FIXME + ansi("bold", sprintf("\n%s", desc)) : "") +} + +# Add /slashes/ for IPA phonemic notations and (parentheses) for others. +# Parameters: +# code +function showPhonetics(phonetics, code) { + if (code && getCode(code) == "en") + return "/" phonetics "/" + else + return "(" phonetics ")" +} + +# Convert a logical string to visual; don't right justify RTL lines. +# Parameters: +# code: ignore to apply bidirectional algorithm on every string +function show(text, code, command, temp) { + if (!code || isRTL(code)) { + if (Cache[text][0]) + return Cache[text][0] + else { + if ((FriBidi || (code && isRTL(code))) && BiDiNoPad) { + command = "echo " parameterize(text) PIPE BiDiNoPad + command | getline temp + close(command) + } else # non-RTL language, or FriBidi not installed + temp = text + return Cache[text][0] = temp + } + } else + return text +} + +# Convert a logical string to visual and right justify RTL lines. +# Parameters: +# code: ignore to apply bidirectional algorithm on every string +# width: ignore to use default width for padding +function s(text, code, width, command, temp) { + if (!code || isRTL(code)) { + if (!width) width = Option["width"] + if (Cache[text][width]) + return Cache[text][width] + else { + if ((FriBidi || (code && isRTL(code))) && BiDi) { + command = "echo " parameterize(text) PIPE sprintf(BiDi, width) + command | getline temp + close(command) + } else # non-RTL language, or FriBidi not installed + temp = text + return Cache[text][width] = temp + } + } else + return text +} + +# Convert a logical string to visual with a certain level of indentation. +# Parameters: +# level: level of indentation +# code: ignore to apply left indentation +# width: ignore to use default width for padding +function ins(level, text, code, width, i, temp) { + if (code && isRTL(code)) { + if (!width) width = Option["width"] + return s(text, code, width - Option["indent"] * level) + } else + return replicate(" ", Option["indent"] * level) text +} + +# Parse a POSIX locale identifier and return the language code; +# Identified by both language identifier and region identifier. +# Parameters: +# lang = [language[_territory][.codeset][@modifier]] +# See: +function parseLang(lang, code, group) { + match(lang, /^([a-z][a-z][a-z]?)(_|$)/, group) + code = getCode(group[1]) + + # Detect region identifier + ## Regions using Chinese Simplified: China, Singapore + if (lang ~ /^zh_(CN|SG)/) code = "zh-CN" + ## Regions using Chinese Traditional: Taiwan, Hong Kong + else if (lang ~ /^zh_(TW|HK)/) code = "zh-TW" + + # FIXME: handle unrecognized language code + if (!code) code = "en" + + return code +} + +# Initialize `UserLang`. +function initUserLang( lang, utf) { + if (lang = ENVIRON["LC_ALL"]) { + if (!UserLocale) UserLocale = lang + utf = utf || tolower(lang) ~ /utf-?8$/ + } + if (lang = ENVIRON["LANG"]) { + if (!UserLocale) UserLocale = lang + utf = utf || tolower(lang) ~ /utf-?8$/ + } + if (!UserLocale) { + UserLocale = "en_US.UTF-8" + utf = 1 + } + if (!utf) + w("[WARNING] Your locale codeset (" UserLocale ") is not UTF-8.") + + UserLang = parseLang(UserLocale) +} diff --git a/include/Main.awk b/include/Main.awk index 771ecd7e..1c9f555d 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -8,7 +8,7 @@ function init() { initBiDiTerm() initBiDi() - # (Languages.awk) + # (LanguageData.awk & LanguageHelper.awk) initLocale() initLocaleAlias() initUserLang() @@ -143,7 +143,7 @@ function initMisc( command, group, temp) { BiDi = "sed \"s/'/\\\\\\'/\" | xargs -0 printf '%%%ss'" } - # (Languages.awk) + # (LanguageData.awk) initLocaleDisplay() # Disable everything stderr diff --git a/test/Test.awk b/test/Test.awk index d6139989..66265525 100644 --- a/test/Test.awk +++ b/test/Test.awk @@ -1,4 +1,4 @@ @include "test/TestCommons" @include "test/TestUtils" @include "test/TestParser" -@include "test/TestLanguages" +@include "test/TestLanguageHelper" diff --git a/test/TestLanguages.awk b/test/TestLanguageHelper.awk similarity index 79% rename from test/TestLanguages.awk rename to test/TestLanguageHelper.awk index c77d3be2..b81f733b 100644 --- a/test/TestLanguages.awk +++ b/test/TestLanguageHelper.awk @@ -1,7 +1,8 @@ -@include "include/Languages" +@include "include/LanguageData" +@include "include/LanguageHelper" BEGIN { - START_TEST("Languages.awk") + START_TEST("LanguageHelper.awk") T("getCode()", 5) { diff --git a/translate b/translate index da4adc3f..4c863392 100755 --- a/translate +++ b/translate @@ -4,7 +4,8 @@ gawk \ -i "${TRANS_DIR}/metainfo.awk" \ -i "${TRANS_DIR}/include/Commons.awk" \ -i "${TRANS_DIR}/include/Utils.awk" \ --i "${TRANS_DIR}/include/Languages.awk" \ +-i "${TRANS_DIR}/include/LanguageData.awk" \ +-i "${TRANS_DIR}/include/LanguageHelper.awk" \ -i "${TRANS_DIR}/include/Help.awk" \ -i "${TRANS_DIR}/include/Parser.awk" \ -i "${TRANS_DIR}/include/Theme.awk" \ diff --git a/translate.awk b/translate.awk index df4fea19..a7305c74 100755 --- a/translate.awk +++ b/translate.awk @@ -5,7 +5,8 @@ @include "include/Commons.awk" @include "include/Utils.awk" -@include "include/Languages.awk" +@include "include/LanguageData.awk" +@include "include/LanguageHelper.awk" @include "include/Help.awk" @include "include/Parser.awk" @include "include/Theme.awk" From 292fd6f591f5523f48f3daecc1468cd5632587db Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 9 Jun 2022 22:59:07 +0200 Subject: [PATCH 036/119] Makefile: fix make check --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ef165211..ed5eda4d 100644 --- a/Makefile +++ b/Makefile @@ -27,9 +27,9 @@ test: build check: test $(BUILDDIR)/$(COMMAND) -V - [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b 忍者`" = 'Ninja' ] &&\ - [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e bing 忍者`" = 'Ninja' ] &&\ - [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e yandex Ninja`" = 'Ninja' ] + [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b 忍者`" = 'ninja' ] &&\ + [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e bing 忍者`" = 'ninja' ] #&&\ + #[ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e yandex Ninja`" = 'Ninja' ] install: build @mkdir -p $(DESTDIR)$(PREFIX)/bin &&\ From 4dc7bd525e73b797ea0af748b2fd12247c68d9a3 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 10 Jun 2022 14:59:50 +0200 Subject: [PATCH 037/119] LanguageHelper: improve getDetails() for language isolates --- include/LanguageHelper.awk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index 233d6de9..ec8e4af4 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -219,6 +219,9 @@ function getDetails(code, article, desc, group, iso, script) { article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" desc = sprintf("%s is %s %s language spoken mainly in %s.", getNames(code), article, getBranch(code), getSpokenIn(code)) + } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") { + desc = sprintf("%s is a language spoken mainly in %s.", + getNames(code), getSpokenIn(code)) } else desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", getNames(code), getFamily(code), getSpokenIn(code)) From 10a1db10a0e7c384b322cf84288834753036ae8f Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 10 Jun 2022 16:40:14 +0200 Subject: [PATCH 038/119] Languages: update section B --- include/LanguageData.awk | 68 ++++++++++++++++++++++++++++------------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index db4de0a3..44bed7ae 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -130,6 +130,7 @@ function initLocale() { # Azerbaijani (North Azerbaijani) Locale["az"]["name"] = "Azerbaijani" + Locale["az"]["name2"] = "Azeri" Locale["az"]["endonym"] = "Azərbaycanca" Locale["az"]["translations-of"] = "%s sözünün tərcüməsi" Locale["az"]["definitions-of"] = "%s sözünün tərifləri" @@ -147,17 +148,38 @@ function initLocale() { # Bambara Locale["bm"]["name"] = "Bambara" Locale["bm"]["endonym"] = "Bamanankan" + Locale["bm"]["endonym2"] = "Bamana" #Locale["bm"]["translations-of"] #Locale["bm"]["definitions-of"] #Locale["bm"]["synonyms"] #Locale["bm"]["examples"] #Locale["bm"]["see-also"] Locale["bm"]["family"] = "Mande" + Locale["bm"]["branch"] = "Manding" Locale["bm"]["iso"] = "bam" Locale["bm"]["glotto"] = "bamb1269" Locale["bm"]["script"] = "Latn" + Locale["bm"]["spoken-in"] = "Mali" + Locale["bm"]["supported-by"] = "google" - #7 Basque + # Bashkir + Locale["ba"]["name"] = "Bashkir" + Locale["ba"]["endonym"] = "Башҡортса" + Locale["ba"]["endonym2"] = "башҡорт теле" + #Locale["ba"]["translations-of"] + #Locale["ba"]["definitions-of"] + #Locale["ba"]["synonyms"] + #Locale["ba"]["examples"] + #Locale["ba"]["see-also"] + Locale["ba"]["family"] = "Turkic" + Locale["ba"]["branch"] = "Kipchak" + Locale["ba"]["iso"] = "bak" + Locale["ba"]["glotto"] = "bash1264" + Locale["ba"]["script"] = "Cyrl" + Locale["ba"]["spoken-in"] = "the Republic of Bashkortostan in Russia" + Locale["ba"]["supported-by"] = "bing; yandex" + + # Basque Locale["eu"]["name"] = "Basque" Locale["eu"]["endonym"] = "Euskara" Locale["eu"]["translations-of"] = "%s esapidearen itzulpena" @@ -165,12 +187,15 @@ function initLocale() { Locale["eu"]["synonyms"] = "Sinonimoak" Locale["eu"]["examples"] = "Adibideak" Locale["eu"]["see-also"] = "Ikusi hauek ere" - Locale["eu"]["family"] = "Language Isolate" + Locale["eu"]["family"] = "Language isolate" + #Locale["eu"]["branch"] = "Language isolate" Locale["eu"]["iso"] = "eus" Locale["eu"]["glotto"] = "basq1248" Locale["eu"]["script"] = "Latn" + Locale["eu"]["spoken-in"] = "Euskal Herria in Spain and France" + Locale["eu"]["supported-by"] = "google; bing; yandex" - #8 Belarusian, Cyrillic alphabet + # Belarusian, Cyrillic alphabet Locale["be"]["name"] = "Belarusian" Locale["be"]["endonym"] = "беларуская" Locale["be"]["translations-of"] = "Пераклады %s" @@ -179,11 +204,14 @@ function initLocale() { Locale["be"]["examples"] = "Прыклады" Locale["be"]["see-also"] = "Гл. таксама" Locale["be"]["family"] = "Indo-European" + Locale["be"]["branch"] = "East Slavic" Locale["be"]["iso"] = "bel" Locale["be"]["glotto"] = "bela1254" Locale["be"]["script"] = "Cyrl" + Locale["be"]["spoken-in"] = "Belarus" + Locale["be"]["supported-by"] = "google; yandex" - #9 Bengali / Bangla + # Bengali / Bangla Locale["bn"]["name"] = "Bengali" Locale["bn"]["name2"] = "Bangla" Locale["bn"]["endonym"] = "বাংলা" @@ -193,9 +221,12 @@ function initLocale() { Locale["bn"]["examples"] = "উদাহরণ" Locale["bn"]["see-also"] = "আরো দেখুন" Locale["bn"]["family"] = "Indo-European" + Locale["bn"]["branch"] = "Indo-Aryan" Locale["bn"]["iso"] = "ben" Locale["bn"]["glotto"] = "beng1280" Locale["bn"]["script"] = "Beng" + Locale["bn"]["spoken-in"] = "Bangladesh; India" + Locale["bn"]["supported-by"] = "google; bing; yandex" # Bhojpuri Locale["bho"]["name"] = "Bhojpuri" @@ -206,11 +237,14 @@ function initLocale() { #Locale["bho"]["examples"] #Locale["bho"]["see-also"] Locale["bho"]["family"] = "Indo-European" + Locale["bho"]["branch"] = "Indo-Aryan" Locale["bho"]["iso"] = "bho" Locale["bho"]["glotto"] = "bhoj1246" Locale["bho"]["script"] = "Deva" + Locale["bho"]["spoken-in"] = "India; Nepal; Fiji" + Locale["bho"]["supported-by"] = "google" - #10 Bosnian, Latin alphabet + # Bosnian, Latin alphabet Locale["bs"]["name"] = "Bosnian" Locale["bs"]["endonym"] = "Bosanski" Locale["bs"]["translations-of"] = "Prijevod za: %s" @@ -219,11 +253,14 @@ function initLocale() { Locale["bs"]["examples"] = "Primjeri" Locale["bs"]["see-also"] = "Pogledajte i" Locale["bs"]["family"] = "Indo-European" + Locale["bs"]["branch"] = "South Slavic" Locale["bs"]["iso"] = "bos" Locale["bs"]["glotto"] = "bosn1245" Locale["bs"]["script"] = "Latn" + Locale["bs"]["spoken-in"] = "Bosnia and Herzegovina" + Locale["bs"]["supported-by"] = "google; bing; yandex" - #11 Bulgarian + # Bulgarian Locale["bg"]["name"] = "Bulgarian" Locale["bg"]["endonym"] = "български" Locale["bg"]["translations-of"] = "Преводи на %s" @@ -232,9 +269,14 @@ function initLocale() { Locale["bg"]["examples"] = "Примери" Locale["bg"]["see-also"] = "Вижте също" Locale["bg"]["family"] = "Indo-European" + Locale["bg"]["branch"] = "South Slavic" Locale["bg"]["iso"] = "bul" Locale["bg"]["glotto"] = "bulg1262" Locale["bg"]["script"] = "Cyrl" + Locale["bg"]["spoken-in"] = "Bulgaria" + Locale["bg"]["supported-by"] = "google; bing; yandex" + + #12 Catalan (Standard Catalan) Locale["ca"]["name"] = "Catalan" @@ -1933,20 +1975,6 @@ function initLocale() { #Locale["tlh-Qaak"]["glotto"] Locale["tlh-Qaak"]["script"] = "Piqd" - #? Bashkir - Locale["ba"]["support"] = "yandex-only" - Locale["ba"]["name"] = "Bashkir" - Locale["ba"]["endonym"] = "башҡорт теле" - #Locale["ba"]["translations-of"] - #Locale["ba"]["definitions-of"] - #Locale["ba"]["synonyms"] - #Locale["ba"]["examples"] - #Locale["ba"]["see-also"] - Locale["ba"]["family"] = "Turkic" - Locale["ba"]["iso"] = "bak" - Locale["ba"]["glotto"] = "bash1264" - Locale["ba"]["script"] = "Cyrl" - #? Breton Locale["br"]["support"] = "unstable" Locale["br"]["name"] = "Breton" From 6e5eccc44407ec91d4ac0ec54661dae0cbe86a59 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 10 Jun 2022 16:43:09 +0200 Subject: [PATCH 039/119] Translators/BingTranslator: bs-Latn -> bs --- include/Translators/BingTranslator.awk | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index 833cc7b4..511f17a3 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -149,11 +149,9 @@ function bingTTSUrl(text, tl, function bingWebTranslateUrl(uri, sl, tl, hl, _sl, _tl) { # Hot-patches for language codes _sl = sl; _tl = tl - if (_sl == "bs") _sl = "bs-Latn" # 'bs' is not recognized as valid code if (_sl == "zh") _sl = "zh-CHS" # still old format if (_sl == "zh-CN") _sl = "zh-CHS" if (_sl == "zh-TW") _sl = "zh-CHT" - if (_tl == "bs") _tl = "bs-Latn" if (_tl == "zh") _tl = "zh-CHS" if (_tl == "zh-CN") _tl = "zh-CHS" if (_tl == "zh-TW") _tl = "zh-CHT" @@ -225,16 +223,14 @@ function bingTranslate(text, sl, tl, hl, bingSetup() # Hot-patches for Bing's own translator language codes - # See: + # See: if (_sl == "auto") _sl = "auto-detect" - if (_sl == "bs") _sl = "bs-Latn" # 'bs' is not recognized as valid code if (_sl == "no") _sl = "nb" # Bing uses Norwegian Bokmål # Bing uses 'pt' or 'pt-br' for Brazilian Portuguese, 'pt-pt' for European Portuguese if (_sl == "pt-BR") _sl = "pt" # just pt-br else if (_sl == "pt-PT") _sl = "pt" # FIXME: support pt-pt if (_sl == "zh-CN") _sl = "zh-Hans" if (_sl == "zh-TW") _sl = "zh-Hant" - if (_tl == "bs") _tl = "bs-Latn" if (_tl == "no") _tl = "nb" if (_tl == "pt-BR") _tl = "pt" else if (_tl == "pt-PT") _tl = "pt-pt" From 0fa4662ca97e59ed69204447c678ceb0732c41d0 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 12 Jun 2022 22:08:55 +0200 Subject: [PATCH 040/119] Languages: update section C --- include/LanguageData.awk | 116 +++++++++++++++++++++++++++++++-------- 1 file changed, 93 insertions(+), 23 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 44bed7ae..43db6bcb 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -276,9 +276,24 @@ function initLocale() { Locale["bg"]["spoken-in"] = "Bulgaria" Locale["bg"]["supported-by"] = "google; bing; yandex" + # Cantonese + Locale["yue"]["name"] = "Cantonese" + Locale["yue"]["endonym"] = "粵語" + Locale["yue"]["endonym2"] = "廣東話" + #Locale["yue"]["translations-of"] + #Locale["yue"]["definitions-of"] + #Locale["yue"]["synonyms"] + #Locale["yue"]["examples"] + #Locale["yue"]["see-also"] + Locale["yue"]["family"] = "Sino-Tibetan" + Locale["yue"]["branch"] = "Sinitic" + Locale["yue"]["iso"] = "yue" + Locale["yue"]["glotto"] = "cant1236" + Locale["yue"]["script"] = "Hant" + Locale["yue"]["spoken-in"] = "southeastern China; Hong Kong; Macau" + Locale["yue"]["supported-by"] = "bing" - - #12 Catalan (Standard Catalan) + # Catalan (Standard Catalan) Locale["ca"]["name"] = "Catalan" Locale["ca"]["endonym"] = "Català" Locale["ca"]["translations-of"] = "Traduccions per a %s" @@ -287,11 +302,14 @@ function initLocale() { Locale["ca"]["examples"] = "Exemples" Locale["ca"]["see-also"] = "Vegeu també" Locale["ca"]["family"] = "Indo-European" + Locale["ca"]["branch"] = "Western Romance" Locale["ca"]["iso"] = "cat" Locale["ca"]["glotto"] = "stan1289" Locale["ca"]["script"] = "Latn" + Locale["ca"]["spoken-in"] = "Països Catalans in Andorra, Spain, France and Italy" + Locale["ca"]["supported-by"] = "google; bing; yandex" - #13 Cebuano + # Cebuano Locale["ceb"]["name"] = "Cebuano" Locale["ceb"]["endonym"] = "Cebuano" Locale["ceb"]["translations-of"] = "%s Mga Paghubad sa PULONG_O_HUGPONG SA PAMULONG" @@ -300,12 +318,16 @@ function initLocale() { Locale["ceb"]["examples"] = "Mga pananglitan:" Locale["ceb"]["see-also"] = "Kitaa pag-usab" Locale["ceb"]["family"] = "Austronesian" + Locale["ceb"]["branch"] = "Malayo-Polynesian" Locale["ceb"]["iso"] = "ceb" Locale["ceb"]["glotto"] = "cebu1242" Locale["ceb"]["script"] = "Latn" + Locale["ceb"]["spoken-in"] = "the southern Philippines" + Locale["ceb"]["supported-by"] = "google; yandex" - #14 Chichewa + # Chichewa Locale["ny"]["name"] = "Chichewa" + Locale["ny"]["name2"] = "Chinyanja" Locale["ny"]["endonym"] = "Nyanja" Locale["ny"]["translations-of"] = "Matanthauzidwe a %s" Locale["ny"]["definitions-of"] = "Mamasulidwe a %s" @@ -313,12 +335,34 @@ function initLocale() { Locale["ny"]["examples"] = "Zitsanzo" Locale["ny"]["see-also"] = "Onaninso" Locale["ny"]["family"] = "Atlantic-Congo" + Locale["ny"]["branch"] = "Bantu" Locale["ny"]["iso"] = "nya" Locale["ny"]["glotto"] = "nyan1308" Locale["ny"]["script"] = "Latn" - - #15a Chinese (Mandarin), Simplified - Locale["zh-CN"]["name"] = "Chinese Simplified" + Locale["ny"]["spoken-in"] = "Malawi; Zambia" + Locale["ny"]["supported-by"] = "google" + + # Chinese (Literary) + Locale["lzh"]["name"] = "Chinese (Literary)" + #Locale["lzh"]["name2"] = "Literary Chinese" + #Locale["lzh"]["name3"] = "Classical Chinese" + Locale["lzh"]["endonym"] = "文言" + Locale["lzh"]["endonym2"] = "古漢語" + #Locale["lzh"]["translations-of"] + #Locale["lzh"]["definitions-of"] + #Locale["lzh"]["synonyms"] + #Locale["lzh"]["examples"] + #Locale["lzh"]["see-also"] + Locale["lzh"]["family"] = "Sino-Tibetan" + Locale["lzh"]["branch"] = "Sinitic" + Locale["lzh"]["iso"] = "lzh" + Locale["lzh"]["glotto"] = "lite1248" + Locale["lzh"]["script"] = "Hans" # should actually be Hant + Locale["lzh"]["spoken-in"] = "ancient China" + Locale["lzh"]["supported-by"] = "bing" + + # Chinese (Standard Mandarin), Simplified + Locale["zh-CN"]["name"] = "Chinese (Simplified)" Locale["zh-CN"]["endonym"] = "简体中文" Locale["zh-CN"]["translations-of"] = "%s 的翻译" Locale["zh-CN"]["definitions-of"] = "%s的定义" @@ -326,13 +370,17 @@ function initLocale() { Locale["zh-CN"]["examples"] = "示例" Locale["zh-CN"]["see-also"] = "另请参阅" Locale["zh-CN"]["family"] = "Sino-Tibetan" + Locale["zh-CN"]["branch"] = "Sinitic" Locale["zh-CN"]["iso"] = "zho-CN" Locale["zh-CN"]["glotto"] = "mand1415" Locale["zh-CN"]["script"] = "Hans" Locale["zh-CN"]["dictionary"] = "true" # has dictionary + Locale["zh-CN"]["spoken-in"] = "the Greater China regions" + Locale["zh-CN"]["written-in"] = "mainland China; Singapore" + Locale["zh-CN"]["supported-by"] = "google; bing; yandex" - #15b Chinese (Mandarin), Traditional - Locale["zh-TW"]["name"] = "Chinese Traditional" + # Chinese (Standard Mandarin), Traditional + Locale["zh-TW"]["name"] = "Chinese (Traditional)" Locale["zh-TW"]["endonym"] = "繁體中文" Locale["zh-TW"]["endonym2"] = "正體中文" Locale["zh-TW"]["translations-of"] = "「%s」的翻譯" @@ -341,12 +389,32 @@ function initLocale() { Locale["zh-TW"]["examples"] = "例句" Locale["zh-TW"]["see-also"] = "另請參閱" Locale["zh-TW"]["family"] = "Sino-Tibetan" + Locale["zh-TW"]["branch"] = "Sinitic" Locale["zh-TW"]["iso"] = "zho-TW" Locale["zh-TW"]["glotto"] = "mand1415" Locale["zh-TW"]["script"] = "Hant" Locale["zh-TW"]["dictionary"] = "true" # has dictionary - - #16 Corsican + Locale["zh-TW"]["spoken-in"] = "the Greater China regions" + Locale["zh-TW"]["written-in"] = "Taiwan (Republic of China); Hong Kong; Macau" + Locale["zh-TW"]["supported-by"] = "google; bing" + + # Chuvash + Locale["cv"]["name"] = "Chuvash" + Locale["cv"]["endonym"] = "Чӑвашла" + #Locale["cv"]["translations-of"] + #Locale["cv"]["definitions-of"] + #Locale["cv"]["synonyms"] + #Locale["cv"]["examples"] + #Locale["cv"]["see-also"] + Locale["cv"]["family"] = "Turkic" + Locale["cv"]["branch"] = "Oghur" + Locale["cv"]["iso"] = "chv" + Locale["cv"]["glotto"] = "chuv1255" + Locale["cv"]["script"] = "Cyrl" + Locale["cv"]["spoken-in"] = "the Chuvash Republic in Russia" + Locale["cv"]["supported-by"] = "yandex" + + # Corsican Locale["co"]["name"] = "Corsican" Locale["co"]["endonym"] = "Corsu" Locale["co"]["translations-of"] = "Traductions de %s" @@ -355,11 +423,14 @@ function initLocale() { Locale["co"]["examples"] = "Exemples" Locale["co"]["see-also"] = "Voir aussi" Locale["co"]["family"] = "Indo-European" + Locale["co"]["branch"] = "Italo-Dalmatian" Locale["co"]["iso"] = "cos" - Locale["co"]["glotto"] = "cors1242" + Locale["co"]["glotto"] = "cors1241" Locale["co"]["script"] = "Latn" + Locale["co"]["spoken-in"] = "Corsica in France; the northern end of the island of Sardinia in Italy" + Locale["co"]["supported-by"] = "google" - #17 Croatian + # Croatian Locale["hr"]["name"] = "Croatian" Locale["hr"]["endonym"] = "Hrvatski" Locale["hr"]["translations-of"] = "Prijevodi riječi ili izraza %s" @@ -368,11 +439,14 @@ function initLocale() { Locale["hr"]["examples"] = "Primjeri" Locale["hr"]["see-also"] = "Također pogledajte" Locale["hr"]["family"] = "Indo-European" + Locale["hr"]["branch"] = "South Slavic" Locale["hr"]["iso"] = "hrv" Locale["hr"]["glotto"] = "croa1245" Locale["hr"]["script"] = "Latn" + Locale["hr"]["spoken-in"] = "Croatia; Bosnia and Herzegovina" + Locale["hr"]["supported-by"] = "google; bing; yandex" - #18 Czech + # Czech Locale["cs"]["name"] = "Czech" Locale["cs"]["endonym"] = "Čeština" Locale["cs"]["translations-of"] = "Překlad výrazu %s" @@ -381,9 +455,14 @@ function initLocale() { Locale["cs"]["examples"] = "Příklady" Locale["cs"]["see-also"] = "Viz také" Locale["cs"]["family"] = "Indo-European" + Locale["cs"]["branch"] = "West Slavic" Locale["cs"]["iso"] = "ces" Locale["cs"]["glotto"] = "czec1258" Locale["cs"]["script"] = "Latn" + Locale["cs"]["spoken-in"] = "Czechia" + Locale["cs"]["supported-by"] = "google; bing; yandex" + + #19 Danish Locale["da"]["name"] = "Danish" @@ -1870,15 +1949,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Cantonese - Locale["yue"]["support"] = "bing-only" - Locale["yue"]["name"] = "Cantonese" - Locale["yue"]["endonym"] = "粵語" - Locale["yue"]["family"] = "Sino-Tibetan" - Locale["yue"]["iso"] = "yue" - Locale["yue"]["glotto"] = "cant1236" - Locale["yue"]["script"] = "Hant" - #* Dari (Dari Persian) Locale["prs"]["support"] = "bing-only" Locale["prs"]["name"] = "Dari" From a66345ec83e178dc9d1be095776576cf55738243 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 12 Jun 2022 22:14:43 +0200 Subject: [PATCH 041/119] LanguageHelper: improve getDetails() for writing systems --- include/LanguageHelper.awk | 41 +++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index ec8e4af4..bfa80637 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -180,6 +180,25 @@ function getSpokenIn(code, i, j, r, regions, str) { return r } +# Return the regions that a script is written in, as an English string. +function getWrittenIn(code, i, j, r, regions, str) { + r = NULLSTR + str = Locale[getCode(code)]["written-in"] + if (str) { + split(str, regions, /\s?;\s?/) + j = 0 + for (i in regions) { + r = r regions[i] + j++ + if (j < length(regions) - 1) + r = r ", " + else if (j == length(regions) - 1) + r = r " and " + } + } + return r +} + # Return 1 if a language is supported by Google; otherwise return 0. function isSupportedByGoogle(code, engines, i, str) { str = Locale[getCode(code)]["supported-by"] @@ -203,7 +222,7 @@ function isSupportedByBing(code, engines, i, str) { } # Return detailed information of a language as a string. -function getDetails(code, article, desc, group, iso, script) { +function getDetails(code, article, desc, group, iso, name, names, script, writing) { if (code == "auto" || !getCode(code)) { e("[ERROR] Language not found: " code "\n" \ " Run '-reference / -R' to see a list of available languages.") @@ -212,22 +231,34 @@ function getDetails(code, article, desc, group, iso, script) { script = scriptName(getScript(code)) if (isRTL(code)) script = script " (R-to-L)" + split(getISO(code), group, "-") iso = group[1] + name = getName(code) + names = getNames(code) + if (match(name, /\(.*\)/)) { + writing = substr(name, match(name, /\(.*\)/) + 1) + writing = substr(writing, 1, length(writing) - 1) + name = substr(name, 1, match(name, /\(.*\)/) - 2) + } + if (getBranch(code)) { article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" desc = sprintf("%s is %s %s language spoken mainly in %s.", - getNames(code), article, getBranch(code), getSpokenIn(code)) + names, article, getBranch(code), getSpokenIn(code)) } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") { desc = sprintf("%s is a language spoken mainly in %s.", - getNames(code), getSpokenIn(code)) + names, getSpokenIn(code)) } else desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", - getNames(code), getFamily(code), getSpokenIn(code)) + names, getFamily(code), getSpokenIn(code)) + if (writing && getWrittenIn(code)) + desc = desc sprintf(" The %s writing system is officially used in %s.", + tolower(writing), getWrittenIn(code)) return ansi("bold", sprintf("%s\n", getDisplay(code))) \ - sprintf("%-22s%s\n", "Name", ansi("bold", getNames(code))) \ + sprintf("%-22s%s\n", "Name", ansi("bold", names)) \ sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code))) \ sprintf("%-22s%s\n", "Writing system", ansi("bold", script)) \ sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code))) \ From 764f20f5da83974ddc5fddcf6793cae966b9bf4a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 14 Jun 2022 17:33:44 +0200 Subject: [PATCH 042/119] Languages: update section D --- include/LanguageData.awk | 78 +++++++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 28 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 43db6bcb..6e581186 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -462,9 +462,7 @@ function initLocale() { Locale["cs"]["spoken-in"] = "Czechia" Locale["cs"]["supported-by"] = "google; bing; yandex" - - - #19 Danish + # Danish Locale["da"]["name"] = "Danish" Locale["da"]["endonym"] = "Dansk" Locale["da"]["translations-of"] = "Oversættelser af %s" @@ -473,13 +471,34 @@ function initLocale() { Locale["da"]["examples"] = "Eksempler" Locale["da"]["see-also"] = "Se også" Locale["da"]["family"] = "Indo-European" + Locale["da"]["branch"] = "North Germanic" Locale["da"]["iso"] = "dan" Locale["da"]["glotto"] = "dani1285" Locale["da"]["script"] = "Latn" + Locale["da"]["spoken-in"] = "Denmark; Greenland; the Faroe Islands; the northern German region of Southern Schleswig" + Locale["da"]["supported-by"] = "google; bing; yandex" + + # Dari (Dari Persian) + Locale["prs"]["name"] = "Dari" + Locale["prs"]["endonym"] = "دری" + #Locale["prs"]["translations-of"] + #Locale["prs"]["definitions-of"] + #Locale["prs"]["synonyms"] + #Locale["prs"]["examples"] + #Locale["prs"]["see-also"] + Locale["prs"]["family"] = "Indo-European" + Locale["prs"]["branch"] = "Iranian" + Locale["prs"]["iso"] = "prs" + Locale["prs"]["glotto"] = "dari1249" + Locale["prs"]["script"] = "Arab" + Locale["prs"]["rtl"] = "true" # RTL language + Locale["prs"]["spoken-in"] = "Afghanistan; Iran" + Locale["prs"]["supported-by"] = "bing" # Dhivehi Locale["dv"]["name"] = "Dhivehi" Locale["dv"]["name2"] = "Divehi" + Locale["dv"]["name3"] = "Maldivian" Locale["dv"]["endonym"] = "ދިވެހި" #Locale["dv"]["translations-of"] #Locale["dv"]["definitions-of"] @@ -487,10 +506,13 @@ function initLocale() { #Locale["dv"]["examples"] #Locale["dv"]["see-also"] Locale["dv"]["family"] = "Indo-European" + Locale["dv"]["branch"] = "Indo-Aryan" Locale["dv"]["iso"] = "div" Locale["dv"]["glotto"] = "dhiv1236" Locale["dv"]["script"] = "Thaa" Locale["dv"]["rtl"] = "true" # RTL language + Locale["dv"]["spoken-in"] = "the Maldives" + Locale["dv"]["supported-by"] = "google; bing" # Dogri Locale["doi"]["name"] = "Dogri" @@ -501,11 +523,14 @@ function initLocale() { #Locale["doi"]["examples"] #Locale["doi"]["see-also"] Locale["doi"]["family"] = "Indo-European" + Locale["doi"]["branch"] = "Indo-Aryan" Locale["doi"]["iso"] = "doi" Locale["doi"]["glotto"] = "indo1311" Locale["doi"]["script"] = "Deva" + Locale["doi"]["spoken-in"] = "the Jammu region in northern India" + Locale["doi"]["supported-by"] = "google" - #20 Dutch + # Dutch Locale["nl"]["name"] = "Dutch" Locale["nl"]["endonym"] = "Nederlands" Locale["nl"]["translations-of"] = "Vertalingen van %s" @@ -514,10 +539,31 @@ function initLocale() { Locale["nl"]["examples"] = "Voorbeelden" Locale["nl"]["see-also"] = "Zie ook" Locale["nl"]["family"] = "Indo-European" + Locale["nl"]["branch"] = "West Germanic" Locale["nl"]["iso"] = "nld" Locale["nl"]["glotto"] = "dutc1256" Locale["nl"]["script"] = "Latn" Locale["nl"]["dictionary"] = "true" # has dictionary + Locale["nl"]["spoken-in"] = "the Netherlands; Belgium; Suriname; Aruba; Curaçao; Sint Maarten; the Caribbean Netherlands" + Locale["nl"]["supported-by"] = "google; bing; yandex" + + # Dzongkha + Locale["dz"]["name"] = "Dzongkha" + Locale["dz"]["endonym"] = "རྫོང་ཁ" + #Locale["dz"]["translations-of"] + #Locale["dz"]["definitions-of"] + #Locale["dz"]["synonyms"] + #Locale["dz"]["examples"] + #Locale["dz"]["see-also"] + Locale["dz"]["family"] = "Sino-Tibetan" + Locale["dz"]["branch"] = "Tibetic" + Locale["dz"]["iso"] = "dzo" + Locale["dz"]["glotto"] = "nucl1307" + Locale["dz"]["script"] = "Tibt" + Locale["dz"]["spoken-in"] = "Bhutan" + Locale["dz"]["supported-by"] = "" + + #21 English (Standard English) Locale["en"]["name"] = "English" @@ -1949,16 +1995,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Dari (Dari Persian) - Locale["prs"]["support"] = "bing-only" - Locale["prs"]["name"] = "Dari" - Locale["prs"]["endonym"] = "دری" - Locale["prs"]["family"] = "Indo-European" - Locale["prs"]["iso"] = "prs" - Locale["prs"]["glotto"] = "dari1249" - Locale["prs"]["script"] = "Arab" - Locale["prs"]["rtl"] = "true" # RTL language - #* Fijian Locale["fj"]["support"] = "bing-only" Locale["fj"]["name"] = "Fijian" @@ -2059,20 +2095,6 @@ function initLocale() { Locale["br"]["glotto"] = "bret1244" Locale["br"]["script"] = "Latn" - #? Dzongkha - Locale["dz"]["support"] = "unstable" - Locale["dz"]["name"] = "Dzongkha" - Locale["dz"]["endonym"] = "རྫོང་ཁ" - #Locale["dz"]["translations-of"] - #Locale["dz"]["definitions-of"] - #Locale["dz"]["synonyms"] - #Locale["dz"]["examples"] - #Locale["dz"]["see-also"] - Locale["dz"]["family"] = "Sino-Tibetan" - Locale["dz"]["iso"] = "dzo" - Locale["dz"]["glotto"] = "nucl1307" - Locale["dz"]["script"] = "Tibt" - #? Eastern Mari Locale["mhr"]["support"] = "yandex-only" Locale["mhr"]["name"] = "Eastern Mari" From db6100e82eb1e8519d0a2df4d2be268cd13c4181 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 16 Jun 2022 23:30:53 +0200 Subject: [PATCH 043/119] LanguageData: empty string should not be an alias (fix #436) --- include/LanguageData.awk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 6e581186..27217da5 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2274,13 +2274,15 @@ function initLocale() { function initLocaleAlias( i) { for (i in Locale) { # ISO 639-3 codes as aliases - LocaleAlias[Locale[i]["iso"]] = i - + if ("iso" in Locale[i]) + LocaleAlias[Locale[i]["iso"]] = i # Names and endonyms as aliases - LocaleAlias[tolower(Locale[i]["name"])] = i + if ("name" in Locale[i]) + LocaleAlias[tolower(Locale[i]["name"])] = i if ("name2" in Locale[i]) LocaleAlias[tolower(Locale[i]["name2"])] = i - LocaleAlias[tolower(Locale[i]["endonym"])] = i + if ("endonym" in Locale[i]) + LocaleAlias[tolower(Locale[i]["endonym"])] = i if ("endonym2" in Locale[i]) LocaleAlias[tolower(Locale[i]["endonym2"])] = i } From 66379d1a3bb8f8eae0fa8dd7ce83d50b3227891c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 16 Jun 2022 23:32:21 +0200 Subject: [PATCH 044/119] LanguageData: Artificial Language -> Constructed language --- include/LanguageData.awk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 27217da5..3d2228cb 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -587,7 +587,7 @@ function initLocale() { Locale["eo"]["synonyms"] = "Sinonimoj" Locale["eo"]["examples"] = "Ekzemploj" Locale["eo"]["see-also"] = "Vidu ankaŭ" - Locale["eo"]["family"] = "Artificial Language" + Locale["eo"]["family"] = "Constructed language" Locale["eo"]["iso"] = "epo" Locale["eo"]["glotto"] = "espe1235" Locale["eo"]["script"] = "Latn" @@ -2067,7 +2067,7 @@ function initLocale() { Locale["tlh"]["support"] = "bing-only" Locale["tlh"]["name"] = "Klingon" Locale["tlh"]["endonym"] = "tlhIngan Hol" - Locale["tlh"]["family"] = "Artificial Language" + Locale["tlh"]["family"] = "Constructed language" Locale["tlh"]["iso"] = "tlh" #Locale["tlh"]["glotto"] Locale["tlh"]["script"] = "Latn" @@ -2076,7 +2076,7 @@ function initLocale() { Locale["tlh-Qaak"]["support"] = "bing-only" Locale["tlh-Qaak"]["name"] = "Klingon (pIqaD)" Locale["tlh-Qaak"]["endonym"] = " " - Locale["tlh-Qaak"]["family"] = "Artificial Language" + Locale["tlh-Qaak"]["family"] = "Constructed language" Locale["tlh-Qaak"]["iso"] = "tlh" #Locale["tlh-Qaak"]["glotto"] Locale["tlh-Qaak"]["script"] = "Piqd" @@ -2146,7 +2146,7 @@ function initLocale() { #Locale["ie"]["synonyms"] #Locale["ie"]["examples"] #Locale["ie"]["see-also"] - Locale["ie"]["family"] = "Artificial Language" + Locale["ie"]["family"] = "Constructed language" Locale["ie"]["iso"] = "ile" Locale["ie"]["glotto"] = "occi1241" Locale["ie"]["script"] = "Latn" @@ -2230,7 +2230,7 @@ function initLocale() { #Locale["vo"]["synonyms"] #Locale["vo"]["examples"] #Locale["vo"]["see-also"] - Locale["vo"]["family"] = "Artificial Language" + Locale["vo"]["family"] = "Constructed language" Locale["vo"]["iso"] = "vol" #Locale["vo"]["glotto"] Locale["vo"]["script"] = "Latn" From 7ba78ace18d0adc838d4174620dbb33aa13aa4f1 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 29 Jul 2022 17:35:02 +0200 Subject: [PATCH 045/119] LanguageData: update section E --- include/LanguageData.awk | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 3d2228cb..10c8a2fb 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -563,9 +563,7 @@ function initLocale() { Locale["dz"]["spoken-in"] = "Bhutan" Locale["dz"]["supported-by"] = "" - - - #21 English (Standard English) + # English Locale["en"]["name"] = "English" Locale["en"]["endonym"] = "English" Locale["en"]["translations-of"] = "Translations of %s" @@ -574,12 +572,15 @@ function initLocale() { Locale["en"]["examples"] = "Examples" Locale["en"]["see-also"] = "See also" Locale["en"]["family"] = "Indo-European" + Locale["en"]["branch"] = "West Germanic" Locale["en"]["iso"] = "eng" Locale["en"]["glotto"] = "stan1293" Locale["en"]["script"] = "Latn" Locale["en"]["dictionary"] = "true" # has dictionary + Locale["en"]["spoken-in"] = "worldwide" + Locale["en"]["supported-by"] = "google; bing; yandex" - #22 Esperanto + # Esperanto Locale["eo"]["name"] = "Esperanto" Locale["eo"]["endonym"] = "Esperanto" Locale["eo"]["translations-of"] = "Tradukoj de %s" @@ -588,11 +589,15 @@ function initLocale() { Locale["eo"]["examples"] = "Ekzemploj" Locale["eo"]["see-also"] = "Vidu ankaŭ" Locale["eo"]["family"] = "Constructed language" + #Locale["eo"]["branch"] Locale["eo"]["iso"] = "epo" Locale["eo"]["glotto"] = "espe1235" Locale["eo"]["script"] = "Latn" + Locale["eo"]["spoken-in"] = "worldwide" + Locale["eo"]["description"] = "the world's most widely spoken constructed international auxiliary language, designed to be a universal second language for international communication" + Locale["eo"]["supported-by"] = "google; yandex" - #23 Estonian + # Estonian Locale["et"]["name"] = "Estonian" Locale["et"]["endonym"] = "Eesti" Locale["et"]["translations-of"] = "Sõna(de) %s tõlked" @@ -601,9 +606,12 @@ function initLocale() { Locale["et"]["examples"] = "Näited" Locale["et"]["see-also"] = "Vt ka" Locale["et"]["family"] = "Uralic" + Locale["et"]["branch"] = "Finnic" Locale["et"]["iso"] = "est" Locale["et"]["glotto"] = "esto1258" Locale["et"]["script"] = "Latn" + Locale["et"]["spoken-in"] = "Estonia" + Locale["et"]["supported-by"] = "google; bing; yandex" # Ewe Locale["ee"]["name"] = "Ewe" @@ -614,9 +622,14 @@ function initLocale() { #Locale["ee"]["examples"] #Locale["ee"]["see-also"] Locale["ee"]["family"] = "Atlantic-Congo" + Locale["ee"]["branch"] = "Gbe" Locale["ee"]["iso"] = "ewe" Locale["ee"]["glotto"] = "ewee1241" Locale["ee"]["script"] = "Latn" + Locale["ee"]["spoken-in"] = "Ghana; Togo; Benin" + Locale["ee"]["supported-by"] = "google" + + #24 Filipino / Tagalog Locale["tl"]["name"] = "Filipino" From 7480665a627b3f3fb374432a10eb8741a843c9b5 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 29 Jul 2022 17:39:44 +0200 Subject: [PATCH 046/119] LanguageData: remove Emoji --- include/LanguageData.awk | 5 ----- 1 file changed, 5 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 10c8a2fb..6f52307b 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2276,11 +2276,6 @@ function initLocale() { Locale["chr"]["glotto"] = "cher1273" Locale["chr"]["script"] = "Cher" - #? Emoji - Locale["emj"]["status"] = "non-language" - Locale["emj"]["support"] = "yandex-only" - Locale["emj"]["name"] = "Emoji" - Locale["emj"]["endonym"] = "Emoji" } # Initialize aliases of all locales supported. From 8e6fdd6ffd0c4a3402aec4659bde441903ab62e7 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 29 Jul 2022 22:12:17 +0200 Subject: [PATCH 047/119] LanguageData: update section F --- include/LanguageData.awk | 90 +++++++++++++++++++++++++++------------- 1 file changed, 62 insertions(+), 28 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 6f52307b..35576870 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -629,9 +629,39 @@ function initLocale() { Locale["ee"]["spoken-in"] = "Ghana; Togo; Benin" Locale["ee"]["supported-by"] = "google" + # Faroese + Locale["fo"]["name"] = "Faroese" + Locale["fo"]["endonym"] = "Føroyskt" + #Locale["fo"]["translations-of"] + #Locale["fo"]["definitions-of"] + #Locale["fo"]["synonyms"] + #Locale["fo"]["examples"] + #Locale["fo"]["see-also"] + Locale["fo"]["family"] = "Indo-European" + Locale["fo"]["branch"] = "North Germanic" + Locale["fo"]["iso"] = "fao" + Locale["fo"]["glotto"] = "faro1244" + Locale["fo"]["script"] = "Latn" + Locale["fo"]["spoken-in"] = "the Faroe Islands" + Locale["fo"]["supported-by"] = "bing" + # Fijian + Locale["fj"]["name"] = "Fijian" + Locale["fj"]["endonym"] = "Vosa Vakaviti" + #Locale["fj"]["translations-of"] + #Locale["fj"]["definitions-of"] + #Locale["fj"]["synonyms"] + #Locale["fj"]["examples"] + #Locale["fj"]["see-also"] + Locale["fj"]["family"] = "Austronesian" + Locale["fj"]["branch"] = "Malayo-Polynesian" + Locale["fj"]["iso"] = "fij" + Locale["fj"]["glotto"] = "fiji1243" + Locale["fj"]["script"] = "Latn" + Locale["fj"]["spoken-in"] = "Fiji" + Locale["fj"]["supported-by"] = "bing" - #24 Filipino / Tagalog + # Filipino / Tagalog Locale["tl"]["name"] = "Filipino" Locale["tl"]["name2"] = "Tagalog" Locale["tl"]["endonym"] = "Tagalog" @@ -641,11 +671,14 @@ function initLocale() { Locale["tl"]["examples"] = "Mga Halimbawa" Locale["tl"]["see-also"] = "Tingnan rin ang" Locale["tl"]["family"] = "Austronesian" - Locale["tl"]["iso"] = "tgl" - Locale["tl"]["glotto"] = "taga1270" + Locale["tl"]["branch"] = "Malayo-Polynesian" + Locale["tl"]["iso"] = "fil" + Locale["tl"]["glotto"] = "fili1244" Locale["tl"]["script"] = "Latn" + Locale["tl"]["spoken-in"] = "the Philippines" + Locale["tl"]["supported-by"] = "google; bing; yandex" - #25 Finnish + # Finnish Locale["fi"]["name"] = "Finnish" Locale["fi"]["endonym"] = "Suomi" Locale["fi"]["translations-of"] = "Käännökset tekstille %s" @@ -654,11 +687,14 @@ function initLocale() { Locale["fi"]["examples"] = "Esimerkkejä" Locale["fi"]["see-also"] = "Katso myös" Locale["fi"]["family"] = "Uralic" + Locale["fi"]["branch"] = "Finnic" Locale["fi"]["iso"] = "fin" Locale["fi"]["glotto"] = "finn1318" Locale["fi"]["script"] = "Latn" + Locale["fi"]["spoken-in"] = "Finland" + Locale["fi"]["supported-by"] = "google; bing; yandex" - #26 French (Standard French) + # French (Standard French) Locale["fr"]["name"] = "French" Locale["fr"]["endonym"] = "Français" Locale["fr"]["translations-of"] = "Traductions de %s" @@ -667,10 +703,31 @@ function initLocale() { Locale["fr"]["examples"] = "Exemples" Locale["fr"]["see-also"] = "Voir aussi" Locale["fr"]["family"] = "Indo-European" + Locale["fr"]["branch"] = "Western Romance" Locale["fr"]["iso"] = "fra" Locale["fr"]["glotto"] = "stan1290" Locale["fr"]["script"] = "Latn" Locale["fr"]["dictionary"] = "true" # has dictionary + Locale["fr"]["spoken-in"] = "France; Switzerland; Belgium; Luxembourg" + Locale["fr"]["supported-by"] = "google; bing; yandex" + + # French (Canadian French) + Locale["fr-CA"]["name"] = "French (Canadian)" + Locale["fr-CA"]["endonym"] = "Français canadien" + Locale["fr-CA"]["translations-of"] = "Traductions de %s" + Locale["fr-CA"]["definitions-of"] = "Définitions de %s" + Locale["fr-CA"]["synonyms"] = "Synonymes" + Locale["fr-CA"]["examples"] = "Exemples" + Locale["fr-CA"]["see-also"] = "Voir aussi" + Locale["fr-CA"]["family"] = "Indo-European" + Locale["fr-CA"]["branch"] = "Western Romance" + Locale["fr-CA"]["iso"] = "fra-CA" + Locale["fr-CA"]["glotto"] = "queb1247" + Locale["fr-CA"]["script"] = "Latn" + Locale["fr-CA"]["spoken-in"] = "Canada" + Locale["fr-CA"]["supported-by"] = "bing" + + #27 Galician Locale["gl"]["name"] = "Galician" @@ -2008,15 +2065,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Fijian - Locale["fj"]["support"] = "bing-only" - Locale["fj"]["name"] = "Fijian" - Locale["fj"]["endonym"] = "Vosa Vakaviti" - Locale["fj"]["family"] = "Austronesian" - Locale["fj"]["iso"] = "fij" - Locale["fj"]["glotto"] = "fiji1243" - Locale["fj"]["script"] = "Latn" - #* Hmong Daw (White Hmong) Locale["mww"]["support"] = "bing-only" Locale["mww"]["name"] = "Hmong Daw" @@ -2122,20 +2170,6 @@ function initLocale() { Locale["mhr"]["glotto"] = "east2328" Locale["mhr"]["script"] = "Cyrl" - #? Faroese - Locale["fo"]["support"] = "unstable" - Locale["fo"]["name"] = "Faroese" - Locale["fo"]["endonym"] = "Føroyskt" - #Locale["fo"]["translations-of"] - #Locale["fo"]["definitions-of"] - #Locale["fo"]["synonyms"] - #Locale["fo"]["examples"] - #Locale["fo"]["see-also"] - Locale["fo"]["family"] = "Indo-European" - Locale["fo"]["iso"] = "fao" - Locale["fo"]["glotto"] = "faro1244" - Locale["fo"]["script"] = "Latn" - #? Hill Mari Locale["mrj"]["support"] = "yandex-only" Locale["mrj"]["name"] = "Hill Mari" From 5ae30647de5e12f0e1c4642db952f72eec3cdf30 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 29 Jul 2022 22:19:03 +0200 Subject: [PATCH 048/119] Translators/BingTranslator: fix for Filipino --- include/LanguageData.awk | 3 ++- include/Translators/BingTranslator.awk | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 35576870..21f064ca 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -664,7 +664,8 @@ function initLocale() { # Filipino / Tagalog Locale["tl"]["name"] = "Filipino" Locale["tl"]["name2"] = "Tagalog" - Locale["tl"]["endonym"] = "Tagalog" + Locale["tl"]["endonym"] = "Filipino" + Locale["tl"]["endonym2"] = "Tagalog" Locale["tl"]["translations-of"] = "Mga pagsasalin ng %s" Locale["tl"]["definitions-of"] = "Mga kahulugan ng %s" Locale["tl"]["synonyms"] = "Mga Kasingkahulugan" diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index 511f17a3..48c245f8 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -225,12 +225,14 @@ function bingTranslate(text, sl, tl, hl, # Hot-patches for Bing's own translator language codes # See: if (_sl == "auto") _sl = "auto-detect" + if (_sl == "tl") _sl = "fil" # Bing uses 'fil' for Filipino if (_sl == "no") _sl = "nb" # Bing uses Norwegian Bokmål # Bing uses 'pt' or 'pt-br' for Brazilian Portuguese, 'pt-pt' for European Portuguese if (_sl == "pt-BR") _sl = "pt" # just pt-br else if (_sl == "pt-PT") _sl = "pt" # FIXME: support pt-pt if (_sl == "zh-CN") _sl = "zh-Hans" if (_sl == "zh-TW") _sl = "zh-Hant" + if (_tl == "tl") _tl = "fil" if (_tl == "no") _tl = "nb" if (_tl == "pt-BR") _tl = "pt" else if (_tl == "pt-PT") _tl = "pt-pt" From 4ce49d80258417a5a2d1e23a67507fa0ade47989 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 31 Jul 2022 17:05:23 +0200 Subject: [PATCH 049/119] LanguageData: update section G --- include/LanguageData.awk | 42 ++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 21f064ca..4ef372ee 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -728,9 +728,7 @@ function initLocale() { Locale["fr-CA"]["spoken-in"] = "Canada" Locale["fr-CA"]["supported-by"] = "bing" - - - #27 Galician + # Galician Locale["gl"]["name"] = "Galician" Locale["gl"]["endonym"] = "Galego" Locale["gl"]["translations-of"] = "Traducións de %s" @@ -739,11 +737,14 @@ function initLocale() { Locale["gl"]["examples"] = "Exemplos" Locale["gl"]["see-also"] = "Ver tamén" Locale["gl"]["family"] = "Indo-European" + Locale["gl"]["branch"] = "Western Romance" Locale["gl"]["iso"] = "glg" Locale["gl"]["glotto"] = "gali1258" Locale["gl"]["script"] = "Latn" + Locale["gl"]["spoken-in"] = "Galicia in northwestern Spain" + Locale["gl"]["supported-by"] = "google; bing; yandex" - #28 Georgian (Modern Georgian) + # Georgian (Modern Georgian) Locale["ka"]["name"] = "Georgian" Locale["ka"]["endonym"] = "ქართული" Locale["ka"]["translations-of"] = "%s-ის თარგმანები" @@ -752,11 +753,14 @@ function initLocale() { Locale["ka"]["examples"] = "მაგალითები" Locale["ka"]["see-also"] = "ასევე იხილეთ" Locale["ka"]["family"] = "Kartvelian" + Locale["ka"]["branch"] = "Karto-Zan" Locale["ka"]["iso"] = "kat" Locale["ka"]["glotto"] = "nucl1302" Locale["ka"]["script"] = "Geor" + Locale["ka"]["spoken-in"] = "Georgia" + Locale["ka"]["supported-by"] = "google; bing; yandex" - #29 German (Standard German) + # German (Standard German) Locale["de"]["name"] = "German" Locale["de"]["endonym"] = "Deutsch" Locale["de"]["translations-of"] = "Übersetzungen für %s" @@ -765,12 +769,15 @@ function initLocale() { Locale["de"]["examples"] = "Beispiele" Locale["de"]["see-also"] = "Siehe auch" Locale["de"]["family"] = "Indo-European" + Locale["de"]["branch"] = "West Germanic" Locale["de"]["iso"] = "deu" Locale["de"]["glotto"] = "stan1295" Locale["de"]["script"] = "Latn" Locale["de"]["dictionary"] = "true" # has dictionary + Locale["de"]["spoken-in"] = "Central Europe" + Locale["de"]["supported-by"] = "google; bing; yandex" - #30 Greek (Modern Greek) + # Greek (Modern Greek) Locale["el"]["name"] = "Greek" Locale["el"]["endonym"] = "Ελληνικά" Locale["el"]["translations-of"] = "Μεταφράσεις του %s" @@ -779,9 +786,12 @@ function initLocale() { Locale["el"]["examples"] = "Παραδείγματα" Locale["el"]["see-also"] = "Δείτε επίσης" Locale["el"]["family"] = "Indo-European" + Locale["el"]["branch"] = "Paleo-Balkan" Locale["el"]["iso"] = "ell" Locale["el"]["glotto"] = "mode1248" Locale["el"]["script"] = "Grek" + Locale["el"]["spoken-in"] = "Greece; Cyprus; southern Albania" + Locale["el"]["supported-by"] = "google; bing; yandex" # Guarani Locale["gn"]["name"] = "Guarani" @@ -791,12 +801,15 @@ function initLocale() { #Locale["gn"]["synonyms"] #Locale["gn"]["examples"] #Locale["gn"]["see-also"] - Locale["gn"]["family"] = "Tupian" - Locale["gn"]["iso"] = "gug" - Locale["gn"]["glotto"] = "para1311" - Locale["gn"]["script"] = "Latn" - - #31 Gujarati + Locale["gn"]["family"] = "Tupian" + #Locale["gn"]["branch"] = "Guaraní" + Locale["gn"]["iso"] = "gug" + Locale["gn"]["glotto"] = "para1311" + Locale["gn"]["script"] = "Latn" + Locale["gn"]["spoken-in"] = "Paraguay; Bolivia; Argentina; Brazil" + Locale["gn"]["supported-by"] = "google" + + # Gujarati Locale["gu"]["name"] = "Gujarati" Locale["gu"]["endonym"] = "ગુજરાતી" Locale["gu"]["translations-of"] = "%s ના અનુવાદ" @@ -805,9 +818,14 @@ function initLocale() { Locale["gu"]["examples"] = "ઉદાહરણો" Locale["gu"]["see-also"] = "આ પણ જુઓ" Locale["gu"]["family"] = "Indo-European" + Locale["gu"]["branch"] = "Indo-Aryan" Locale["gu"]["iso"] = "guj" Locale["gu"]["glotto"] = "guja1252" Locale["gu"]["script"] = "Gujr" + Locale["gu"]["spoken-in"] = "the Indian state of Gujarat" + Locale["gu"]["supported-by"] = "google; bing; yandex" + + #32 Haitian Creole Locale["ht"]["name"] = "Haitian Creole" From a34b4123940cc6526219129f9bf64937d6935c57 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 31 Jul 2022 22:09:52 +0200 Subject: [PATCH 050/119] LanguageData: update section H --- include/LanguageData.awk | 92 ++++++++++++++++++++++++++-------------- 1 file changed, 59 insertions(+), 33 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 4ef372ee..fe36cb63 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -825,9 +825,7 @@ function initLocale() { Locale["gu"]["spoken-in"] = "the Indian state of Gujarat" Locale["gu"]["supported-by"] = "google; bing; yandex" - - - #32 Haitian Creole + # Haitian Creole Locale["ht"]["name"] = "Haitian Creole" Locale["ht"]["endonym"] = "Kreyòl Ayisyen" Locale["ht"]["translations-of"] = "Tradiksyon %s" @@ -836,11 +834,14 @@ function initLocale() { Locale["ht"]["examples"] = "Egzanp:" Locale["ht"]["see-also"] = "Wè tou" Locale["ht"]["family"] = "Indo-European" + Locale["ht"]["branch"] = "French Creole" Locale["ht"]["iso"] = "hat" Locale["ht"]["glotto"] = "hait1244" Locale["ht"]["script"] = "Latn" + Locale["ht"]["spoken-in"] = "Haiti" + Locale["ht"]["supported-by"] = "google; bing; yandex" - #33 Hawaiian + # Hawaiian Locale["haw"]["name"] = "Hawaiian" Locale["haw"]["endonym"] = "ʻŌlelo Hawaiʻi" #Locale["haw"]["translations-of"] @@ -849,11 +850,14 @@ function initLocale() { #Locale["haw"]["examples"] #Locale["haw"]["see-also"] Locale["haw"]["family"] = "Austronesian" + Locale["haw"]["branch"] = "Malayo-Polynesian" Locale["haw"]["iso"] = "haw" Locale["haw"]["glotto"] = "hawa1245" Locale["haw"]["script"] = "Latn" + Locale["haw"]["spoken-in"] = "the US state of Hawaii" + Locale["haw"]["supported-by"] = "google" - #34 Hausa, Latin alphabet + # Hausa, Latin alphabet Locale["ha"]["name"] = "Hausa" Locale["ha"]["endonym"] = "Hausa" Locale["ha"]["translations-of"] = "Fassarar %s" @@ -862,11 +866,14 @@ function initLocale() { Locale["ha"]["examples"] = "Misalai" Locale["ha"]["see-also"] = "Duba kuma" Locale["ha"]["family"] = "Afro-Asiatic" + Locale["ha"]["branch"] = "Chadic" Locale["ha"]["iso"] = "hau" Locale["ha"]["glotto"] = "haus1257" Locale["ha"]["script"] = "Latn" + Locale["ha"]["spoken-in"] = "Chad; Nigeria; Niger; Ghana; Cameroon; Benin" + Locale["ha"]["supported-by"] = "google" - #35 Hebrew + # Hebrew Locale["he"]["name"] = "Hebrew" Locale["he"]["endonym"] = "עִבְרִית" Locale["he"]["translations-of"] = "תרגומים של %s" @@ -875,12 +882,31 @@ function initLocale() { Locale["he"]["examples"] = "דוגמאות" Locale["he"]["see-also"] = "ראה גם" Locale["he"]["family"] = "Afro-Asiatic" + Locale["he"]["branch"] = "Semitic" Locale["he"]["iso"] = "heb" Locale["he"]["glotto"] = "hebr1245" Locale["he"]["script"] = "Hebr" Locale["he"]["rtl"] = "true" # RTL language + Locale["he"]["spoken-in"] = "Israel" + Locale["he"]["supported-by"] = "google; bing; yandex" - #36 Hindi + # Hill Mari / Western Mari + Locale["mrj"]["name"] = "Hill Mari" + Locale["mrj"]["endonym"] = "Кырык мары" + #Locale["mrj"]["translations-of"] + #Locale["mrj"]["definitions-of"] + #Locale["mrj"]["synonyms"] + #Locale["mrj"]["examples"] + #Locale["mrj"]["see-also"] + Locale["mrj"]["family"] = "Uralic" + Locale["mrj"]["branch"] = "Mari" + Locale["mrj"]["iso"] = "mrj" + Locale["mrj"]["glotto"] = "west2392" + Locale["mrj"]["script"] = "Cyrl" + Locale["mrj"]["spoken-in"] = "the Gornomariysky, Yurinsky and Kilemarsky districts of Mari El, Russia" + Locale["mrj"]["supported-by"] = "yandex" + + # Hindi Locale["hi"]["name"] = "Hindi" Locale["hi"]["endonym"] = "हिन्दी" Locale["hi"]["translations-of"] = "%s के अनुवाद" @@ -889,11 +915,14 @@ function initLocale() { Locale["hi"]["examples"] = "उदाहरण" Locale["hi"]["see-also"] = "यह भी देखें" Locale["hi"]["family"] = "Indo-European" + Locale["hi"]["branch"] = "Indo-Aryan" Locale["hi"]["iso"] = "hin" Locale["hi"]["glotto"] = "hind1269" Locale["hi"]["script"] = "Deva" + Locale["hi"]["spoken-in"] = "India" + Locale["hi"]["supported-by"] = "google; bing; yandex" - #37 Hmong (First Vernacular Hmong) + # Hmong (First Vernacular Hmong) Locale["hmn"]["name"] = "Hmong" Locale["hmn"]["endonym"] = "Hmoob" Locale["hmn"]["translations-of"] = "Lus txhais: %s" @@ -902,11 +931,25 @@ function initLocale() { #Locale["hmn"]["examples"] #Locale["hmn"]["see-also"] Locale["hmn"]["family"] = "Hmong-Mien" + Locale["hmn"]["branch"] = "Hmongic" Locale["hmn"]["iso"] = "hmn" Locale["hmn"]["glotto"] = "firs1234" Locale["hmn"]["script"] = "Latn" - - #38 Hungarian + Locale["hmn"]["spoken-in"] = "China; Vietnam; Laos; Myanmar; Thailand" + Locale["hmn"]["supported-by"] = "google; bing" + + # Hmong Daw (White Hmong) + #Locale["mww"]["name"] = "Hmong Daw" + #Locale["mww"]["endonym"] = "Hmoob Daw" + #Locale["mww"]["family"] = "Hmong-Mien" + #Locale["mww"]["branch"] = "Hmongic" + #Locale["mww"]["iso"] = "mww" + #Locale["mww"]["glotto"] = "hmon1333" + #Locale["mww"]["script"] = "Latn" + #Locale["mww"]["spoken-in"] = "China; Vietnam; Laos; Myanmar; Thailand" + #Locale["mww"]["supported-by"] = "bing" + + # Hungarian Locale["hu"]["name"] = "Hungarian" Locale["hu"]["endonym"] = "Magyar" Locale["hu"]["translations-of"] = "%s fordításai" @@ -915,9 +958,14 @@ function initLocale() { Locale["hu"]["examples"] = "Példák" Locale["hu"]["see-also"] = "Lásd még" Locale["hu"]["family"] = "Uralic" + Locale["hu"]["branch"] = "Ugric" Locale["hu"]["iso"] = "hun" Locale["hu"]["glotto"] = "hung1274" Locale["hu"]["script"] = "Latn" + Locale["hu"]["spoken-in"] = "Hungary" + Locale["hu"]["supported-by"] = "google; bing; yandex" + + #39 Icelandic Locale["is"]["name"] = "Icelandic" @@ -2084,15 +2132,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Hmong Daw (White Hmong) - Locale["mww"]["support"] = "bing-only" - Locale["mww"]["name"] = "Hmong Daw" - Locale["mww"]["endonym"] = "Hmoob Daw" - Locale["mww"]["family"] = "Hmong-Mien" - Locale["mww"]["iso"] = "mww" - Locale["mww"]["glotto"] = "hmon1333" - Locale["mww"]["script"] = "Latn" - #* Portuguese (European) Locale["pt-PT"]["support"] = "bing-only" Locale["pt-PT"]["name"] = "Portuguese (European)" @@ -2189,20 +2228,6 @@ function initLocale() { Locale["mhr"]["glotto"] = "east2328" Locale["mhr"]["script"] = "Cyrl" - #? Hill Mari - Locale["mrj"]["support"] = "yandex-only" - Locale["mrj"]["name"] = "Hill Mari" - Locale["mrj"]["endonym"] = "Кырык мары" - #Locale["mrj"]["translations-of"] - #Locale["mrj"]["definitions-of"] - #Locale["mrj"]["synonyms"] - #Locale["mrj"]["examples"] - #Locale["mrj"]["see-also"] - Locale["mrj"]["family"] = "Uralic" - Locale["mrj"]["iso"] = "mrj" - Locale["mrj"]["glotto"] = "west2392" - Locale["mrj"]["script"] = "Cyrl" - #? Interlingue Locale["ie"]["support"] = "unstable" Locale["ie"]["name"] = "Interlingue" @@ -2356,6 +2381,7 @@ function initLocaleAlias( i) { LocaleAlias["jw"] = "jv" # withdrawn language code for Javanese LocaleAlias["kurdish"] = "ku" # Kurdish: default to "ku" (N.B. Google uses this code for Kurmanji) LocaleAlias["mo"] = "ro" # Moldavian or Moldovan considered a variant of the Romanian language + LocaleAlias["mww"] = "hmn" # mww (Hmong Daw) treated the same as hmn (the inclusive code for Hmong) LocaleAlias["nb"] = "no" # Google Translate does not distinguish between Bokmål and Nynorsk (but Bing does!) LocaleAlias["nn"] = "no" LocaleAlias["pt"] = "pt-BR" # Portuguese: default to Brazilian Portuguese (as in Google Translate) From 4c3438490e17ad86227d0b596fe17a52ee506679 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 31 Jul 2022 22:13:16 +0200 Subject: [PATCH 051/119] Translators/BingTranslator: fix for Hmong Daw --- include/Translators/BingTranslator.awk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index 48c245f8..4e6db4b5 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -226,6 +226,7 @@ function bingTranslate(text, sl, tl, hl, # See: if (_sl == "auto") _sl = "auto-detect" if (_sl == "tl") _sl = "fil" # Bing uses 'fil' for Filipino + if (_sl == "hmn") _sl = "mww" # Bing uses 'mww' for Hmong Daw if (_sl == "no") _sl = "nb" # Bing uses Norwegian Bokmål # Bing uses 'pt' or 'pt-br' for Brazilian Portuguese, 'pt-pt' for European Portuguese if (_sl == "pt-BR") _sl = "pt" # just pt-br @@ -233,6 +234,7 @@ function bingTranslate(text, sl, tl, hl, if (_sl == "zh-CN") _sl = "zh-Hans" if (_sl == "zh-TW") _sl = "zh-Hant" if (_tl == "tl") _tl = "fil" + if (_tl == "hmn") _tl = "mww" if (_tl == "no") _tl = "nb" if (_tl == "pt-BR") _tl = "pt" else if (_tl == "pt-PT") _tl = "pt-pt" From 475b1f7af2b8b804756b6d2e6f557b495e27478e Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Mon, 1 Aug 2022 18:12:52 +0200 Subject: [PATCH 052/119] LanguageData: update section I --- include/LanguageData.awk | 65 +++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index fe36cb63..4d383707 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -965,9 +965,7 @@ function initLocale() { Locale["hu"]["spoken-in"] = "Hungary" Locale["hu"]["supported-by"] = "google; bing; yandex" - - - #39 Icelandic + # Icelandic Locale["is"]["name"] = "Icelandic" Locale["is"]["endonym"] = "Íslenska" Locale["is"]["translations-of"] = "Þýðingar á %s" @@ -976,11 +974,14 @@ function initLocale() { Locale["is"]["examples"] = "Dæmi" Locale["is"]["see-also"] = "Sjá einnig" Locale["is"]["family"] = "Indo-European" + Locale["is"]["branch"] = "North Germanic" Locale["is"]["iso"] = "isl" Locale["is"]["glotto"] = "icel1247" Locale["is"]["script"] = "Latn" + Locale["is"]["spoken-in"] = "Iceland" + Locale["is"]["supported-by"] = "google; bing; yandex" - #40 Igbo + # Igbo Locale["ig"]["name"] = "Igbo" Locale["ig"]["endonym"] = "Igbo" Locale["ig"]["translations-of"] = "Ntụgharị asụsụ nke %s" @@ -989,9 +990,12 @@ function initLocale() { Locale["ig"]["examples"] = "Ọmụmaatụ" Locale["ig"]["see-also"] = "Hụkwuo" Locale["ig"]["family"] = "Atlantic-Congo" + Locale["ig"]["branch"] = "Igboid" Locale["ig"]["iso"] = "ibo" Locale["ig"]["glotto"] = "nucl1417" Locale["ig"]["script"] = "Latn" + Locale["ig"]["spoken-in"] = "southeastern Nigeria" + Locale["ig"]["supported-by"] = "google" # Ilocano Locale["ilo"]["name"] = "Ilocano" @@ -1002,11 +1006,14 @@ function initLocale() { #Locale["ilo"]["examples"] #Locale["ilo"]["see-also"] Locale["ilo"]["family"] = "Austronesian" + Locale["ilo"]["branch"] = "Malayo-Polynesian" Locale["ilo"]["iso"] = "ilo" Locale["ilo"]["glotto"] = "ilok1237" Locale["ilo"]["script"] = "Latn" + Locale["ilo"]["spoken-in"] = "the northern Philippines" + Locale["ilo"]["supported-by"] = "google" - #41 Indonesian + # Indonesian Locale["id"]["name"] = "Indonesian" Locale["id"]["endonym"] = "Bahasa Indonesia" Locale["id"]["translations-of"] = "Terjemahan dari %s" @@ -1015,12 +1022,34 @@ function initLocale() { Locale["id"]["examples"] = "Contoh" Locale["id"]["see-also"] = "Lihat juga" Locale["id"]["family"] = "Austronesian" + Locale["id"]["branch"] = "Malayo-Polynesian" Locale["id"]["iso"] = "ind" Locale["id"]["glotto"] = "indo1316" Locale["id"]["script"] = "Latn" + Locale["id"]["spoken-in"] = "Indonesia" + Locale["id"]["supported-by"] = "google; bing; yandex" + + # Interlingue + Locale["ie"]["name"] = "Interlingue" + Locale["ie"]["name2"] = "Occidental" + Locale["ie"]["endonym"] = "Interlingue" + #Locale["ie"]["translations-of"] + #Locale["ie"]["definitions-of"] + #Locale["ie"]["synonyms"] + #Locale["ie"]["examples"] + #Locale["ie"]["see-also"] + Locale["ie"]["family"] = "Constructed language" + #Locale["ie"]["branch"] + Locale["ie"]["iso"] = "ile" + Locale["ie"]["glotto"] = "occi1241" + Locale["ie"]["script"] = "Latn" + Locale["ie"]["spoken-in"] = "worldwide" + Locale["ie"]["description"] = "an international auxiliary language" + Locale["ie"]["supported-by"] = "" - #42 Irish + # Irish Locale["ga"]["name"] = "Irish" + Locale["ga"]["name2"] = "Gaelic" Locale["ga"]["endonym"] = "Gaeilge" Locale["ga"]["translations-of"] = "Aistriúcháin ar %s" Locale["ga"]["definitions-of"] = "Sainmhínithe ar %s" @@ -1028,11 +1057,14 @@ function initLocale() { Locale["ga"]["examples"] = "Samplaí" Locale["ga"]["see-also"] = "féach freisin" Locale["ga"]["family"] = "Indo-European" + Locale["ga"]["branch"] = "Celtic" Locale["ga"]["iso"] = "gle" Locale["ga"]["glotto"] = "iris1253" Locale["ga"]["script"] = "Latn" + Locale["ga"]["spoken-in"] = "Ireland" + Locale["ga"]["supported-by"] = "google; bing; yandex" - #43 Italian + # Italian Locale["it"]["name"] = "Italian" Locale["it"]["endonym"] = "Italiano" Locale["it"]["translations-of"] = "Traduzioni di %s" @@ -1041,10 +1073,15 @@ function initLocale() { Locale["it"]["examples"] = "Esempi" Locale["it"]["see-also"] = "Vedi anche" Locale["it"]["family"] = "Indo-European" + Locale["it"]["branch"] = "Italo-Dalmatian" Locale["it"]["iso"] = "ita" Locale["it"]["glotto"] = "ital1282" Locale["it"]["script"] = "Latn" Locale["it"]["dictionary"] = "true" # has dictionary + Locale["it"]["spoken-in"] = "Italy; Switzerland; San Marino; Vatican City" + Locale["it"]["supported-by"] = "google; bing; yandex" + + #44 Japanese Locale["ja"]["name"] = "Japanese" @@ -2228,20 +2265,6 @@ function initLocale() { Locale["mhr"]["glotto"] = "east2328" Locale["mhr"]["script"] = "Cyrl" - #? Interlingue - Locale["ie"]["support"] = "unstable" - Locale["ie"]["name"] = "Interlingue" - Locale["ie"]["endonym"] = "Interlingue" - #Locale["ie"]["translations-of"] - #Locale["ie"]["definitions-of"] - #Locale["ie"]["synonyms"] - #Locale["ie"]["examples"] - #Locale["ie"]["see-also"] - Locale["ie"]["family"] = "Constructed language" - Locale["ie"]["iso"] = "ile" - Locale["ie"]["glotto"] = "occi1241" - Locale["ie"]["script"] = "Latn" - #? Occitan Locale["oc"]["support"] = "unstable" Locale["oc"]["name"] = "Occitan" From e0655c1c72df8f918d82a8310a846a0292881703 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Mon, 1 Aug 2022 22:48:14 +0200 Subject: [PATCH 053/119] LanguageData: add 4 Inuit languages --- include/LanguageData.awk | 64 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 4d383707..d45aa50f 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -793,6 +793,22 @@ function initLocale() { Locale["el"]["spoken-in"] = "Greece; Cyprus; southern Albania" Locale["el"]["supported-by"] = "google; bing; yandex" + # Greenlandic (West Greenlandic) + Locale["kl"]["name"] = "Greenlandic" + Locale["kl"]["endonym"] = "Kalaallisut" + #Locale["kl"]["translations-of"] + #Locale["kl"]["definitions-of"] + #Locale["kl"]["synonyms"] + #Locale["kl"]["examples"] + #Locale["kl"]["see-also"] + Locale["kl"]["family"] = "Eskimo-Aleut" + Locale["kl"]["branch"] = "Inuit" + Locale["kl"]["iso"] = "kal" + Locale["kl"]["glotto"] = "kala1399" + Locale["kl"]["script"] = "Latn" + Locale["kl"]["spoken-in"] = "Greenland" + Locale["kl"]["supported-by"] = "" + # Guarani Locale["gn"]["name"] = "Guarani" Locale["gn"]["endonym"] = "Avañe'ẽ" @@ -1047,6 +1063,54 @@ function initLocale() { Locale["ie"]["description"] = "an international auxiliary language" Locale["ie"]["supported-by"] = "" + # Inuinnaqtun + Locale["ikt"]["name"] = "Inuinnaqtun" + Locale["ikt"]["endonym"] = "Inuinnaqtun" + #Locale["ikt"]["translations-of"] + #Locale["ikt"]["definitions-of"] + #Locale["ikt"]["synonyms"] + #Locale["ikt"]["examples"] + #Locale["ikt"]["see-also"] + Locale["ikt"]["family"] = "Eskimo-Aleut" + Locale["ikt"]["branch"] = "Inuit" + Locale["ikt"]["iso"] = "ikt" + Locale["ikt"]["glotto"] = "copp1244" + Locale["ikt"]["script"] = "Latn" + Locale["ikt"]["spoken-in"] = "the Canadian Arctic" + Locale["ikt"]["supported-by"] = "bing" + + # Inuktitut + Locale["iu"]["name"] = "Inuktitut" + Locale["iu"]["endonym"] = "ᐃᓄᒃᑎᑐᑦ" + #Locale["iu"]["translations-of"] + #Locale["iu"]["definitions-of"] + #Locale["iu"]["synonyms"] + #Locale["iu"]["examples"] + #Locale["iu"]["see-also"] + Locale["iu"]["family"] = "Eskimo-Aleut" + Locale["iu"]["branch"] = "Inuit" + Locale["iu"]["iso"] = "iku" + Locale["iu"]["glotto"] = "east2534" + Locale["iu"]["script"] = "Cans" + Locale["iu"]["spoken-in"] = "the Canadian Arctic" + Locale["iu"]["supported-by"] = "bing" + + # Inuktitut, Latin alphabet + Locale["iu-Latn"]["name"] = "Inuktitut (Latin)" + Locale["iu-Latn"]["endonym"] = "Inuktitut" + #Locale["iu-Latn"]["translations-of"] + #Locale["iu-Latn"]["definitions-of"] + #Locale["iu-Latn"]["synonyms"] + #Locale["iu-Latn"]["examples"] + #Locale["iu-Latn"]["see-also"] + Locale["iu-Latn"]["family"] = "Eskimo-Aleut" + Locale["iu-Latn"]["branch"] = "Inuit" + Locale["iu-Latn"]["iso"] = "iku" + Locale["iu-Latn"]["glotto"] = "east2534" + Locale["iu-Latn"]["script"] = "Latn" + Locale["iu-Latn"]["spoken-in"] = "the Canadian Arctic" + Locale["iu-Latn"]["supported-by"] = "bing" + # Irish Locale["ga"]["name"] = "Irish" Locale["ga"]["name2"] = "Gaelic" From 249e244184e3e59c8470d921bd0c520c8907efb0 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Mon, 1 Aug 2022 22:57:20 +0200 Subject: [PATCH 054/119] LanguageHelper: getDescription() --- include/LanguageHelper.awk | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index bfa80637..ed3022b3 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -199,6 +199,11 @@ function getWrittenIn(code, i, j, r, regions, str) { return r } +# Return the extra description of a language. +function getDescription(code) { + return Locale[getCode(code)]["description"] +} + # Return 1 if a language is supported by Google; otherwise return 0. function isSupportedByGoogle(code, engines, i, str) { str = Locale[getCode(code)]["supported-by"] @@ -245,12 +250,17 @@ function getDetails(code, article, desc, group, iso, name, names, script, wri if (getBranch(code)) { article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" - desc = sprintf("%s is %s %s language spoken mainly in %s.", - names, article, getBranch(code), getSpokenIn(code)) - } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") { - desc = sprintf("%s is a language spoken mainly in %s.", - names, getSpokenIn(code)) - } else + if (iso == "eng") + desc = sprintf("%s is %s %s language spoken %s.", + names, article, getBranch(code), getSpokenIn(code)) + else + desc = sprintf("%s is %s %s language spoken mainly in %s.", + names, article, getBranch(code), getSpokenIn(code)) + } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") + desc = sprintf("%s is a language spoken mainly in %s.", names, getSpokenIn(code)) + else if (tolower(getFamily(code)) == "constructed language") + desc = sprintf("%s is %s.", names, getDescription(code)) + else desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", names, getFamily(code), getSpokenIn(code)) if (writing && getWrittenIn(code)) From dad375ac61256ebb88c2e671f0d0043507b6998c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Mon, 1 Aug 2022 23:01:05 +0200 Subject: [PATCH 055/119] LanguageHelper: scriptName(): add Cans --- include/LanguageHelper.awk | 1 + 1 file changed, 1 insertion(+) diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index ed3022b3..f4ed93f8 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -128,6 +128,7 @@ function scriptName(code) { case "Arab": return "Arabic" case "Armn": return "Armenian" case "Beng": return "Bengali" + case "Cans": return "Canadian Aboriginal Syllabics" case "Cher": return "Cherokee" case "Cyrl": return "Cyrillic" case "Deva": return "Devanagari" From 582dd2400e8e433a44b3a24293411138f49e0d2c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 2 Aug 2022 16:28:13 +0200 Subject: [PATCH 056/119] LanguageData: update section J --- include/LanguageData.awk | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index d45aa50f..e232dfbb 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1079,7 +1079,7 @@ function initLocale() { Locale["ikt"]["spoken-in"] = "the Canadian Arctic" Locale["ikt"]["supported-by"] = "bing" - # Inuktitut + # Inuktitut (Eastern Canadian Inuktitut) Locale["iu"]["name"] = "Inuktitut" Locale["iu"]["endonym"] = "ᐃᓄᒃᑎᑐᑦ" #Locale["iu"]["translations-of"] @@ -1095,7 +1095,7 @@ function initLocale() { Locale["iu"]["spoken-in"] = "the Canadian Arctic" Locale["iu"]["supported-by"] = "bing" - # Inuktitut, Latin alphabet + # Inuktitut (Eastern Canadian Inuktitut), Latin alphabet Locale["iu-Latn"]["name"] = "Inuktitut (Latin)" Locale["iu-Latn"]["endonym"] = "Inuktitut" #Locale["iu-Latn"]["translations-of"] @@ -1145,9 +1145,7 @@ function initLocale() { Locale["it"]["spoken-in"] = "Italy; Switzerland; San Marino; Vatican City" Locale["it"]["supported-by"] = "google; bing; yandex" - - - #44 Japanese + # Japanese Locale["ja"]["name"] = "Japanese" Locale["ja"]["endonym"] = "日本語" Locale["ja"]["translations-of"] = "「%s」の翻訳" @@ -1156,12 +1154,15 @@ function initLocale() { Locale["ja"]["examples"] = "例" Locale["ja"]["see-also"] = "関連項目" Locale["ja"]["family"] = "Japonic" + #Locale["ja"]["branch"] Locale["ja"]["iso"] = "jpn" Locale["ja"]["glotto"] = "nucl1643" Locale["ja"]["script"] = "Jpan" Locale["ja"]["dictionary"] = "true" # has dictionary + Locale["ja"]["spoken-in"] = "Japan" + Locale["ja"]["supported-by"] = "google; bing; yandex" - #45 Javanese, Latin alphabet + # Javanese, Latin alphabet Locale["jv"]["name"] = "Javanese" Locale["jv"]["endonym"] = "Basa Jawa" Locale["jv"]["translations-of"] = "Terjemahan %s" @@ -1170,9 +1171,14 @@ function initLocale() { Locale["jv"]["examples"] = "Conto" Locale["jv"]["see-also"] = "Deleng uga" Locale["jv"]["family"] = "Austronesian" + Locale["jv"]["branch"] = "Malayo-Polynesian" Locale["jv"]["iso"] = "jav" Locale["jv"]["glotto"] = "java1254" Locale["jv"]["script"] = "Latn" + Locale["jv"]["spoken-in"] = "Java, Indonesia" + Locale["jv"]["supported-by"] = "google; yandex" + + #46 Kannada (Modern Kannada) Locale["kn"]["name"] = "Kannada" From 2b45223ccf501a265eb0ff9b501e18c2447be947 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 2 Aug 2022 17:42:34 +0200 Subject: [PATCH 057/119] LanguageData: update section K --- include/LanguageData.awk | 50 ++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 10 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index e232dfbb..d2d288b5 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1178,9 +1178,7 @@ function initLocale() { Locale["jv"]["spoken-in"] = "Java, Indonesia" Locale["jv"]["supported-by"] = "google; yandex" - - - #46 Kannada (Modern Kannada) + # Kannada (Modern Kannada) Locale["kn"]["name"] = "Kannada" Locale["kn"]["endonym"] = "ಕನ್ನಡ" Locale["kn"]["translations-of"] = "%s ನ ಅನುವಾದಗಳು" @@ -1189,11 +1187,14 @@ function initLocale() { Locale["kn"]["examples"] = "ಉದಾಹರಣೆಗಳು" Locale["kn"]["see-also"] = "ಇದನ್ನೂ ಗಮನಿಸಿ" Locale["kn"]["family"] = "Dravidian" + Locale["kn"]["branch"] = "South Dravidian" Locale["kn"]["iso"] = "kan" Locale["kn"]["glotto"] = "nucl1305" Locale["kn"]["script"] = "Knda" + Locale["kn"]["spoken-in"] = "the southwestern India" + Locale["kn"]["supported-by"] = "google; bing; yandex" - #47 Kazakh, Cyrillic alphabet + # Kazakh, Cyrillic alphabet Locale["kk"]["name"] = "Kazakh" Locale["kk"]["endonym"] = "Қазақ тілі" Locale["kk"]["translations-of"] = "%s аудармалары" @@ -1202,11 +1203,14 @@ function initLocale() { Locale["kk"]["examples"] = "Мысалдар" Locale["kk"]["see-also"] = "Келесі тізімді де көріңіз:" Locale["kk"]["family"] = "Turkic" + Locale["kk"]["branch"] = "Kipchak" Locale["kk"]["iso"] = "kaz" Locale["kk"]["glotto"] = "kaza1248" Locale["kk"]["script"] = "Cyrl" + Locale["kk"]["spoken-in"] = "Kazakhstan; China; Mongolia; Russia; Kyrgyzstan; Uzbekistan" + Locale["kk"]["supported-by"] = "google; bing; yandex" - #48 Khmer (Central Khmer) + # Khmer (Central Khmer) Locale["km"]["name"] = "Khmer" Locale["km"]["endonym"] = "ភាសាខ្មែរ" Locale["km"]["translations-of"] = "ការ​បក​ប្រែ​នៃ %s" @@ -1215,11 +1219,14 @@ function initLocale() { Locale["km"]["examples"] = "ឧទាហរណ៍" Locale["km"]["see-also"] = "មើល​ផង​ដែរ" Locale["km"]["family"] = "Austroasiatic" + Locale["km"]["branch"] = "Khmeric" Locale["km"]["iso"] = "khm" Locale["km"]["glotto"] = "cent1989" Locale["km"]["script"] = "Khmr" + Locale["km"]["spoken-in"] = "Cambodia; Thailand; Vietnam" + Locale["km"]["supported-by"] = "google; bing; yandex" - #49 Kinyarwanda + # Kinyarwanda Locale["rw"]["name"] = "Kinyarwanda" Locale["rw"]["endonym"] = "Ikinyarwanda" #Locale["rw"]["translations-of"] @@ -1228,9 +1235,12 @@ function initLocale() { #Locale["rw"]["examples"] #Locale["rw"]["see-also"] Locale["rw"]["family"] = "Atlantic-Congo" + Locale["rw"]["branch"] = "Bantu" Locale["rw"]["iso"] = "kin" Locale["rw"]["glotto"] = "kiny1244" Locale["rw"]["script"] = "Latn" + Locale["rw"]["spoken-in"] = "Rwanda; Uganda; DR Congo; Tanzania" + Locale["rw"]["supported-by"] = "google" # Konkani (Goan Konkani) Locale["gom"]["name"] = "Konkani" @@ -1241,11 +1251,14 @@ function initLocale() { #Locale["gom"]["examples"] #Locale["gom"]["see-also"] Locale["gom"]["family"] = "Indo-European" + Locale["gom"]["branch"] = "Indo-Aryan" Locale["gom"]["iso"] = "gom" Locale["gom"]["glotto"] = "goan1235" Locale["gom"]["script"] = "Deva" + Locale["gom"]["spoken-in"] = "the western coastal region of India" + Locale["gom"]["supported-by"] = "google" - #50 Korean + # Korean Locale["ko"]["name"] = "Korean" Locale["ko"]["endonym"] = "한국어" Locale["ko"]["translations-of"] = "%s의 번역" @@ -1254,10 +1267,13 @@ function initLocale() { Locale["ko"]["examples"] = "예문" Locale["ko"]["see-also"] = "참조" Locale["ko"]["family"] = "Koreanic" + #Locale["ko"]["branch"] Locale["ko"]["iso"] = "kor" Locale["ko"]["glotto"] = "kore1280" Locale["ko"]["script"] = "Kore" Locale["ko"]["dictionary"] = "true" # has dictionary + Locale["ko"]["spoken-in"] = "South Korea; North Korea; China" + Locale["ko"]["supported-by"] = "google; bing; yandex" # Krio Locale["kri"]["name"] = "Krio" @@ -1268,11 +1284,14 @@ function initLocale() { #Locale["kri"]["examples"] #Locale["kri"]["see-also"] Locale["kri"]["family"] = "Indo-European" + Locale["kri"]["branch"] = "English Creole" Locale["kri"]["iso"] = "kri" Locale["kri"]["glotto"] = "krio1253" Locale["kri"]["script"] = "Latn" + Locale["kri"]["spoken-in"] = "Sierra Leone" + Locale["kri"]["supported-by"] = "google" - #51 Kurdish (Northern) / Kurmanji + # Kurdish (Northern Kurdish) / Kurmanji Locale["ku"]["name"] = "Kurdish (Northern)" Locale["ku"]["name2"] = "Kurmanji" Locale["ku"]["endonym"] = "Kurmancî" @@ -1283,11 +1302,14 @@ function initLocale() { #Locale["ku"]["examples"] #Locale["ku"]["see-also"] Locale["ku"]["family"] = "Indo-European" + Locale["ku"]["branch"] = "Iranian" Locale["ku"]["iso"] = "kmr" Locale["ku"]["glotto"] = "nort2641" Locale["ku"]["script"] = "Latn" + Locale["ku"]["spoken-in"] = "southeast Turkey; northwest and northeast Iran; northern Iraq; northern Syria; the Caucasus and Khorasan regions" + Locale["ku"]["supported-by"] = "google" - # Kurdish (Central) / Sorani + # Kurdish (Central Kurdish) / Sorani Locale["ckb"]["name"] = "Kurdish (Central)" Locale["ckb"]["name2"] = "Sorani" Locale["ckb"]["endonym"] = "سۆرانی" @@ -1298,12 +1320,15 @@ function initLocale() { #Locale["ckb"]["examples"] #Locale["ckb"]["see-also"] Locale["ckb"]["family"] = "Indo-European" + Locale["ckb"]["branch"] = "Iranian" Locale["ckb"]["iso"] = "ckb" Locale["ckb"]["glotto"] = "cent1972" Locale["ckb"]["script"] = "Arab" Locale["ckb"]["rtl"] = "true" # RTL language + Locale["ckb"]["spoken-in"] = "Iraqi Kurdistan; western Iran" + Locale["ckb"]["supported-by"] = "google" - #52 Kyrgyz + # Kyrgyz, Cyrillic alphabet Locale["ky"]["name"] = "Kyrgyz" Locale["ky"]["endonym"] = "Кыргызча" Locale["ky"]["translations-of"] = "%s котормосу" @@ -1312,9 +1337,14 @@ function initLocale() { Locale["ky"]["examples"] = "Мисалдар" Locale["ky"]["see-also"] = "Дагы караңыз" Locale["ky"]["family"] = "Turkic" + Locale["ky"]["branch"] = "Kipchak" Locale["ky"]["iso"] = "kir" Locale["ky"]["glotto"] = "kirg1245" Locale["ky"]["script"] = "Cyrl" + Locale["ky"]["spoken-in"] = "Kyrgyzstan; China; Tajikistan; Afghanistan; Pakistan" + Locale["ky"]["supported-by"] = "google; bing; yandex" + + #53 Lao Locale["lo"]["name"] = "Lao" From c96104f9e8c0c088673c8bb67bdba28f9cb96e30 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 2 Aug 2022 17:56:47 +0200 Subject: [PATCH 058/119] Translators/BingTranslator: fix for Kurdish --- include/Translators/BingTranslator.awk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index 4e6db4b5..f71bcbe9 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -227,6 +227,8 @@ function bingTranslate(text, sl, tl, hl, if (_sl == "auto") _sl = "auto-detect" if (_sl == "tl") _sl = "fil" # Bing uses 'fil' for Filipino if (_sl == "hmn") _sl = "mww" # Bing uses 'mww' for Hmong Daw + if (_sl == "ku") _sl = "kmr" # Bing uses 'kmr' for Northern Kurdish + else if (_sl == "ckb") _sl = "ku" # and 'ku' for Central Kurdish if (_sl == "no") _sl = "nb" # Bing uses Norwegian Bokmål # Bing uses 'pt' or 'pt-br' for Brazilian Portuguese, 'pt-pt' for European Portuguese if (_sl == "pt-BR") _sl = "pt" # just pt-br @@ -235,6 +237,8 @@ function bingTranslate(text, sl, tl, hl, if (_sl == "zh-TW") _sl = "zh-Hant" if (_tl == "tl") _tl = "fil" if (_tl == "hmn") _tl = "mww" + if (_tl == "ku") _tl = "kmr" + else if (_tl == "ckb") _tl = "ku" if (_tl == "no") _tl = "nb" if (_tl == "pt-BR") _tl = "pt" else if (_tl == "pt-PT") _tl = "pt-pt" From a978fa376b7a0fb0bea82b87d2cca276f2a72efd Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 2 Aug 2022 18:51:19 +0200 Subject: [PATCH 059/119] LanguageData: remove tlh-Piqd which Bing does not seem to support anymore --- include/LanguageData.awk | 45 +++++++++++++++++++++----------------- include/LanguageHelper.awk | 1 - 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index d2d288b5..63639b50 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1242,6 +1242,30 @@ function initLocale() { Locale["rw"]["spoken-in"] = "Rwanda; Uganda; DR Congo; Tanzania" Locale["rw"]["supported-by"] = "google" + # Klingon, Latin alphabet + Locale["tlh-Latn"]["name"] = "Klingon" + Locale["tlh-Latn"]["endonym"] = "tlhIngan Hol" + Locale["tlh-Latn"]["family"] = "Constructed language" + #Locale["tlh-Latn"]["branch"] + Locale["tlh-Latn"]["iso"] = "tlh-Latn" + Locale["tlh-Latn"]["glotto"] = "klin1234" + Locale["tlh-Latn"]["script"] = "Latn" + Locale["tlh-Latn"]["spoken-in"] = "the Star Trek universe" + Locale["tlh-Latn"]["description"] = "a fictional language spoken by the Klingons in the Star Trek universe" + Locale["tlh-Latn"]["supported-by"] = "bing" + + ## Klingon, pIqaD + #Locale["tlh-Piqd"]["name"] = "Klingon (pIqaD)" + #Locale["tlh-Piqd"]["endonym"] = " " + #Locale["tlh-Piqd"]["family"] = "Constructed language" + ##Locale["tlh-Piqd"]["branch"] + #Locale["tlh-Piqd"]["iso"] = "tlh-Piqd" + #Locale["tlh-Piqd"]["glotto"] = "klin1234" + #Locale["tlh-Piqd"]["script"] = "Piqd" + #Locale["tlh-Piqd"]["spoken-in"] = "the Star Trek universe" + #Locale["tlh-Piqd"]["description"] = "a fictional language spoken by the Klingons in the Star Trek universe" + #Locale["tlh-Piqd"]["supported-by"] = "bing" + # Konkani (Goan Konkani) Locale["gom"]["name"] = "Konkani" Locale["gom"]["endonym"] = "कोंकणी" @@ -2319,24 +2343,6 @@ function initLocale() { Locale["yua"]["glotto"] = "yuca1254" Locale["yua"]["script"] = "Latn" - #* Klingon, Latin alphabet - Locale["tlh"]["support"] = "bing-only" - Locale["tlh"]["name"] = "Klingon" - Locale["tlh"]["endonym"] = "tlhIngan Hol" - Locale["tlh"]["family"] = "Constructed language" - Locale["tlh"]["iso"] = "tlh" - #Locale["tlh"]["glotto"] - Locale["tlh"]["script"] = "Latn" - - #* Klingon, pIqaD - Locale["tlh-Qaak"]["support"] = "bing-only" - Locale["tlh-Qaak"]["name"] = "Klingon (pIqaD)" - Locale["tlh-Qaak"]["endonym"] = " " - Locale["tlh-Qaak"]["family"] = "Constructed language" - Locale["tlh-Qaak"]["iso"] = "tlh" - #Locale["tlh-Qaak"]["glotto"] - Locale["tlh-Qaak"]["script"] = "Piqd" - #? Breton Locale["br"]["support"] = "unstable" Locale["br"]["name"] = "Breton" @@ -2520,8 +2526,7 @@ function initLocaleAlias( i) { LocaleAlias["zh-Hant"] = "zh-TW" LocaleAlias["zho"] = "zh-CN" LocaleAlias["chinese"] = "zh-CN" - LocaleAlias["tlh-Latn"] = "tlh" - LocaleAlias["tlh-Piqd"] = "tlh-Qaak" + LocaleAlias["tlh"] = "tlh-Latn" LocaleAlias["mni"] = "mni-Mtei" # Meitei: default to Meitei Mayek # TODO: more aliases } diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index f4ed93f8..621689f5 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -151,7 +151,6 @@ function scriptName(code) { case "Mlym": return "Malayalam" case "Mymr": return "Myanmar" case "Orya": return "Oriya" - case "Piqd": return "Klingon (pIqaD)" case "Sinh": return "Sinhala" case "Taml": return "Tamil" case "Telu": return "Telugu" From 6dfc91ceedb99ee055edd850998140003223b511 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 3 Aug 2022 16:48:12 +0200 Subject: [PATCH 060/119] LanguageData: update section L --- include/LanguageData.awk | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 63639b50..5a5bf50d 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1368,9 +1368,7 @@ function initLocale() { Locale["ky"]["spoken-in"] = "Kyrgyzstan; China; Tajikistan; Afghanistan; Pakistan" Locale["ky"]["supported-by"] = "google; bing; yandex" - - - #53 Lao + # Lao Locale["lo"]["name"] = "Lao" Locale["lo"]["endonym"] = "ລາວ" Locale["lo"]["translations-of"] = "ຄຳ​ແປ​ສຳລັບ %s" @@ -1378,12 +1376,15 @@ function initLocale() { Locale["lo"]["synonyms"] = "ຄຳທີ່ຄ້າຍກັນ %s" Locale["lo"]["examples"] = "ຕົວຢ່າງ" Locale["lo"]["see-also"] = "ເບິ່ງ​ເພີ່ມ​ເຕີມ" - Locale["lo"]["family"] = "Tai-Kadai" + Locale["lo"]["family"] = "Kra-Dai" + Locale["lo"]["branch"] = "Tai" Locale["lo"]["iso"] = "lao" Locale["lo"]["glotto"] = "laoo1244" Locale["lo"]["script"] = "Laoo" + Locale["lo"]["spoken-in"] = "Laos; Thailand; Cambodia" + Locale["lo"]["supported-by"] = "google; bing; yandex" - #54 Latin + # Latin Locale["la"]["name"] = "Latin" Locale["la"]["endonym"] = "Latina" Locale["la"]["translations-of"] = "Versio de %s" @@ -1392,11 +1393,14 @@ function initLocale() { #Locale["la"]["examples"] #Locale["la"]["see-also"] Locale["la"]["family"] = "Indo-European" + Locale["la"]["branch"] = "Latino-Faliscan" Locale["la"]["iso"] = "lat" Locale["la"]["glotto"] = "lati1261" Locale["la"]["script"] = "Latn" + Locale["la"]["spoken-in"] = "ancient Rome" + Locale["la"]["supported-by"] = "google; yandex" - #55 Latvian + # Latvian Locale["lv"]["name"] = "Latvian" Locale["lv"]["endonym"] = "Latviešu" Locale["lv"]["translations-of"] = "%s tulkojumi" @@ -1405,9 +1409,12 @@ function initLocale() { Locale["lv"]["examples"] = "Piemēri" Locale["lv"]["see-also"] = "Skatiet arī" Locale["lv"]["family"] = "Indo-European" + Locale["lv"]["branch"] = "Eastern Baltic" Locale["lv"]["iso"] = "lav" Locale["lv"]["glotto"] = "latv1249" Locale["lv"]["script"] = "Latn" + Locale["lv"]["spoken-in"] = "Latvia" + Locale["lv"]["supported-by"] = "google; bing; yandex" # Lingala Locale["ln"]["name"] = "Lingala" @@ -1418,11 +1425,14 @@ function initLocale() { #Locale["ln"]["examples"] #Locale["ln"]["see-also"] Locale["ln"]["family"] = "Atlantic-Congo" + Locale["ln"]["branch"] = "Bantu" Locale["ln"]["iso"] = "lin" Locale["ln"]["glotto"] = "ling1269" Locale["ln"]["script"] = "Latn" + Locale["ln"]["spoken-in"] = "DR Congo; Republic of the Congo; Angola; Central African Republic; southern South Sudan" + Locale["ln"]["supported-by"] = "google" - #56 Lithuanian + # Lithuanian Locale["lt"]["name"] = "Lithuanian" Locale["lt"]["endonym"] = "Lietuvių" Locale["lt"]["translations-of"] = "„%s“ vertimai" @@ -1431,9 +1441,12 @@ function initLocale() { Locale["lt"]["examples"] = "Pavyzdžiai" Locale["lt"]["see-also"] = "Taip pat žiūrėkite" Locale["lt"]["family"] = "Indo-European" + Locale["lt"]["branch"] = "Eastern Baltic" Locale["lt"]["iso"] = "lit" Locale["lt"]["glotto"] = "lith1251" Locale["lt"]["script"] = "Latn" + Locale["lt"]["spoken-in"] = "Lithuania" + Locale["lt"]["supported-by"] = "google; bing; yandex" # Luganda Locale["lg"]["name"] = "Luganda" @@ -1445,11 +1458,14 @@ function initLocale() { #Locale["lg"]["examples"] #Locale["lg"]["see-also"] Locale["lg"]["family"] = "Atlantic-Congo" + Locale["lg"]["branch"] = "Bantu" Locale["lg"]["iso"] = "lug" Locale["lg"]["glotto"] = "gand1255" Locale["lg"]["script"] = "Latn" + Locale["lg"]["spoken-in"] = "Uganda; Rwanda" + Locale["lg"]["supported-by"] = "google" - #57 Luxembourgish + # Luxembourgish Locale["lb"]["name"] = "Luxembourgish" Locale["lb"]["endonym"] = "Lëtzebuergesch" #Locale["lb"]["translations-of"] @@ -1458,9 +1474,14 @@ function initLocale() { #Locale["lb"]["examples"] #Locale["lb"]["see-also"] Locale["lb"]["family"] = "Indo-European" + Locale["lb"]["branch"] = "West Germanic" Locale["lb"]["iso"] = "ltz" Locale["lb"]["glotto"] = "luxe1241" Locale["lb"]["script"] = "Latn" + Locale["lb"]["spoken-in"] = "Luxembourg" + Locale["lb"]["supported-by"] = "google; yandex" + + #58 Macedonian Locale["mk"]["name"] = "Macedonian" @@ -2076,7 +2097,7 @@ function initLocale() { Locale["th"]["synonyms"] = "คำพ้องความหมาย" Locale["th"]["examples"] = "ตัวอย่าง" Locale["th"]["see-also"] = "ดูเพิ่มเติม" - Locale["th"]["family"] = "Tai-Kadai" + Locale["th"]["family"] = "Kra-Dai" Locale["th"]["iso"] = "tha" Locale["th"]["glotto"] = "thai1261" Locale["th"]["script"] = "Thai" From f9cae6e2454657288ac430c62f624810562a9732 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 3 Aug 2022 23:22:51 +0200 Subject: [PATCH 061/119] LanguageData: update section M --- include/LanguageData.awk | 107 +++++++++++++++++++++++++++++---------- 1 file changed, 81 insertions(+), 26 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 5a5bf50d..2ac3397b 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1481,9 +1481,7 @@ function initLocale() { Locale["lb"]["spoken-in"] = "Luxembourg" Locale["lb"]["supported-by"] = "google; yandex" - - - #58 Macedonian + # Macedonian Locale["mk"]["name"] = "Macedonian" Locale["mk"]["endonym"] = "Македонски" Locale["mk"]["translations-of"] = "Преводи на %s" @@ -1492,9 +1490,12 @@ function initLocale() { Locale["mk"]["examples"] = "Примери" Locale["mk"]["see-also"] = "Види и" Locale["mk"]["family"] = "Indo-European" + Locale["mk"]["branch"] = "South Slavic" Locale["mk"]["iso"] = "mkd" Locale["mk"]["glotto"] = "mace1250" Locale["mk"]["script"] = "Cyrl" + Locale["mk"]["spoken-in"] = "North Macedonia; Albania; Bosnia and Herzegovina; Romania; Serbia" + Locale["mk"]["supported-by"] = "google; bing; yandex" # Maithili Locale["mai"]["name"] = "Maithili" @@ -1505,11 +1506,14 @@ function initLocale() { #Locale["mai"]["examples"] #Locale["mai"]["see-also"] Locale["mai"]["family"] = "Indo-European" + Locale["mai"]["branch"] = "Indo-Aryan" Locale["mai"]["iso"] = "mai" Locale["mai"]["glotto"] = "mait1250" Locale["mai"]["script"] = "Deva" + Locale["mai"]["spoken-in"] = "the Mithila region in India and Nepal" + Locale["mai"]["supported-by"] = "google" - #59 Malagasy (Plateau Malagasy) + # Malagasy (Plateau Malagasy) Locale["mg"]["name"] = "Malagasy" Locale["mg"]["endonym"] = "Malagasy" Locale["mg"]["translations-of"] = "Dikan'ny %s" @@ -1518,11 +1522,14 @@ function initLocale() { Locale["mg"]["examples"] = "Ohatra" Locale["mg"]["see-also"] = "Jereo ihany koa" Locale["mg"]["family"] = "Austronesian" + Locale["mg"]["branch"] = "Malayo-Polynesian" Locale["mg"]["iso"] = "mlg" Locale["mg"]["glotto"] = "plat1254" Locale["mg"]["script"] = "Latn" + Locale["mg"]["spoken-in"] = "Madagascar; the Comoros; Mayotte" + Locale["mg"]["supported-by"] = "google; bing; yandex" - #60 Malay (Standard Malay) + # Malay (Standard Malay), Latin alphabet Locale["ms"]["name"] = "Malay" Locale["ms"]["endonym"] = "Bahasa Melayu" Locale["ms"]["translations-of"] = "Terjemahan %s" @@ -1531,11 +1538,14 @@ function initLocale() { Locale["ms"]["examples"] = "Contoh" Locale["ms"]["see-also"] = "Lihat juga" Locale["ms"]["family"] = "Austronesian" + Locale["ms"]["branch"] = "Malayo-Polynesian" Locale["ms"]["iso"] = "msa" Locale["ms"]["glotto"] = "stan1306" Locale["ms"]["script"] = "Latn" + Locale["ms"]["spoken-in"] = "Malaysia; Singapore; Indonesia; Brunei; East Timor" + Locale["ms"]["supported-by"] = "google; bing; yandex" - #61 Malayalam + # Malayalam Locale["ml"]["name"] = "Malayalam" Locale["ml"]["endonym"] = "മലയാളം" Locale["ml"]["translations-of"] = "%s എന്നതിന്റെ വിവർത്തനങ്ങൾ" @@ -1544,11 +1554,14 @@ function initLocale() { Locale["ml"]["examples"] = "ഉദാഹരണങ്ങള്‍" Locale["ml"]["see-also"] = "ഇതും കാണുക" Locale["ml"]["family"] = "Dravidian" + Locale["ml"]["branch"] = "South Dravidian" Locale["ml"]["iso"] = "mal" Locale["ml"]["glotto"] = "mala1464" Locale["ml"]["script"] = "Mlym" + Locale["ml"]["spoken-in"] = "Kerala, Lakshadweep and Puducherry in India" + Locale["ml"]["supported-by"] = "google; bing; yandex" - #62 Maltese + # Maltese Locale["mt"]["name"] = "Maltese" Locale["mt"]["endonym"] = "Malti" Locale["mt"]["translations-of"] = "Traduzzjonijiet ta' %s" @@ -1557,11 +1570,14 @@ function initLocale() { Locale["mt"]["examples"] = "Eżempji" Locale["mt"]["see-also"] = "Ara wkoll" Locale["mt"]["family"] = "Afro-Asiatic" + Locale["mt"]["branch"] = "Semitic" Locale["mt"]["iso"] = "mlt" Locale["mt"]["glotto"] = "malt1254" Locale["mt"]["script"] = "Latn" + Locale["mt"]["spoken-in"] = "Malta" + Locale["mt"]["supported-by"] = "google; bing; yandex" - #63 Maori + # Maori Locale["mi"]["name"] = "Maori" Locale["mi"]["endonym"] = "Māori" Locale["mi"]["translations-of"] = "Ngā whakamāoritanga o %s" @@ -1570,11 +1586,14 @@ function initLocale() { Locale["mi"]["examples"] = "Ngā Tauira:" Locale["mi"]["see-also"] = "Tiro hoki:" Locale["mi"]["family"] = "Austronesian" + Locale["mi"]["branch"] = "Malayo-Polynesian" Locale["mi"]["iso"] = "mri" Locale["mi"]["glotto"] = "maor1246" Locale["mi"]["script"] = "Latn" + Locale["mi"]["spoken-in"] = "New Zealand" + Locale["mi"]["supported-by"] = "google; bing; yandex" - #64 Marathi + # Marathi Locale["mr"]["name"] = "Marathi" Locale["mr"]["endonym"] = "मराठी" Locale["mr"]["translations-of"] = "%s ची भाषांतरे" @@ -1583,9 +1602,28 @@ function initLocale() { Locale["mr"]["examples"] = "उदाहरणे" Locale["mr"]["see-also"] = "हे देखील पहा" Locale["mr"]["family"] = "Indo-European" + Locale["mr"]["branch"] = "Indo-Aryan" Locale["mr"]["iso"] = "mar" Locale["mr"]["glotto"] = "mara1378" Locale["mr"]["script"] = "Deva" + Locale["mr"]["spoken-in"] = "the Indian state of Maharashtra" + Locale["mr"]["supported-by"] = "google; bing; yandex" + + # Eastern Mari / Meadow Mari + Locale["mhr"]["name"] = "Eastern Mari" + Locale["mhr"]["endonym"] = "Олык марий" + #Locale["mhr"]["translations-of"] + #Locale["mhr"]["definitions-of"] + #Locale["mhr"]["synonyms"] + #Locale["mhr"]["examples"] + #Locale["mhr"]["see-also"] + Locale["mhr"]["family"] = "Uralic" + Locale["mhr"]["branch"] = "Mari" + Locale["mhr"]["iso"] = "mhr" + Locale["mhr"]["glotto"] = "east2328" + Locale["mhr"]["script"] = "Cyrl" + Locale["mhr"]["spoken-in"] = "Mari El, Russia" + Locale["mhr"]["supported-by"] = "yandex" # Meiteilon / Manipuri Locale["mni-Mtei"]["name"] = "Meiteilon" @@ -1599,9 +1637,12 @@ function initLocale() { #Locale["mni-Mtei"]["examples"] #Locale["mni-Mtei"]["see-also"] Locale["mni-Mtei"]["family"] = "Sino-Tibetan" + Locale["mni-Mtei"]["branch"] = "Tibeto-Burman" Locale["mni-Mtei"]["iso"] = "mni" Locale["mni-Mtei"]["glotto"] = "mani1292" Locale["mni-Mtei"]["script"] = "Mtei" + Locale["mni-Mtei"]["spoken-in"] = "the northeast India; Bangladesh; Myanmar" + Locale["mni-Mtei"]["supported-by"] = "google" # Mizo Locale["lus"]["name"] = "Mizo" @@ -1612,11 +1653,14 @@ function initLocale() { #Locale["lus"]["examples"] #Locale["lus"]["see-also"] Locale["lus"]["family"] = "Sino-Tibetan" + Locale["lus"]["branch"] = "Tibeto-Burman" Locale["lus"]["iso"] = "lus" Locale["lus"]["glotto"] = "lush1249" Locale["lus"]["script"] = "Latn" + Locale["lus"]["spoken-in"] = "the Indian state of Mizoram" + Locale["lus"]["supported-by"] = "google" - #65 Mongolian, Cyrillic alphabet + # Mongolian, Cyrillic alphabet Locale["mn"]["name"] = "Mongolian" Locale["mn"]["endonym"] = "Монгол" Locale["mn"]["translations-of"] = "%s-н орчуулга" @@ -1625,11 +1669,30 @@ function initLocale() { Locale["mn"]["examples"] = "Жишээнүүд" Locale["mn"]["see-also"] = "Мөн харах" Locale["mn"]["family"] = "Mongolic" + #Locale["mn"]["branch"] Locale["mn"]["iso"] = "mon" Locale["mn"]["glotto"] = "mong1331" Locale["mn"]["script"] = "Cyrl" - - #66 Myanmar / Burmese + Locale["mn"]["spoken-in"] = "Mongolia; Inner Mongolia in China" + Locale["mn"]["supported-by"] = "google; bing; yandex" + + # Mongolian, traditional Mongolian alphabet + Locale["mn-Mong"]["name"] = "Mongolian (Traditional)" + Locale["mn-Mong"]["endonym"] = "ᠮᠣᠩᠭᠣᠯ" + #Locale["mn-Mong"]["translations-of"] + #Locale["mn-Mong"]["definitions-of"] + #Locale["mn-Mong"]["synonyms"] + #Locale["mn-Mong"]["examples"] + #Locale["mn-Mong"]["see-also"] + Locale["mn-Mong"]["family"] = "Mongolic" + #Locale["mn-Mong"]["branch"] + Locale["mn-Mong"]["iso"] = "mon-Mong" + Locale["mn-Mong"]["glotto"] = "mong1331" + Locale["mn-Mong"]["script"] = "Mong" + Locale["mn-Mong"]["spoken-in"] = "Mongolia; Inner Mongolia in China" + Locale["mn-Mong"]["supported-by"] = "bing" + + # Myanmar / Burmese Locale["my"]["name"] = "Myanmar" Locale["my"]["name2"] = "Burmese" Locale["my"]["endonym"] = "မြန်မာစာ" @@ -1639,9 +1702,14 @@ function initLocale() { Locale["my"]["examples"] = "ဥပမာ" Locale["my"]["see-also"] = "ဖော်ပြပါများကိုလဲ ကြည့်ပါ" Locale["my"]["family"] = "Sino-Tibetan" + Locale["my"]["branch"] = "Tibeto-Burman" Locale["my"]["iso"] = "mya" Locale["my"]["glotto"] = "nucl1310" Locale["my"]["script"] = "Mymr" + Locale["my"]["spoken-in"] = "Myanmar" + Locale["my"]["supported-by"] = "google; bing; yandex" + + #67 Nepali Locale["ne"]["name"] = "Nepali" @@ -2378,20 +2446,6 @@ function initLocale() { Locale["br"]["glotto"] = "bret1244" Locale["br"]["script"] = "Latn" - #? Eastern Mari - Locale["mhr"]["support"] = "yandex-only" - Locale["mhr"]["name"] = "Eastern Mari" - Locale["mhr"]["endonym"] = "Олык марий" - #Locale["mhr"]["translations-of"] - #Locale["mhr"]["definitions-of"] - #Locale["mhr"]["synonyms"] - #Locale["mhr"]["examples"] - #Locale["mhr"]["see-also"] - Locale["mhr"]["family"] = "Uralic" - Locale["mhr"]["iso"] = "mhr" - Locale["mhr"]["glotto"] = "east2328" - Locale["mhr"]["script"] = "Cyrl" - #? Occitan Locale["oc"]["support"] = "unstable" Locale["oc"]["name"] = "Occitan" @@ -2530,6 +2584,7 @@ function initLocaleAlias( i) { LocaleAlias["ji"] = "yi" # withdrawn language code for Yiddish LocaleAlias["jw"] = "jv" # withdrawn language code for Javanese LocaleAlias["kurdish"] = "ku" # Kurdish: default to "ku" (N.B. Google uses this code for Kurmanji) + LocaleAlias["mari"] = "mhr" # Mari: default to "mhr" (Eastern Mari) LocaleAlias["mo"] = "ro" # Moldavian or Moldovan considered a variant of the Romanian language LocaleAlias["mww"] = "hmn" # mww (Hmong Daw) treated the same as hmn (the inclusive code for Hmong) LocaleAlias["nb"] = "no" # Google Translate does not distinguish between Bokmål and Nynorsk (but Bing does!) From b0b8f05d4aa63bb74797ef657237324f34697669 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 3 Aug 2022 23:23:12 +0200 Subject: [PATCH 062/119] LanguageHelper: scriptName(): add Mong --- include/LanguageHelper.awk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index 621689f5..3e682cc6 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -147,8 +147,9 @@ function scriptName(code) { case "Kore": return "Korean (Hangul + Han)" case "Laoo": return "Lao" case "Latn": return "Latin" - case "Mtei": return "Meitei Mayek" case "Mlym": return "Malayalam" + case "Mong": return "Mongolian" + case "Mtei": return "Meitei Mayek" case "Mymr": return "Myanmar" case "Orya": return "Oriya" case "Sinh": return "Sinhala" From 228ede4ed67384a7e0aa745e077e3c503e9ce987 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 3 Aug 2022 23:23:33 +0200 Subject: [PATCH 063/119] Translators/BingTranslator: fix for Mongolian (Cyrillic) --- include/Translators/BingTranslator.awk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index f71bcbe9..67656f63 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -229,6 +229,7 @@ function bingTranslate(text, sl, tl, hl, if (_sl == "hmn") _sl = "mww" # Bing uses 'mww' for Hmong Daw if (_sl == "ku") _sl = "kmr" # Bing uses 'kmr' for Northern Kurdish else if (_sl == "ckb") _sl = "ku" # and 'ku' for Central Kurdish + if (_sl == "mn") _sl = "mn-Cyrl" # Bing uses 'mn-Cyrl' for Mongolian (Cyrillic) if (_sl == "no") _sl = "nb" # Bing uses Norwegian Bokmål # Bing uses 'pt' or 'pt-br' for Brazilian Portuguese, 'pt-pt' for European Portuguese if (_sl == "pt-BR") _sl = "pt" # just pt-br @@ -239,6 +240,7 @@ function bingTranslate(text, sl, tl, hl, if (_tl == "hmn") _tl = "mww" if (_tl == "ku") _tl = "kmr" else if (_tl == "ckb") _tl = "ku" + if (_tl == "mn") _tl = "mn-Cyrl" if (_tl == "no") _tl = "nb" if (_tl == "pt-BR") _tl = "pt" else if (_tl == "pt-PT") _tl = "pt-pt" From a26fa545785b2bc354f8cb93a6230b1a55d6938b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 4 Aug 2022 14:43:08 +0200 Subject: [PATCH 064/119] LanguageData: update section N --- include/LanguageData.awk | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 2ac3397b..23b5af72 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1609,8 +1609,9 @@ function initLocale() { Locale["mr"]["spoken-in"] = "the Indian state of Maharashtra" Locale["mr"]["supported-by"] = "google; bing; yandex" - # Eastern Mari / Meadow Mari + # Mari (Eastern Mari / Meadow Mari) Locale["mhr"]["name"] = "Eastern Mari" + Locale["mhr"]["name2"] = "Meadow Mari" Locale["mhr"]["endonym"] = "Олык марий" #Locale["mhr"]["translations-of"] #Locale["mhr"]["definitions-of"] @@ -1709,9 +1710,7 @@ function initLocale() { Locale["my"]["spoken-in"] = "Myanmar" Locale["my"]["supported-by"] = "google; bing; yandex" - - - #67 Nepali + # Nepali Locale["ne"]["name"] = "Nepali" Locale["ne"]["endonym"] = "नेपाली" Locale["ne"]["translations-of"] = "%sका अनुवाद" @@ -1720,11 +1719,14 @@ function initLocale() { Locale["ne"]["examples"] = "उदाहरणहरु" Locale["ne"]["see-also"] = "यो पनि हेर्नुहोस्" Locale["ne"]["family"] = "Indo-European" + Locale["ne"]["branch"] = "Indo-Aryan" Locale["ne"]["iso"] = "nep" Locale["ne"]["glotto"] = "nepa1254" Locale["ne"]["script"] = "Deva" + Locale["ne"]["spoken-in"] = "Nepal; India" + Locale["ne"]["supported-by"] = "google; bing; yandex" - #68 Norwegian + # Norwegian Locale["no"]["name"] = "Norwegian" Locale["no"]["endonym"] = "Norsk" Locale["no"]["translations-of"] = "Oversettelser av %s" @@ -1733,9 +1735,14 @@ function initLocale() { Locale["no"]["examples"] = "Eksempler" Locale["no"]["see-also"] = "Se også" Locale["no"]["family"] = "Indo-European" + Locale["no"]["branch"] = "North Germanic" Locale["no"]["iso"] = "nor" Locale["no"]["glotto"] = "norw1258" Locale["no"]["script"] = "Latn" + Locale["no"]["spoken-in"] = "Norway" + Locale["no"]["supported-by"] = "google; bing; yandex" + + #69 Odia / Oriya Locale["or"]["name"] = "Odia" From 65b389a200964599918c36a33dcac1ba7587808c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 4 Aug 2022 16:39:27 +0200 Subject: [PATCH 065/119] LanguageData: update section O --- include/LanguageData.awk | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 23b5af72..8ebca777 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1742,9 +1742,7 @@ function initLocale() { Locale["no"]["spoken-in"] = "Norway" Locale["no"]["supported-by"] = "google; bing; yandex" - - - #69 Odia / Oriya + # Odia / Oriya Locale["or"]["name"] = "Odia" Locale["or"]["name2"] = "Oriya" Locale["or"]["endonym"] = "ଓଡ଼ିଆ" @@ -1754,9 +1752,12 @@ function initLocale() { #Locale["or"]["examples"] #Locale["or"]["see-also"] Locale["or"]["family"] = "Indo-European" + Locale["or"]["branch"] = "Indo-Aryan" Locale["or"]["iso"] = "ori" Locale["or"]["glotto"] = "macr1269" Locale["or"]["script"] = "Orya" + Locale["or"]["spoken-in"] = "the Indian state of Odisha" + Locale["or"]["supported-by"] = "google; bing" # Oromo Locale["om"]["name"] = "Oromo" @@ -1767,9 +1768,14 @@ function initLocale() { #Locale["om"]["examples"] #Locale["om"]["see-also"] Locale["om"]["family"] = "Afro-Asiatic" + Locale["om"]["branch"] = "Cushitic" Locale["om"]["iso"] = "orm" Locale["om"]["glotto"] = "nucl1736" Locale["om"]["script"] = "Latn" + Locale["om"]["spoken-in"] = "the Ethiopian state of Oromia; northeastern Kenya" + Locale["om"]["supported-by"] = "google" + + #70 Pashto / Pushto Locale["ps"]["name"] = "Pashto" From ac13cc35862a3adf12f9cc0d69b721b9c95df122 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 5 Aug 2022 17:29:19 +0200 Subject: [PATCH 066/119] LanguageData: update section P --- include/LanguageData.awk | 87 ++++++++++++++++++++++++---------------- 1 file changed, 53 insertions(+), 34 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 8ebca777..a9b7303b 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1775,9 +1775,23 @@ function initLocale() { Locale["om"]["spoken-in"] = "the Ethiopian state of Oromia; northeastern Kenya" Locale["om"]["supported-by"] = "google" + # Papiamento + Locale["pap"]["name"] = "Papiamento" + Locale["pap"]["endonym"] = "Papiamentu" + #Locale["pap"]["translations-of"] + #Locale["pap"]["definitions-of"] + #Locale["pap"]["synonyms"] + #Locale["pap"]["examples"] + #Locale["pap"]["see-also"] + Locale["pap"]["family"] = "Indo-European" + Locale["pap"]["branch"] = "Portuguese Creole" + Locale["pap"]["iso"] = "pap" + Locale["pap"]["glotto"] = "papi1253" + Locale["pap"]["script"] = "Latn" + Locale["pap"]["spoken-in"] = "the Dutch Caribbean" + Locale["pap"]["supported-by"] = "yandex" - - #70 Pashto / Pushto + # Pashto / Pushto Locale["ps"]["name"] = "Pashto" Locale["ps"]["name2"] = "Pushto" Locale["ps"]["endonym"] = "پښتو" @@ -1787,12 +1801,15 @@ function initLocale() { Locale["ps"]["examples"] = "بېلګې" Locale["ps"]["see-also"] = "دا هم ووینئ" Locale["ps"]["family"] = "Indo-European" + Locale["ps"]["branch"] = "Iranian" Locale["ps"]["iso"] = "pus" Locale["ps"]["glotto"] = "pash1269" Locale["ps"]["script"] = "Arab" Locale["ps"]["rtl"] = "true" # RTL language + Locale["ps"]["spoken-in"] = "Afghanistan; Pakistan" + Locale["ps"]["supported-by"] = "google; bing" - #71 Persian / Farsi (Western Farsi / Iranian Persian) + # Persian / Farsi (Western Farsi / Iranian Persian) Locale["fa"]["name"] = "Persian" Locale["fa"]["name2"] = "Farsi" Locale["fa"]["endonym"] = "فارسی" @@ -1802,12 +1819,15 @@ function initLocale() { Locale["fa"]["examples"] = "مثال‌ها" Locale["fa"]["see-also"] = "همچنین مراجعه کنید به" Locale["fa"]["family"] = "Indo-European" + Locale["fa"]["branch"] = "Iranian" Locale["fa"]["iso"] = "fas" Locale["fa"]["glotto"] = "west2369" Locale["fa"]["script"] = "Arab" Locale["fa"]["rtl"] = "true" # RTL language + Locale["fa"]["spoken-in"] = "Iran" + Locale["fa"]["supported-by"] = "google; bing; yandex" - #72 Polish + # Polish Locale["pl"]["name"] = "Polish" Locale["pl"]["endonym"] = "Polski" Locale["pl"]["translations-of"] = "Tłumaczenia %s" @@ -1816,11 +1836,14 @@ function initLocale() { Locale["pl"]["examples"] = "Przykłady" Locale["pl"]["see-also"] = "Zobacz też" Locale["pl"]["family"] = "Indo-European" + Locale["pl"]["branch"] = "West Slavic" Locale["pl"]["iso"] = "pol" Locale["pl"]["glotto"] = "poli1260" Locale["pl"]["script"] = "Latn" + Locale["pl"]["spoken-in"] = "Poland" + Locale["pl"]["supported-by"] = "google; bing; yandex" - #73 Portuguese (Brazilian) + # Portuguese (Brazilian) Locale["pt-BR"]["name"] = "Portuguese (Brazilian)" Locale["pt-BR"]["endonym"] = "Português Brasileiro" Locale["pt-BR"]["translations-of"] = "Traduções de %s" @@ -1829,12 +1852,31 @@ function initLocale() { Locale["pt-BR"]["examples"] = "Exemplos" Locale["pt-BR"]["see-also"] = "Veja também" Locale["pt-BR"]["family"] = "Indo-European" + Locale["pt-BR"]["branch"] = "Western Romance" Locale["pt-BR"]["iso"] = "por" Locale["pt-BR"]["glotto"] = "braz1246" Locale["pt-BR"]["script"] = "Latn" Locale["pt-BR"]["dictionary"] = "true" # has dictionary + Locale["pt-BR"]["spoken-in"] = "Portugal; Brazil; Cape Verde; Angola; Mozambique; Guinea-Bissau; Equatorial Guinea; São Tomé and Príncipe; East Timor; Macau" + Locale["pt-BR"]["supported-by"] = "google; bing; yandex" - #74 Punjabi, Gurmukhī alphabet + # Portuguese (European) + Locale["pt-PT"]["name"] = "Portuguese (European)" + Locale["pt-PT"]["endonym"] = "Português Europeu" + Locale["pt-PT"]["translations-of"] = "Traduções de %s" + Locale["pt-PT"]["definitions-of"] = "Definições de %s" + Locale["pt-PT"]["synonyms"] = "Sinônimos" + Locale["pt-PT"]["examples"] = "Exemplos" + Locale["pt-PT"]["see-also"] = "Veja também" + Locale["pt-PT"]["family"] = "Indo-European" + Locale["pt-PT"]["branch"] = "Western Romance" + Locale["pt-PT"]["iso"] = "por" + Locale["pt-PT"]["glotto"] = "port1283" + Locale["pt-PT"]["script"] = "Latn" + Locale["pt-PT"]["spoken-in"] = "Portugal; Brazil; Cape Verde; Angola; Mozambique; Guinea-Bissau; Equatorial Guinea; São Tomé and Príncipe; East Timor; Macau" + Locale["pt-PT"]["supported-by"] = "bing" + + # Punjabi, Gurmukhī alphabet Locale["pa"]["name"] = "Punjabi" Locale["pa"]["endonym"] = "ਪੰਜਾਬੀ" Locale["pa"]["translations-of"] = "ਦੇ ਅਨੁਵਾਦ%s" @@ -1843,9 +1885,14 @@ function initLocale() { Locale["pa"]["examples"] = "ਉਦਾਹਰਣਾਂ" Locale["pa"]["see-also"] = "ਇਹ ਵੀ ਵੇਖੋ" Locale["pa"]["family"] = "Indo-European" + Locale["pa"]["branch"] = "Indo-Aryan" Locale["pa"]["iso"] = "pan" Locale["pa"]["glotto"] = "panj1256" Locale["pa"]["script"] = "Guru" + Locale["pa"]["spoken-in"] = "the Punjab region of India and Pakistan" + Locale["pa"]["supported-by"] = "google; bing; yandex" + + # Quechua Locale["qu"]["name"] = "Quechua" @@ -2395,20 +2442,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Portuguese (European) - Locale["pt-PT"]["support"] = "bing-only" - Locale["pt-PT"]["name"] = "Portuguese (European)" - Locale["pt-PT"]["endonym"] = "Português Europeu" - Locale["pt-PT"]["translations-of"] = "Traduções de %s" - Locale["pt-PT"]["definitions-of"] = "Definições de %s" - Locale["pt-PT"]["synonyms"] = "Sinônimos" - Locale["pt-PT"]["examples"] = "Exemplos" - Locale["pt-PT"]["see-also"] = "Veja também" - Locale["pt-PT"]["family"] = "Indo-European" - Locale["pt-PT"]["iso"] = "por" - Locale["pt-PT"]["glotto"] = "port1283" - Locale["pt-PT"]["script"] = "Latn" - #* Querétaro Otomi Locale["otq"]["support"] = "bing-only" Locale["otq"]["name"] = "Querétaro Otomi" @@ -2473,20 +2506,6 @@ function initLocale() { Locale["oc"]["glotto"] = "occi1239" Locale["oc"]["script"] = "Latn" - #? Papiamento - Locale["pap"]["support"] = "yandex-only" - Locale["pap"]["name"] = "Papiamento" - Locale["pap"]["endonym"] = "Papiamentu" - #Locale["pap"]["translations-of"] - #Locale["pap"]["definitions-of"] - #Locale["pap"]["synonyms"] - #Locale["pap"]["examples"] - #Locale["pap"]["see-also"] - Locale["pap"]["family"] = "Indo-European" - Locale["pap"]["iso"] = "pap" - Locale["pap"]["glotto"] = "papi1253" - Locale["pap"]["script"] = "Latn" - #? Romansh Locale["rm"]["support"] = "unstable" Locale["rm"]["name"] = "Romansh" From 0fef352cdb44f337203d7b0e8369a9b79bef4ec5 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 5 Aug 2022 17:41:54 +0200 Subject: [PATCH 067/119] LanguageData: update section Q --- include/LanguageData.awk | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index a9b7303b..27168da0 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1892,8 +1892,6 @@ function initLocale() { Locale["pa"]["spoken-in"] = "the Punjab region of India and Pakistan" Locale["pa"]["supported-by"] = "google; bing; yandex" - - # Quechua Locale["qu"]["name"] = "Quechua" Locale["qu"]["endonym"] = "Runasimi" @@ -1903,9 +1901,25 @@ function initLocale() { #Locale["qu"]["examples"] #Locale["qu"]["see-also"] Locale["qu"]["family"] = "Quechuan" + #Locale["qu"]["branch"] Locale["qu"]["iso"] = "que" Locale["qu"]["glotto"] = "quec1387" Locale["qu"]["script"] = "Latn" + Locale["qu"]["spoken-in"] = "Peru; Bolivia; Ecuador; surrounding countries" + Locale["qu"]["supported-by"] = "google" + + # Querétaro Otomi + Locale["otq"]["name"] = "Querétaro Otomi" + Locale["otq"]["endonym"] = "Hñąñho" + Locale["otq"]["family"] = "Oto-Manguean" + #Locale["otq"]["branch"] + Locale["otq"]["iso"] = "otq" + Locale["otq"]["glotto"] = "quer1236" + Locale["otq"]["script"] = "Latn" + Locale["otq"]["spoken-in"] = "Querétaro in Mexico" + Locale["otq"]["supported-by"] = "bing" + + #75 Romanian Locale["ro"]["name"] = "Romanian" @@ -2442,15 +2456,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Querétaro Otomi - Locale["otq"]["support"] = "bing-only" - Locale["otq"]["name"] = "Querétaro Otomi" - Locale["otq"]["endonym"] = "Hñąñho" - Locale["otq"]["family"] = "Oto-Manguean" - Locale["otq"]["iso"] = "otq" - Locale["otq"]["glotto"] = "quer1236" - Locale["otq"]["script"] = "Latn" - #* Tahitian Locale["ty"]["support"] = "bing-only" Locale["ty"]["name"] = "Tahitian" From ab991a7b8a5d00906a350f2faa89fe5829f7316b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 6 Aug 2022 16:15:01 +0200 Subject: [PATCH 068/119] LanguageData: update section R --- include/LanguageData.awk | 46 ++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 27168da0..a0e586f3 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1919,9 +1919,7 @@ function initLocale() { Locale["otq"]["spoken-in"] = "Querétaro in Mexico" Locale["otq"]["supported-by"] = "bing" - - - #75 Romanian + # Romanian / Moldovan, Latin alphabet Locale["ro"]["name"] = "Romanian" Locale["ro"]["endonym"] = "Română" Locale["ro"]["translations-of"] = "Traduceri pentru %s" @@ -1930,11 +1928,30 @@ function initLocale() { Locale["ro"]["examples"] = "Exemple" Locale["ro"]["see-also"] = "Vedeți și" Locale["ro"]["family"] = "Indo-European" + Locale["ro"]["branch"] = "Eastern Romance" Locale["ro"]["iso"] = "ron" Locale["ro"]["glotto"] = "roma1327" Locale["ro"]["script"] = "Latn" + Locale["ro"]["spoken-in"] = "Romania; Moldova" + Locale["ro"]["supported-by"] = "google; bing; yandex" + + # Romansh + Locale["rm"]["name"] = "Romansh" + Locale["rm"]["endonym"] = "Rumantsch" + #Locale["rm"]["translations-of"] + #Locale["rm"]["definitions-of"] + #Locale["rm"]["synonyms"] + #Locale["rm"]["examples"] + #Locale["rm"]["see-also"] + Locale["rm"]["family"] = "Indo-European" + Locale["rm"]["branch"] = "Western Romance" + Locale["rm"]["iso"] = "roh" + Locale["rm"]["glotto"] = "roma1326" + Locale["rm"]["script"] = "Latn" + Locale["rm"]["spoken-in"] = "the Swiss canton of the Grisons" + Locale["rm"]["supported-by"] = "" - #76 Russian + # Russian Locale["ru"]["name"] = "Russian" Locale["ru"]["endonym"] = "Русский" Locale["ru"]["translations-of"] = "%s: варианты перевода" @@ -1943,10 +1960,15 @@ function initLocale() { Locale["ru"]["examples"] = "Примеры" Locale["ru"]["see-also"] = "Похожие слова" Locale["ru"]["family"] = "Indo-European" + Locale["ru"]["branch"] = "East Slavic" Locale["ru"]["iso"] = "rus" Locale["ru"]["glotto"] = "russ1263" Locale["ru"]["script"] = "Cyrl" Locale["ru"]["dictionary"] = "true" # has dictionary + Locale["ru"]["spoken-in"] = "the Russian-speaking world" + Locale["ru"]["supported-by"] = "google; bing; yandex" + + #77 Samoan Locale["sm"]["name"] = "Samoan" @@ -2511,20 +2533,6 @@ function initLocale() { Locale["oc"]["glotto"] = "occi1239" Locale["oc"]["script"] = "Latn" - #? Romansh - Locale["rm"]["support"] = "unstable" - Locale["rm"]["name"] = "Romansh" - Locale["rm"]["endonym"] = "Rumantsch" - #Locale["rm"]["translations-of"] - #Locale["rm"]["definitions-of"] - #Locale["rm"]["synonyms"] - #Locale["rm"]["examples"] - #Locale["rm"]["see-also"] - Locale["rm"]["family"] = "Indo-European" - Locale["rm"]["iso"] = "roh" - Locale["rm"]["glotto"] = "roma1326" - Locale["rm"]["script"] = "Latn" - #? Tibetan (Standard Tibetan) Locale["bo"]["support"] = "unstable" Locale["bo"]["name"] = "Tibetan" @@ -2623,6 +2631,8 @@ function initLocaleAlias( i) { LocaleAlias["kurdish"] = "ku" # Kurdish: default to "ku" (N.B. Google uses this code for Kurmanji) LocaleAlias["mari"] = "mhr" # Mari: default to "mhr" (Eastern Mari) LocaleAlias["mo"] = "ro" # Moldavian or Moldovan considered a variant of the Romanian language + LocaleAlias["moldavian"] = "ro" + LocaleAlias["moldovan"] = "ro" LocaleAlias["mww"] = "hmn" # mww (Hmong Daw) treated the same as hmn (the inclusive code for Hmong) LocaleAlias["nb"] = "no" # Google Translate does not distinguish between Bokmål and Nynorsk (but Bing does!) LocaleAlias["nn"] = "no" From b67e4a05d9b24cd8a1af11576aa3b6e1c7785f74 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 7 Aug 2022 14:33:21 +0200 Subject: [PATCH 069/119] LanguageData: update section S --- include/LanguageData.awk | 107 +++++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 22 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index a0e586f3..6ddf366b 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -1968,9 +1968,7 @@ function initLocale() { Locale["ru"]["spoken-in"] = "the Russian-speaking world" Locale["ru"]["supported-by"] = "google; bing; yandex" - - - #77 Samoan + # Samoan Locale["sm"]["name"] = "Samoan" Locale["sm"]["endonym"] = "Gagana Sāmoa" #Locale["sm"]["translations-of"] @@ -1979,9 +1977,12 @@ function initLocale() { #Locale["sm"]["examples"] #Locale["sm"]["see-also"] Locale["sm"]["family"] = "Austronesian" + Locale["sm"]["branch"] = "Malayo-Polynesian" Locale["sm"]["iso"] = "smo" Locale["sm"]["glotto"] = "samo1305" Locale["sm"]["script"] = "Latn" + Locale["sm"]["spoken-in"] = "the Samoan Islands" + Locale["sm"]["supported-by"] = "google; bing" # Sanskrit Locale["sa"]["name"] = "Sanskrit" @@ -1992,11 +1993,14 @@ function initLocale() { #Locale["sa"]["examples"] #Locale["sa"]["see-also"] Locale["sa"]["family"] = "Indo-European" + Locale["sa"]["branch"] = "Indo-Aryan" Locale["sa"]["iso"] = "san" Locale["sa"]["glotto"] = "sans1269" Locale["sa"]["script"] = "Deva" + Locale["sa"]["spoken-in"] = "ancient India" + Locale["sa"]["supported-by"] = "google" - #78 Scots Gaelic + # Scots Gaelic / Scottish Gaelic Locale["gd"]["name"] = "Scots Gaelic" Locale["gd"]["endonym"] = "Gàidhlig" Locale["gd"]["translations-of"] = "Eadar-theangachadh airson %s" @@ -2005,11 +2009,14 @@ function initLocale() { Locale["gd"]["examples"] = "Buill-eisimpleir" Locale["gd"]["see-also"] = "Faic na leanas cuideachd" Locale["gd"]["family"] = "Indo-European" + Locale["gd"]["branch"] = "Celtic" Locale["gd"]["iso"] = "gla" Locale["gd"]["glotto"] = "scot1245" Locale["gd"]["script"] = "Latn" + Locale["gd"]["spoken-in"] = "Scotland" + Locale["gd"]["supported-by"] = "google; yandex" - #80 Sepedi (Northern Sotho) + # Sepedi (Northern Sotho) Locale["nso"]["name"] = "Sepedi" Locale["nso"]["name2"] = "Pedi" Locale["nso"]["name3"] = "Northern Sotho" @@ -2020,38 +2027,46 @@ function initLocale() { #Locale["nso"]["examples"] #Locale["nso"]["see-also"] Locale["nso"]["family"] = "Atlantic-Congo" + Locale["nso"]["branch"] = "Bantu" Locale["nso"]["iso"] = "nso" Locale["nso"]["glotto"] = "nort3233" Locale["nso"]["script"] = "Latn" + Locale["nso"]["spoken-in"] = "the northeastern provinces of South Africa" + Locale["nso"]["supported-by"] = "google" - #79a Serbian, Cyrillic alphabet + # Serbian, Cyrillic alphabet Locale["sr-Cyrl"]["name"] = "Serbian (Cyrillic)" - Locale["sr-Cyrl"]["endonym"] = "српски" + Locale["sr-Cyrl"]["endonym"] = "Српски" Locale["sr-Cyrl"]["translations-of"] = "Преводи за „%s“" Locale["sr-Cyrl"]["definitions-of"] = "Дефиниције за %s" Locale["sr-Cyrl"]["synonyms"] = "Синоними" Locale["sr-Cyrl"]["examples"] = "Примери" Locale["sr-Cyrl"]["see-also"] = "Погледајте такође" Locale["sr-Cyrl"]["family"] = "Indo-European" + Locale["sr-Cyrl"]["branch"] = "South Slavic" Locale["sr-Cyrl"]["iso"] = "srp-Cyrl" Locale["sr-Cyrl"]["glotto"] = "serb1264" Locale["sr-Cyrl"]["script"] = "Cyrl" + Locale["sr-Cyrl"]["spoken-in"] = "Serbia; Bosnia and Herzegovina; Montenegro; Kosovo" + Locale["sr-Cyrl"]["supported-by"] = "google; bing; yandex" - #79b Serbian, Latin alphabet - Locale["sr-Latn"]["support"] = "bing-only" + # Serbian, Latin alphabet Locale["sr-Latn"]["name"] = "Serbian (Latin)" - Locale["sr-Latn"]["endonym"] = "srpski" + Locale["sr-Latn"]["endonym"] = "Srpski" Locale["sr-Latn"]["translations-of"] = "Prevodi za „%s“" Locale["sr-Latn"]["definitions-of"] = "Definicije za %s" Locale["sr-Latn"]["synonyms"] = "Sinonimi" Locale["sr-Latn"]["examples"] = "Primeri" Locale["sr-Latn"]["see-also"] = "Pogledajte takođe" Locale["sr-Latn"]["family"] = "Indo-European" + Locale["sr-Latn"]["branch"] = "South Slavic" Locale["sr-Latn"]["iso"] = "srp-Latn" Locale["sr-Latn"]["glotto"] = "serb1264" Locale["sr-Latn"]["script"] = "Latn" + Locale["sr-Latn"]["spoken-in"] = "Serbia; Bosnia and Herzegovina; Montenegro; Kosovo" + Locale["sr-Latn"]["supported-by"] = "bing" - #80 Sesotho (Southern Sotho) + # Sesotho (Southern Sotho) Locale["st"]["name"] = "Sesotho" Locale["st"]["name2"] = "Sotho" Locale["st"]["name3"] = "Southern Sotho" @@ -2062,11 +2077,26 @@ function initLocale() { Locale["st"]["examples"] = "Mehlala" Locale["st"]["see-also"] = "Bona hape" Locale["st"]["family"] = "Atlantic-Congo" + Locale["st"]["branch"] = "Bantu" Locale["st"]["iso"] = "sot" Locale["st"]["glotto"] = "sout2807" Locale["st"]["script"] = "Latn" - - #81 Shona + Locale["st"]["spoken-in"] = "Lesotho; South Africa; Zimbabwe" + Locale["st"]["supported-by"] = "google" + + # Setswana + Locale["tn"]["name"] = "Setswana" + Locale["tn"]["name2"] = "Tswana" + Locale["tn"]["endonym"] = "Setswana" + Locale["tn"]["family"] = "Atlantic-Congo" + Locale["tn"]["branch"] = "Bantu" + Locale["tn"]["iso"] = "tsn" + Locale["tn"]["glotto"] = "tswa1253" + Locale["tn"]["script"] = "Latn" + Locale["tn"]["spoken-in"] = "Botswana; South Africa" + Locale["tn"]["supported-by"] = "" + + # Shona Locale["sn"]["name"] = "Shona" Locale["sn"]["endonym"] = "chiShona" Locale["sn"]["translations-of"] = "Shanduro dze %s" @@ -2075,11 +2105,14 @@ function initLocale() { Locale["sn"]["examples"] = "Mienzaniso" Locale["sn"]["see-also"] = "Onawo" Locale["sn"]["family"] = "Atlantic-Congo" + Locale["sn"]["branch"] = "Bantu" Locale["sn"]["iso"] = "sna" Locale["sn"]["glotto"] = "core1255" Locale["sn"]["script"] = "Latn" + Locale["sn"]["spoken-in"] = "Zimbabwe" + Locale["sn"]["supported-by"] = "google" - #82 Sindhi + # Sindhi Locale["sd"]["name"] = "Sindhi" Locale["sd"]["endonym"] = "سنڌي" Locale["sd"]["translations-of"] = "%s جو ترجمو" @@ -2088,13 +2121,17 @@ function initLocale() { Locale["sd"]["examples"] = "مثالون" Locale["sd"]["see-also"] = "به ڏسو" Locale["sd"]["family"] = "Indo-European" + Locale["sd"]["branch"] = "Indo-Aryan" Locale["sd"]["iso"] = "snd" Locale["sd"]["glotto"] = "sind1272" Locale["sd"]["script"] = "Arab" Locale["sd"]["rtl"] = "true" # RTL language + Locale["sd"]["spoken-in"] = "the region of Sindh in Pakistan; India" + Locale["sd"]["supported-by"] = "google" - #83 Sinhala + # Sinhala / Sinhalese Locale["si"]["name"] = "Sinhala" + Locale["si"]["name2"] = "Sinhalese" Locale["si"]["endonym"] = "සිංහල" Locale["si"]["translations-of"] = "%s හි පරිවර්තන" Locale["si"]["definitions-of"] = "%s හි නිර්වචන" @@ -2102,11 +2139,14 @@ function initLocale() { Locale["si"]["examples"] = "උදාහරණ" Locale["si"]["see-also"] = "මෙයත් බලන්න" Locale["si"]["family"] = "Indo-European" + Locale["si"]["branch"] = "Indo-Aryan" Locale["si"]["iso"] = "sin" Locale["si"]["glotto"] = "sinh1246" Locale["si"]["script"] = "Sinh" + Locale["si"]["spoken-in"] = "Sri Lanka" + Locale["si"]["supported-by"] = "google; yandex" - #84 Slovak + # Slovak Locale["sk"]["name"] = "Slovak" Locale["sk"]["endonym"] = "Slovenčina" Locale["sk"]["translations-of"] = "Preklady výrazu: %s" @@ -2115,11 +2155,14 @@ function initLocale() { Locale["sk"]["examples"] = "Príklady" Locale["sk"]["see-also"] = "Pozrite tiež" Locale["sk"]["family"] = "Indo-European" + Locale["sk"]["branch"] = "West Slavic" Locale["sk"]["iso"] = "slk" Locale["sk"]["glotto"] = "slov1269" Locale["sk"]["script"] = "Latn" + Locale["sk"]["spoken-in"] = "Slovakia" + Locale["sk"]["supported-by"] = "google; bing; yandex" - #85 Slovenian / Slovene + # Slovenian / Slovene Locale["sl"]["name"] = "Slovenian" Locale["sl"]["name2"] = "Slovene" Locale["sl"]["endonym"] = "Slovenščina" @@ -2129,11 +2172,14 @@ function initLocale() { Locale["sl"]["examples"] = "Primeri" Locale["sl"]["see-also"] = "Glejte tudi" Locale["sl"]["family"] = "Indo-European" + Locale["sl"]["branch"] = "South Slavic" Locale["sl"]["iso"] = "slv" Locale["sl"]["glotto"] = "slov1268" Locale["sl"]["script"] = "Latn" + Locale["sl"]["spoken-in"] = "Slovenia" + Locale["sl"]["supported-by"] = "google; bing; yandex" - #86 Somali + # Somali Locale["so"]["name"] = "Somali" Locale["so"]["endonym"] = "Soomaali" Locale["so"]["translations-of"] = "Turjumaada %s" @@ -2142,11 +2188,14 @@ function initLocale() { Locale["so"]["examples"] = "Tusaalooyin" Locale["so"]["see-also"] = "Sidoo kale eeg" Locale["so"]["family"] = "Afro-Asiatic" + Locale["so"]["branch"] = "Cushitic" Locale["so"]["iso"] = "som" Locale["so"]["glotto"] = "soma1255" Locale["so"]["script"] = "Latn" + Locale["so"]["spoken-in"] = "Somalia; Somaliland; Ethiopia; Djibouti" + Locale["so"]["supported-by"] = "google; bing" - #87 Spanish + # Spanish Locale["es"]["name"] = "Spanish" Locale["es"]["endonym"] = "Español" Locale["es"]["translations-of"] = "Traducciones de %s" @@ -2155,12 +2204,15 @@ function initLocale() { Locale["es"]["examples"] = "Ejemplos" Locale["es"]["see-also"] = "Ver también" Locale["es"]["family"] = "Indo-European" + Locale["es"]["branch"] = "Western Romance" Locale["es"]["iso"] = "spa" Locale["es"]["glotto"] = "stan1288" Locale["es"]["script"] = "Latn" Locale["es"]["dictionary"] = "true" # has dictionary + Locale["es"]["spoken-in"] = "Spain; the Americas" + Locale["es"]["supported-by"] = "google; bing; yandex" - #88 Sundanese, Latin alphabet + # Sundanese, Latin alphabet Locale["su"]["name"] = "Sundanese" Locale["su"]["endonym"] = "Basa Sunda" Locale["su"]["translations-of"] = "Tarjamahan tina %s" @@ -2169,11 +2221,14 @@ function initLocale() { Locale["su"]["examples"] = "Conto" Locale["su"]["see-also"] = "Tingali ogé" Locale["su"]["family"] = "Austronesian" + Locale["su"]["branch"] = "Malayo-Polynesian" Locale["su"]["iso"] = "sun" Locale["su"]["glotto"] = "sund1252" Locale["su"]["script"] = "Latn" + Locale["su"]["spoken-in"] = "Java, Indonesia" + Locale["su"]["supported-by"] = "google; yandex" - #89 Swahili / Kiswahili + # Swahili / Kiswahili Locale["sw"]["name"] = "Swahili" Locale["sw"]["name2"] = "Kiswahili" Locale["sw"]["endonym"] = "Kiswahili" @@ -2183,11 +2238,14 @@ function initLocale() { Locale["sw"]["examples"] = "Mifano" Locale["sw"]["see-also"] = "Angalia pia" Locale["sw"]["family"] = "Atlantic-Congo" + Locale["sw"]["branch"] = "Bantu" Locale["sw"]["iso"] = "swa" Locale["sw"]["glotto"] = "swah1253" Locale["sw"]["script"] = "Latn" + Locale["sw"]["spoken-in"] = "the East African coast and litoral islands" + Locale["sw"]["supported-by"] = "google; bing; yandex" - #90 Swedish + # Swedish Locale["sv"]["name"] = "Swedish" Locale["sv"]["endonym"] = "Svenska" Locale["sv"]["translations-of"] = "Översättningar av %s" @@ -2196,9 +2254,14 @@ function initLocale() { Locale["sv"]["examples"] = "Exempel" Locale["sv"]["see-also"] = "Se även" Locale["sv"]["family"] = "Indo-European" + Locale["sv"]["branch"] = "North Germanic" Locale["sv"]["iso"] = "swe" Locale["sv"]["glotto"] = "swed1254" Locale["sv"]["script"] = "Latn" + Locale["sv"]["spoken-in"] = "Sweden; Finland; Estonia" + Locale["sv"]["supported-by"] = "google; bing; yandex" + + #91 Tajik / Tajiki (Tajiki Persian), Cyrillic alphabet Locale["tg"]["name"] = "Tajik" From 51228498c236eec85468605d24e8bbb588147aa8 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 7 Aug 2022 22:19:36 +0200 Subject: [PATCH 070/119] LanguageData: update section T --- include/LanguageData.awk | 118 +++++++++++++++++++++++++-------------- 1 file changed, 77 insertions(+), 41 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 6ddf366b..fce8e4a3 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2228,7 +2228,7 @@ function initLocale() { Locale["su"]["spoken-in"] = "Java, Indonesia" Locale["su"]["supported-by"] = "google; yandex" - # Swahili / Kiswahili + # Swahili / Kiswahili, Latin script Locale["sw"]["name"] = "Swahili" Locale["sw"]["name2"] = "Kiswahili" Locale["sw"]["endonym"] = "Kiswahili" @@ -2261,9 +2261,18 @@ function initLocale() { Locale["sv"]["spoken-in"] = "Sweden; Finland; Estonia" Locale["sv"]["supported-by"] = "google; bing; yandex" + # Tahitian + Locale["ty"]["name"] = "Tahitian" + Locale["ty"]["endonym"] = "Reo Tahiti" + Locale["ty"]["family"] = "Austronesian" + Locale["ty"]["branch"] = "Malayo-Polynesian" + Locale["ty"]["iso"] = "tah" + Locale["ty"]["glotto"] = "tahi1242" + Locale["ty"]["script"] = "Latn" + Locale["ty"]["spoken-in"] = "French Polynesia" + Locale["ty"]["supported-by"] = "bing" - - #91 Tajik / Tajiki (Tajiki Persian), Cyrillic alphabet + # Tajik / Tajiki (Tajiki Persian), Cyrillic alphabet Locale["tg"]["name"] = "Tajik" Locale["tg"]["name2"] = "Tajiki" Locale["tg"]["endonym"] = "Тоҷикӣ" @@ -2273,11 +2282,14 @@ function initLocale() { Locale["tg"]["examples"] = "Намунаҳо:" Locale["tg"]["see-also"] = "Ҳамчунин Бинед" Locale["tg"]["family"] = "Indo-European" + Locale["tg"]["branch"] = "Iranian" Locale["tg"]["iso"] = "tgk" Locale["tg"]["glotto"] = "taji1245" Locale["tg"]["script"] = "Cyrl" + Locale["tg"]["spoken-in"] = "Tajikistan; Uzbekistan" + Locale["tg"]["supported-by"] = "google; yandex" - #92 Tamil + # Tamil Locale["ta"]["name"] = "Tamil" Locale["ta"]["endonym"] = "தமிழ்" Locale["ta"]["translations-of"] = "%s இன் மொழிபெயர்ப்புகள்" @@ -2286,11 +2298,14 @@ function initLocale() { Locale["ta"]["examples"] = "எடுத்துக்காட்டுகள்" Locale["ta"]["see-also"] = "இதையும் காண்க" Locale["ta"]["family"] = "Dravidian" + Locale["ta"]["branch"] = "South Dravidian" Locale["ta"]["iso"] = "tam" Locale["ta"]["glotto"] = "tami1289" Locale["ta"]["script"] = "Taml" + Locale["ta"]["spoken-in"] = "the Indian state of Tamil Nadu; Sri Lanka; Singapore" + Locale["ta"]["supported-by"] = "google; bing; yandex" - #93 Tatar + # Tatar, Cyrillic alphabet Locale["tt"]["name"] = "Tatar" Locale["tt"]["endonym"] = "татарча" #Locale["tt"]["translations-of"] @@ -2299,11 +2314,14 @@ function initLocale() { #Locale["tt"]["examples"] #Locale["tt"]["see-also"] Locale["tt"]["family"] = "Turkic" + Locale["tt"]["branch"] = "Kipchak" Locale["tt"]["iso"] = "tat" Locale["tt"]["glotto"] = "tata1255" Locale["tt"]["script"] = "Cyrl" + Locale["tt"]["spoken-in"] = "the Republic of Tatarstan in Russia" + Locale["tt"]["supported-by"] = "google; bing; yandex" - #94 Telugu + # Telugu Locale["te"]["name"] = "Telugu" Locale["te"]["endonym"] = "తెలుగు" Locale["te"]["translations-of"] = "%s యొక్క అనువాదాలు" @@ -2312,11 +2330,14 @@ function initLocale() { Locale["te"]["examples"] = "ఉదాహరణలు" Locale["te"]["see-also"] = "వీటిని కూడా చూడండి" Locale["te"]["family"] = "Dravidian" + Locale["te"]["branch"] = "South-Central Dravidian" Locale["te"]["iso"] = "tel" Locale["te"]["glotto"] = "telu1262" Locale["te"]["script"] = "Telu" + Locale["te"]["spoken-in"] = "the Indian states of Andhra Pradesh and Telangana" + Locale["te"]["supported-by"] = "google; bing; yandex" - #95 Thai + # Thai Locale["th"]["name"] = "Thai" Locale["th"]["endonym"] = "ไทย" Locale["th"]["translations-of"] = "คำแปลของ %s" @@ -2325,9 +2346,28 @@ function initLocale() { Locale["th"]["examples"] = "ตัวอย่าง" Locale["th"]["see-also"] = "ดูเพิ่มเติม" Locale["th"]["family"] = "Kra-Dai" + Locale["th"]["branch"] = "Tai" Locale["th"]["iso"] = "tha" Locale["th"]["glotto"] = "thai1261" Locale["th"]["script"] = "Thai" + Locale["th"]["spoken-in"] = "Thailand" + Locale["th"]["supported-by"] = "google; bing; yandex" + + # Tibetan (Standard Tibetan) + Locale["bo"]["name"] = "Tibetan" + Locale["bo"]["endonym"] = "བོད་ཡིག" + #Locale["bo"]["translations-of"] + #Locale["bo"]["definitions-of"] + #Locale["bo"]["synonyms"] + #Locale["bo"]["examples"] + #Locale["bo"]["see-also"] + Locale["bo"]["family"] = "Sino-Tibetan" + Locale["bo"]["branch"] = "Tibetic" + Locale["bo"]["iso"] = "bod" + Locale["bo"]["glotto"] = "tibe1272" + Locale["bo"]["script"] = "Tibt" + Locale["bo"]["spoken-in"] = "the Tibet Autonomous Region of China" + Locale["bo"]["supported-by"] = "bing" # Tigrinya Locale["ti"]["name"] = "Tigrinya" @@ -2338,9 +2378,23 @@ function initLocale() { #Locale["ti"]["examples"] #Locale["ti"]["see-also"] Locale["ti"]["family"] = "Afro-Asiatic" + Locale["ti"]["branch"] = "Semitic" Locale["ti"]["iso"] = "tir" Locale["ti"]["glotto"] = "tigr1271" Locale["ti"]["script"] = "Ethi" + Locale["ti"]["spoken-in"] = "Eritrea; the Tigray region of northern Ethiopia" + Locale["ti"]["supported-by"] = "google; bing" + + # Tongan + Locale["to"]["name"] = "Tongan" + Locale["to"]["endonym"] = "Lea faka-Tonga" + Locale["to"]["family"] = "Austronesian" + Locale["to"]["branch"] = "Malayo-Polynesian" + Locale["to"]["iso"] = "ton" + Locale["to"]["glotto"] = "tong1325" + Locale["to"]["script"] = "Latn" + Locale["to"]["spoken-in"] = "Tonga" + Locale["to"]["supported-by"] = "bing" # Tsonga Locale["ts"]["name"] = "Tsonga" @@ -2351,11 +2405,14 @@ function initLocale() { #Locale["ts"]["examples"] #Locale["ts"]["see-also"] Locale["ts"]["family"] = "Atlantic–Congo" + Locale["ts"]["branch"] = "Bantu" Locale["ts"]["iso"] = "tso" Locale["ts"]["glotto"] = "tson1249" Locale["ts"]["script"] = "Latn" + Locale["ts"]["spoken-in"] = "Eswatini; Mozambique; South Africa; Zimbabwe" + Locale["ts"]["supported-by"] = "google" - #96 Turkish + # Turkish Locale["tr"]["name"] = "Turkish" Locale["tr"]["endonym"] = "Türkçe" Locale["tr"]["translations-of"] = "%s çevirileri" @@ -2364,11 +2421,14 @@ function initLocale() { Locale["tr"]["examples"] = "Örnekler" Locale["tr"]["see-also"] = "Ayrıca bkz." Locale["tr"]["family"] = "Turkic" + Locale["tr"]["branch"] = "Oghuz" Locale["tr"]["iso"] = "tur" Locale["tr"]["glotto"] = "nucl1301" Locale["tr"]["script"] = "Latn" + Locale["tr"]["spoken-in"] = "Türkiye; Cyprus" + Locale["tr"]["supported-by"] = "google; bing; yandex" - #97 Turkmen + # Turkmen, Latin script Locale["tk"]["name"] = "Turkmen" Locale["tk"]["endonym"] = "Türkmen" #Locale["tk"]["translations-of"] @@ -2377,9 +2437,12 @@ function initLocale() { #Locale["tk"]["examples"] #Locale["tk"]["see-also"] Locale["tk"]["family"] = "Turkic" + Locale["tk"]["branch"] = "Oghuz" Locale["tk"]["iso"] = "tuk" Locale["tk"]["glotto"] = "turk1304" Locale["tk"]["script"] = "Latn" + Locale["tk"]["spoken-in"] = "Turkmenistan; Iran; Afghanistan; Pakistan" + Locale["tk"]["supported-by"] = "google; bing" # Twi Locale["tw"]["name"] = "Twi" @@ -2391,9 +2454,14 @@ function initLocale() { #Locale["tw"]["examples"] #Locale["tw"]["see-also"] Locale["tw"]["family"] = "Atlantic-Congo" + Locale["tw"]["branch"] = "Kwa" Locale["tw"]["iso"] = "twi" Locale["tw"]["glotto"] = "akua1239" Locale["tw"]["script"] = "Latn" + Locale["tw"]["spoken-in"] = "Ghana" + Locale["tw"]["supported-by"] = "google" + + #98 Ukrainian Locale["uk"]["name"] = "Ukrainian" @@ -2541,24 +2609,6 @@ function initLocale() { Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - #* Tahitian - Locale["ty"]["support"] = "bing-only" - Locale["ty"]["name"] = "Tahitian" - Locale["ty"]["endonym"] = "Reo Tahiti" - Locale["ty"]["family"] = "Austronesian" - Locale["ty"]["iso"] = "tah" - Locale["ty"]["glotto"] = "tahi1242" - Locale["ty"]["script"] = "Latn" - - #* Tongan - Locale["to"]["support"] = "bing-only" - Locale["to"]["name"] = "Tongan" - Locale["to"]["endonym"] = "Lea faka-Tonga" - Locale["to"]["family"] = "Austronesian" - Locale["to"]["iso"] = "ton" - Locale["to"]["glotto"] = "tong1325" - Locale["to"]["script"] = "Latn" - #* Yucatec Maya Locale["yua"]["support"] = "bing-only" Locale["yua"]["name"] = "Yucatec Maya" @@ -2596,20 +2646,6 @@ function initLocale() { Locale["oc"]["glotto"] = "occi1239" Locale["oc"]["script"] = "Latn" - #? Tibetan (Standard Tibetan) - Locale["bo"]["support"] = "unstable" - Locale["bo"]["name"] = "Tibetan" - Locale["bo"]["endonym"] = "བོད་ཡིག" - #Locale["bo"]["translations-of"] - #Locale["bo"]["definitions-of"] - #Locale["bo"]["synonyms"] - #Locale["bo"]["examples"] - #Locale["bo"]["see-also"] - Locale["bo"]["family"] = "Sino-Tibetan" - Locale["bo"]["iso"] = "bod" - Locale["bo"]["glotto"] = "tibe1272" - Locale["bo"]["script"] = "Tibt" - #? Udmurt Locale["udm"]["support"] = "yandex-only" Locale["udm"]["name"] = "Udmurt" From 511fc9f41bd845050b69b365cd537e79eccea9eb Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 7 Aug 2022 23:05:31 +0200 Subject: [PATCH 071/119] LanguageData: update section U --- include/LanguageData.awk | 46 ++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index fce8e4a3..da684e25 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2461,9 +2461,18 @@ function initLocale() { Locale["tw"]["spoken-in"] = "Ghana" Locale["tw"]["supported-by"] = "google" + # Udmurt + Locale["udm"]["name"] = "Udmurt" + Locale["udm"]["endonym"] = "Удмурт" + Locale["udm"]["family"] = "Uralic" + Locale["udm"]["branch"] = "Permic" + Locale["udm"]["iso"] = "udm" + Locale["udm"]["glotto"] = "udmu1245" + Locale["udm"]["script"] = "Cyrl" + Locale["udm"]["spoken-in"] = "the Republic of Udmurt in Russia" + Locale["udm"]["supported-by"] = "yandex" - - #98 Ukrainian + # Ukrainian Locale["uk"]["name"] = "Ukrainian" Locale["uk"]["endonym"] = "Українська" Locale["uk"]["translations-of"] = "Переклади слова або виразу \"%s\"" @@ -2472,11 +2481,25 @@ function initLocale() { Locale["uk"]["examples"] = "Приклади" Locale["uk"]["see-also"] = "Дивіться також" Locale["uk"]["family"] = "Indo-European" + Locale["uk"]["branch"] = "East Slavic" Locale["uk"]["iso"] = "ukr" Locale["uk"]["glotto"] = "ukra1253" Locale["uk"]["script"] = "Cyrl" - - #99 Urdu + Locale["uk"]["spoken-in"] = "Ukraine" + Locale["uk"]["supported-by"] = "google; bing; yandex" + + # Upper Sorbian + Locale["hsb"]["name"] = "Upper Sorbian" + Locale["hsb"]["endonym"] = "Hornjoserbšćina" + Locale["hsb"]["family"] = "Indo-European" + Locale["hsb"]["branch"] = "West Slavic" + Locale["hsb"]["iso"] = "hsb" + Locale["hsb"]["glotto"] = "uppe1395" + Locale["hsb"]["script"] = "Latn" + Locale["hsb"]["spoken-in"] = "Saxony, Germany" + Locale["hsb"]["supported-by"] = "bing" + + # Urdu Locale["ur"]["name"] = "Urdu" Locale["ur"]["endonym"] = "اُردُو" Locale["ur"]["translations-of"] = "کے ترجمے %s" @@ -2485,12 +2508,15 @@ function initLocale() { Locale["ur"]["examples"] = "مثالیں" Locale["ur"]["see-also"] = "نیز دیکھیں" Locale["ur"]["family"] = "Indo-European" + Locale["ur"]["branch"] = "Indo-Aryan" Locale["ur"]["iso"] = "urd" Locale["ur"]["glotto"] = "urdu1245" Locale["ur"]["script"] = "Arab" Locale["ur"]["rtl"] = "true" # RTL language + Locale["ur"]["spoken-in"] = "Pakistan; India" + Locale["ur"]["supported-by"] = "google; bing; yandex" - #100 Uyghur + # Uyghur Locale["ug"]["name"] = "Uyghur" Locale["ug"]["endonym"] = "ئۇيغۇر تىلى" #Locale["ug"]["translations-of"] @@ -2499,12 +2525,15 @@ function initLocale() { #Locale["ug"]["examples"] #Locale["ug"]["see-also"] Locale["ug"]["family"] = "Turkic" + Locale["ug"]["branch"] = "Karluk" Locale["ug"]["iso"] = "uig" Locale["ug"]["glotto"] = "uigh1240" Locale["ug"]["script"] = "Arab" Locale["ug"]["rtl"] = "true" # RTL language + Locale["ug"]["spoken-in"] = "the Xinjiang Uyghur Autonomous Region of China" + Locale["ug"]["supported-by"] = "google; bing" - #101 Uzbek, Latin alphabet + # Uzbek, Latin alphabet Locale["uz"]["name"] = "Uzbek" Locale["uz"]["endonym"] = "Oʻzbek tili" Locale["uz"]["translations-of"] = "%s: tarjima variantlari" @@ -2513,9 +2542,14 @@ function initLocale() { Locale["uz"]["examples"] = "Namunalar" Locale["uz"]["see-also"] = "O‘xshash so‘zlar" Locale["uz"]["family"] = "Turkic" + Locale["uz"]["branch"] = "Karluk" Locale["uz"]["iso"] = "uzb" Locale["uz"]["glotto"] = "uzbe1247" Locale["uz"]["script"] = "Latn" + Locale["uz"]["spoken-in"] = "Uzbekistan; Afghanistan; Pakistan" + Locale["uz"]["supported-by"] = "google; bing; yandex" + + #102 Vietnamese Locale["vi"]["name"] = "Vietnamese" From b7e8afdb80c27ca89b2849a00680002e157d8f35 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 7 Aug 2022 23:10:07 +0200 Subject: [PATCH 072/119] LanguageData: update section V --- include/LanguageData.awk | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index da684e25..b8f38cf8 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2549,9 +2549,7 @@ function initLocale() { Locale["uz"]["spoken-in"] = "Uzbekistan; Afghanistan; Pakistan" Locale["uz"]["supported-by"] = "google; bing; yandex" - - - #102 Vietnamese + # Vietnamese Locale["vi"]["name"] = "Vietnamese" Locale["vi"]["endonym"] = "Tiếng Việt" Locale["vi"]["translations-of"] = "Bản dịch của %s" @@ -2560,9 +2558,14 @@ function initLocale() { Locale["vi"]["examples"] = "Ví dụ" Locale["vi"]["see-also"] = "Xem thêm" Locale["vi"]["family"] = "Austroasiatic" + Locale["vi"]["branch"] = "Vietic" Locale["vi"]["iso"] = "vie" Locale["vi"]["glotto"] = "viet1252" Locale["vi"]["script"] = "Latn" + Locale["vi"]["spoken-in"] = "Vietnam" + Locale["vi"]["supported-by"] = "google; bing; yandex" + + #103 Welsh Locale["cy"]["name"] = "Welsh" @@ -2680,20 +2683,6 @@ function initLocale() { Locale["oc"]["glotto"] = "occi1239" Locale["oc"]["script"] = "Latn" - #? Udmurt - Locale["udm"]["support"] = "yandex-only" - Locale["udm"]["name"] = "Udmurt" - Locale["udm"]["endonym"] = "удмурт" - #Locale["udm"]["translations-of"] - #Locale["udm"]["definitions-of"] - #Locale["udm"]["synonyms"] - #Locale["udm"]["examples"] - #Locale["udm"]["see-also"] - Locale["udm"]["family"] = "Uralic" - Locale["udm"]["iso"] = "udm" - Locale["udm"]["glotto"] = "udmu1245" - Locale["udm"]["script"] = "Cyrl" - #? Volapük Locale["vo"]["support"] = "unstable" Locale["vo"]["name"] = "Volapük" From ac5f88cca0a618e1d02515e4a8bc088e60173431 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 7 Aug 2022 23:27:06 +0200 Subject: [PATCH 073/119] LanguageData: update section W --- include/LanguageData.awk | 73 +++++++++++++++++++++++----------------- 1 file changed, 42 insertions(+), 31 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index b8f38cf8..8cb49cd2 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2565,9 +2565,24 @@ function initLocale() { Locale["vi"]["spoken-in"] = "Vietnam" Locale["vi"]["supported-by"] = "google; bing; yandex" + # Volapük + Locale["vo"]["name"] = "Volapük" + Locale["vo"]["endonym"] = "Volapük" + #Locale["vo"]["translations-of"] + #Locale["vo"]["definitions-of"] + #Locale["vo"]["synonyms"] + #Locale["vo"]["examples"] + #Locale["vo"]["see-also"] + Locale["vo"]["family"] = "Constructed language" + #Locale["vo"]["branch"] + Locale["vo"]["iso"] = "vol" + Locale["vo"]["glotto"] = "vola1234" + Locale["vo"]["script"] = "Latn" + Locale["vo"]["spoken-in"] = "worldwide" + Locale["vo"]["description"] = "an international auxiliary language" + Locale["vo"]["supported-by"] = "" - - #103 Welsh + # Welsh Locale["cy"]["name"] = "Welsh" Locale["cy"]["endonym"] = "Cymraeg" Locale["cy"]["translations-of"] = "Cyfieithiadau %s" @@ -2576,11 +2591,14 @@ function initLocale() { Locale["cy"]["examples"] = "Enghreifftiau" Locale["cy"]["see-also"] = "Gweler hefyd" Locale["cy"]["family"] = "Indo-European" + Locale["cy"]["branch"] = "Celtic" Locale["cy"]["iso"] = "cym" Locale["cy"]["glotto"] = "wels1247" Locale["cy"]["script"] = "Latn" + Locale["cy"]["spoken-in"] = "Wales in the UK" + Locale["cy"]["supported-by"] = "google; bing; yandex" - #104 West Frisian + # West Frisian Locale["fy"]["name"] = "Frisian" Locale["fy"]["endonym"] = "Frysk" Locale["fy"]["translations-of"] = "Oersettings fan %s" @@ -2589,9 +2607,30 @@ function initLocale() { Locale["fy"]["examples"] = "Foarbylden" Locale["fy"]["see-also"] = "Sjoch ek" Locale["fy"]["family"] = "Indo-European" + Locale["fy"]["branch"] = "West Germanic" Locale["fy"]["iso"] = "fry" Locale["fy"]["glotto"] = "west2354" Locale["fy"]["script"] = "Latn" + Locale["fy"]["spoken-in"] = "Friesland in the Netherlands" + Locale["fy"]["supported-by"] = "google" + + # Wolof + Locale["wo"]["name"] = "Wolof" + Locale["wo"]["endonym"] = "Wollof" + #Locale["wo"]["translations-of"] + #Locale["wo"]["definitions-of"] + #Locale["wo"]["synonyms"] + #Locale["wo"]["examples"] + #Locale["wo"]["see-also"] + Locale["wo"]["family"] = "Atlantic-Congo" + Locale["wo"]["branch"] = "Atlantic" + Locale["wo"]["iso"] = "wol" + Locale["wo"]["glotto"] = "wolo1247" + Locale["wo"]["script"] = "Latn" + Locale["wo"]["spoken-in"] = "Senegal; Mauritania; the Gambia" + Locale["wo"]["supported-by"] = "" + + #105 Xhosa Locale["xh"]["name"] = "Xhosa" @@ -2683,34 +2722,6 @@ function initLocale() { Locale["oc"]["glotto"] = "occi1239" Locale["oc"]["script"] = "Latn" - #? Volapük - Locale["vo"]["support"] = "unstable" - Locale["vo"]["name"] = "Volapük" - Locale["vo"]["endonym"] = "Volapük" - #Locale["vo"]["translations-of"] - #Locale["vo"]["definitions-of"] - #Locale["vo"]["synonyms"] - #Locale["vo"]["examples"] - #Locale["vo"]["see-also"] - Locale["vo"]["family"] = "Constructed language" - Locale["vo"]["iso"] = "vol" - #Locale["vo"]["glotto"] - Locale["vo"]["script"] = "Latn" - - #? Wolof - Locale["wo"]["support"] = "unstable" - Locale["wo"]["name"] = "Wolof" - Locale["wo"]["endonym"] = "Wollof" - #Locale["wo"]["translations-of"] - #Locale["wo"]["definitions-of"] - #Locale["wo"]["synonyms"] - #Locale["wo"]["examples"] - #Locale["wo"]["see-also"] - Locale["wo"]["family"] = "Atlantic-Congo" - Locale["wo"]["iso"] = "wol" - Locale["wo"]["glotto"] = "wolo1247" - Locale["wo"]["script"] = "Latn" - #? Cherokee Locale["chr"]["support"] = "unstable" Locale["chr"]["name"] = "Cherokee" From 3aa66ada67c4f1afbeeb6b5d39208c80151d5cca Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 7 Aug 2022 23:44:01 +0200 Subject: [PATCH 074/119] LanguageData: update section X --- include/LanguageData.awk | 99 ++++++++++++++++++++++------------------ 1 file changed, 54 insertions(+), 45 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 8cb49cd2..b9036caf 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -260,6 +260,22 @@ function initLocale() { Locale["bs"]["spoken-in"] = "Bosnia and Herzegovina" Locale["bs"]["supported-by"] = "google; bing; yandex" + # Breton + Locale["br"]["name"] = "Breton" + Locale["br"]["endonym"] = "Brezhoneg" + #Locale["br"]["translations-of"] + #Locale["br"]["definitions-of"] + #Locale["br"]["synonyms"] + #Locale["br"]["examples"] + #Locale["br"]["see-also"] + Locale["br"]["family"] = "Indo-European" + Locale["br"]["branch"] = "Celtic" + Locale["br"]["iso"] = "bre" + Locale["br"]["glotto"] = "bret1244" + Locale["br"]["script"] = "Latn" + Locale["br"]["spoken-in"] = "Brittany in France" + Locale["br"]["supported-by"] = "" + # Bulgarian Locale["bg"]["name"] = "Bulgarian" Locale["bg"]["endonym"] = "български" @@ -325,6 +341,22 @@ function initLocale() { Locale["ceb"]["spoken-in"] = "the southern Philippines" Locale["ceb"]["supported-by"] = "google; yandex" + # Cherokee + Locale["chr"]["name"] = "Cherokee" + Locale["chr"]["endonym"] = "ᏣᎳᎩ" + #Locale["chr"]["translations-of"] + #Locale["chr"]["definitions-of"] + #Locale["chr"]["synonyms"] + #Locale["chr"]["examples"] + #Locale["chr"]["see-also"] + Locale["chr"]["family"] = "Iroquoian" + #Locale["chr"]["branch"] + Locale["chr"]["iso"] = "chr" + Locale["chr"]["glotto"] = "cher1273" + Locale["chr"]["script"] = "Cher" + Locale["chr"]["spoken-in"] = "North America" + Locale["chr"]["supported-by"] = "" + # Chichewa Locale["ny"]["name"] = "Chichewa" Locale["ny"]["name2"] = "Chinyanja" @@ -1742,6 +1774,22 @@ function initLocale() { Locale["no"]["spoken-in"] = "Norway" Locale["no"]["supported-by"] = "google; bing; yandex" + # Occitan + Locale["oc"]["name"] = "Occitan" + Locale["oc"]["endonym"] = "Occitan" + #Locale["oc"]["translations-of"] + #Locale["oc"]["definitions-of"] + #Locale["oc"]["synonyms"] + #Locale["oc"]["examples"] + #Locale["oc"]["see-also"] + Locale["oc"]["family"] = "Indo-European" + Locale["oc"]["branch"] = "Western Romance" + Locale["oc"]["iso"] = "oci" + Locale["oc"]["glotto"] = "occi1239" + Locale["oc"]["script"] = "Latn" + Locale["oc"]["spoken-in"] = "Occitania in France, Monaco, Italy and Spain" + Locale["oc"]["supported-by"] = "" + # Odia / Oriya Locale["or"]["name"] = "Odia" Locale["or"]["name2"] = "Oriya" @@ -2630,9 +2678,7 @@ function initLocale() { Locale["wo"]["spoken-in"] = "Senegal; Mauritania; the Gambia" Locale["wo"]["supported-by"] = "" - - - #105 Xhosa + # Xhosa Locale["xh"]["name"] = "Xhosa" Locale["xh"]["endonym"] = "isiXhosa" Locale["xh"]["translations-of"] = "Iinguqulelo zika-%s" @@ -2641,9 +2687,14 @@ function initLocale() { Locale["xh"]["examples"] = "Imizekelo" Locale["xh"]["see-also"] = "Kwakhona bona" Locale["xh"]["family"] = "Atlantic-Congo" + Locale["xh"]["branch"] = "Bantu" Locale["xh"]["iso"] = "xho" Locale["xh"]["glotto"] = "xhos1239" Locale["xh"]["script"] = "Latn" + Locale["xh"]["spoken-in"] = "South Africa; Zimbabwe" + Locale["xh"]["supported-by"] = "google; yandex" + + #106 Yiddish Locale["yi"]["name"] = "Yiddish" @@ -2694,48 +2745,6 @@ function initLocale() { Locale["yua"]["glotto"] = "yuca1254" Locale["yua"]["script"] = "Latn" - #? Breton - Locale["br"]["support"] = "unstable" - Locale["br"]["name"] = "Breton" - Locale["br"]["endonym"] = "Brezhoneg" - #Locale["br"]["translations-of"] - #Locale["br"]["definitions-of"] - #Locale["br"]["synonyms"] - #Locale["br"]["examples"] - #Locale["br"]["see-also"] - Locale["br"]["family"] = "Indo-European" - Locale["br"]["iso"] = "bre" - Locale["br"]["glotto"] = "bret1244" - Locale["br"]["script"] = "Latn" - - #? Occitan - Locale["oc"]["support"] = "unstable" - Locale["oc"]["name"] = "Occitan" - Locale["oc"]["endonym"] = "Occitan" - #Locale["oc"]["translations-of"] - #Locale["oc"]["definitions-of"] - #Locale["oc"]["synonyms"] - #Locale["oc"]["examples"] - #Locale["oc"]["see-also"] - Locale["oc"]["family"] = "Indo-European" - Locale["oc"]["iso"] = "oci" - Locale["oc"]["glotto"] = "occi1239" - Locale["oc"]["script"] = "Latn" - - #? Cherokee - Locale["chr"]["support"] = "unstable" - Locale["chr"]["name"] = "Cherokee" - Locale["chr"]["endonym"] = "ᏣᎳᎩ" - #Locale["chr"]["translations-of"] - #Locale["chr"]["definitions-of"] - #Locale["chr"]["synonyms"] - #Locale["chr"]["examples"] - #Locale["chr"]["see-also"] - Locale["chr"]["family"] = "Iroquoian" - Locale["chr"]["iso"] = "chr" - Locale["chr"]["glotto"] = "cher1273" - Locale["chr"]["script"] = "Cher" - } # Initialize aliases of all locales supported. From 22a1a6ddeeb7cf0b87e76914240b3be0a68215df Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Mon, 8 Aug 2022 23:54:09 +0200 Subject: [PATCH 075/119] LanguageData: update section Y & Z --- include/LanguageData.awk | 50 +++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index b9036caf..8c2067fb 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2694,9 +2694,19 @@ function initLocale() { Locale["xh"]["spoken-in"] = "South Africa; Zimbabwe" Locale["xh"]["supported-by"] = "google; yandex" - - - #106 Yiddish + # Yakut / Sakha + Locale["sah"]["name"] = "Yakut" + Locale["sah"]["name2"] = "Sakha" + Locale["sah"]["endonym"] = "Sakha" + Locale["sah"]["family"] = "Turkic" + Locale["sah"]["branch"] = "Siberian Turkic" + Locale["sah"]["iso"] = "sah" + Locale["sah"]["glotto"] = "yaku1245" + Locale["sah"]["script"] = "Latn" + Locale["sah"]["spoken-in"] = "the Republic of Sakha (Yakutia) in Russia" + Locale["sah"]["supported-by"] = "yandex" + + # Yiddish Locale["yi"]["name"] = "Yiddish" Locale["yi"]["endonym"] = "ייִדיש" Locale["yi"]["translations-of"] = "איבערזעצונגען פון %s" @@ -2705,12 +2715,16 @@ function initLocale() { Locale["yi"]["examples"] = "ביישפילע" Locale["yi"]["see-also"] = "זייען אויך" Locale["yi"]["family"] = "Indo-European" + Locale["yi"]["branch"] = "West Germanic" Locale["yi"]["iso"] = "yid" Locale["yi"]["glotto"] = "yidd1255" Locale["yi"]["script"] = "Hebr" Locale["yi"]["rtl"] = "true" # RTL language + Locale["yi"]["spoken-in"] = "worldwide" + Locale["yi"]["description"] = "a West Germanic language historically spoken by Ashkenazi Jews" + Locale["yi"]["supported-by"] = "google; yandex" - #107 Yoruba + # Yoruba Locale["yo"]["name"] = "Yoruba" Locale["yo"]["endonym"] = "Yorùbá" Locale["yo"]["translations-of"] = "Awọn itumọ ti %s" @@ -2719,11 +2733,25 @@ function initLocale() { Locale["yo"]["examples"] = "Awọn apẹrẹ" Locale["yo"]["see-also"] = "Tun wo" Locale["yo"]["family"] = "Atlantic-Congo" + #Locale["yo"]["branch"] Locale["yo"]["iso"] = "yor" Locale["yo"]["glotto"] = "yoru1245" Locale["yo"]["script"] = "Latn" + Locale["yo"]["spoken-in"] = "Nigeria; Benin" + Locale["yo"]["supported-by"] = "google" + + # Yucatec Maya + Locale["yua"]["name"] = "Yucatec Maya" + Locale["yua"]["endonym"] = "Màaya T'àan" + Locale["yua"]["family"] = "Mayan" + #Locale["yua"]["branch"] + Locale["yua"]["iso"] = "yua" + Locale["yua"]["glotto"] = "yuca1254" + Locale["yua"]["script"] = "Latn" + Locale["yua"]["spoken-in"] = "Mexico; Belize" + Locale["yua"]["supported-by"] = "bing" - #108 Zulu + # Zulu Locale["zu"]["name"] = "Zulu" Locale["zu"]["endonym"] = "isiZulu" Locale["zu"]["translations-of"] = "Ukuhumusha i-%s" @@ -2732,18 +2760,12 @@ function initLocale() { Locale["zu"]["examples"] = "Izibonelo" Locale["zu"]["see-also"] = "Bheka futhi" Locale["zu"]["family"] = "Atlantic-Congo" + Locale["zu"]["branch"] = "Bantu" Locale["zu"]["iso"] = "zul" Locale["zu"]["glotto"] = "zulu1248" Locale["zu"]["script"] = "Latn" - - #* Yucatec Maya - Locale["yua"]["support"] = "bing-only" - Locale["yua"]["name"] = "Yucatec Maya" - Locale["yua"]["endonym"] = "Màaya T'àan" - Locale["yua"]["family"] = "Mayan" - Locale["yua"]["iso"] = "yua" - Locale["yua"]["glotto"] = "yuca1254" - Locale["yua"]["script"] = "Latn" + Locale["zu"]["spoken-in"] = "South Africa; Lesotho; Eswatini" + Locale["zu"]["supported-by"] = "google; bing; yandex" } From a8574913c1a355fafac2b8ba99223ca4cf052e7a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 10 Aug 2022 22:53:08 +0200 Subject: [PATCH 076/119] LanguageHelper: prefer showing description --- include/LanguageData.awk | 4 ++-- include/LanguageHelper.awk | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 8c2067fb..991c1562 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -109,7 +109,7 @@ function initLocale() { Locale["as"]["iso"] = "asm" Locale["as"]["glotto"] = "assa1263" Locale["as"]["script"] = "Beng" - Locale["as"]["spoken-in"] = "the northeast Indian state of Assam" + Locale["as"]["spoken-in"] = "the northeastern Indian state of Assam" Locale["as"]["supported-by"] = "google; bing" # Aymara @@ -1674,7 +1674,7 @@ function initLocale() { Locale["mni-Mtei"]["iso"] = "mni" Locale["mni-Mtei"]["glotto"] = "mani1292" Locale["mni-Mtei"]["script"] = "Mtei" - Locale["mni-Mtei"]["spoken-in"] = "the northeast India; Bangladesh; Myanmar" + Locale["mni-Mtei"]["spoken-in"] = "the northeastern India; Bangladesh; Myanmar" Locale["mni-Mtei"]["supported-by"] = "google" # Mizo diff --git a/include/LanguageHelper.awk b/include/LanguageHelper.awk index 3e682cc6..4eaf22ab 100644 --- a/include/LanguageHelper.awk +++ b/include/LanguageHelper.awk @@ -249,7 +249,9 @@ function getDetails(code, article, desc, group, iso, name, names, script, wri name = substr(name, 1, match(name, /\(.*\)/) - 2) } - if (getBranch(code)) { + if (getDescription(code)) + desc = sprintf("%s is %s.", names, getDescription(code)) + else if (getBranch(code)) { article = match(tolower(getBranch(code)), /^[aeiou]/) ? "an" : "a" if (iso == "eng") desc = sprintf("%s is %s %s language spoken %s.", @@ -257,10 +259,9 @@ function getDetails(code, article, desc, group, iso, name, names, script, wri else desc = sprintf("%s is %s %s language spoken mainly in %s.", names, article, getBranch(code), getSpokenIn(code)) - } else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") + } + else if (getFamily(code) == NULLSTR || tolower(getFamily(code)) == "language isolate") desc = sprintf("%s is a language spoken mainly in %s.", names, getSpokenIn(code)) - else if (tolower(getFamily(code)) == "constructed language") - desc = sprintf("%s is %s.", names, getDescription(code)) else desc = sprintf("%s is a language of the %s family, spoken mainly in %s.", names, getFamily(code), getSpokenIn(code)) From b27c4000aac0f437be6e309ec302249383f9350a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 13 Aug 2022 22:03:33 +0200 Subject: [PATCH 077/119] Help: enable 4-column reference tables --- include/Help.awk | 306 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 210 insertions(+), 96 deletions(-) diff --git a/include/Help.awk b/include/Help.awk index d27d9a46..967a71fb 100644 --- a/include/Help.awk +++ b/include/Help.awk @@ -237,22 +237,30 @@ function showMan( temp) { # displayName = "endonym" or "name" function getReference(displayName, #### - code, col, cols, i, j, name, num, r, rows, saveSortedIn, + code, col, cols, colNum, i, j, name, num, offset, r, rows, saveSortedIn, t1, t2) { # number of language codes with stable support num = 0 - for (code in Locale) - if (Locale[code]["support"] != "unstable") - num++ - rows = int(num / 3) + (num % 3 ? 1 : 0) - cols[0][0] = cols[1][0] = cols[2][0] = NULLSTR + for (code in Locale) { + # only show languages that are supported + if (Locale[code]["supported-by"]) + num++ + } + colNum = (Option["width"] >= 104) ? 4 : 3 + if (colNum == 4) { + rows = int(num / 4) + (num % 4 ? 1 : 0) + cols[0][0] = cols[1][0] = cols[2][0] = cols[3][0] = NULLSTR + } else { + rows = int(num / 3) + (num % 3 ? 1 : 0) + cols[0][0] = cols[1][0] = cols[2][0] = NULLSTR + } i = 0 saveSortedIn = PROCINFO["sorted_in"] PROCINFO["sorted_in"] = displayName == "endonym" ? "@ind_num_asc" : "compName" for (code in Locale) { - # show languages only with stable support - if (Locale[code]["support"] != "unstable") { + # only show languages that are supported + if (Locale[code]["supported-by"]) { col = int(i / rows) append(cols[col], code) i++ @@ -261,99 +269,205 @@ function getReference(displayName, PROCINFO["sorted_in"] = saveSortedIn if (displayName == "endonym") { - r = "┌" replicate("─", 25) "┬" replicate("─", 25) "┬" replicate("─", 25) "┐" RS - for (i = 0; i < rows; i++) { - r = r "│" - for (j = 0; j < 3; j++) { - if (cols[j][i]) { - t1 = getDisplay(cols[j][i]) - if (length(t1) > 17) - t1 = substr(t1, 1, 14) "..." - switch (cols[j][i]) { # fix rendered text width - case "sa": - t1 = sprintf(" %-21s", t1) - break - case "he": case "dv": - t1 = sprintf(" %-20s", t1) - break - case "or": case "ur": - t1 = sprintf(" %-19s", t1) - break - case "hi": case "gu": case "km": case "kn": - case "my": case "ne": case "pa": case "si": - case "ta": case "te": case "yi": case "as": - case "bho": case "mai": case "gom": - t1 = sprintf(" %-18s", t1) - break - case "yue": - t1 = sprintf(" %-15s", t1) - break - case "ja": case "ko": - t1 = sprintf(" %-14s", t1) - break - case "zh-CN": case "zh-TW": - t1 = sprintf(" %-13s", t1) - break - default: - if (length(t1) <= 17) - t1 = sprintf(" %-17s", t1) - } - switch (length(cols[j][i])) { - case 1: case 2: case 3: case 4: - t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i]))) - break - case 5: - t2 = sprintf("- %s│", ansi("bold", cols[j][i])) - break - case 6: - t2 = sprintf("-%s│", ansi("bold", cols[j][i])) - break - case 7: - t2 = sprintf("-%s", ansi("bold", cols[j][i])) - break - default: - t2 = ansi("bold", cols[j][i]) - } - r = r t1 t2 - } else - r = r sprintf("%25s│", NULLSTR) + if (colNum == 4) { # 4-column + offset = int((Option["width"] - 104) / 4) + r = "┌" replicate("─", 25 + offset) "┬" replicate("─", 25 + offset) \ + "┬" replicate("─", 25 + offset) "┬" replicate("─", 25 + offset) "┐" RS + for (i = 0; i < rows; i++) { + r = r "│" + for (j = 0; j < 4; j++) { + if (cols[j][i]) { + t1 = getDisplay(cols[j][i]) + if (length(t1) > 17 + offset) + t1 = substr(t1, 1, 14 + offset) "..." + switch (cols[j][i]) { # fix rendered text width + case "sa": + t1 = sprintf(" %-"21+offset"s", t1) + break + case "he": case "dv": + t1 = sprintf(" %-"20+offset"s", t1) + break + case "bo": case "or": case "ur": + t1 = sprintf(" %-"19+offset"s", t1) + break + case "as": case "gom": case "mai": + case "gu": case "hi": case "bho": + case "ta": case "te": case "my": + case "ne": case "pa": case "km": + case "kn": case "yi": case "si": + t1 = sprintf(" %-"18+offset"s", t1) + break + case "lzh": case "yue": + t1 = sprintf(" %-"15+offset"s", t1) + break + case "ja": case "ko": + t1 = sprintf(" %-"14+offset"s", t1) + break + case "zh-CN": case "zh-TW": + t1 = sprintf(" %-"13+offset"s", t1) + break + default: + if (length(t1) <= 17+offset) + t1 = sprintf(" %-"17+offset"s", t1) + } + switch (length(cols[j][i])) { + case 1: case 2: case 3: case 4: + t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i]))) + break + case 5: + t2 = sprintf("- %s│", ansi("bold", cols[j][i])) + break + case 6: + t2 = sprintf("-%s│", ansi("bold", cols[j][i])) + break + case 7: + t2 = sprintf("-%s", ansi("bold", cols[j][i])) + break + default: + t2 = ansi("bold", cols[j][i]) + } + r = r t1 t2 + } else + r = r sprintf("%"25+offset"s│", NULLSTR) + } + r = r RS + } + r = r "└" replicate("─", 25 + offset) "┴" replicate("─", 25 + offset) \ + "┴" replicate("─", 25 + offset) "┴" replicate("─", 25 + offset) "┘" + } else { # fixed-width 3-column + r = "┌" replicate("─", 25) "┬" replicate("─", 25) "┬" replicate("─", 25) "┐" RS + for (i = 0; i < rows; i++) { + r = r "│" + for (j = 0; j < 3; j++) { + if (cols[j][i]) { + t1 = getDisplay(cols[j][i]) + if (length(t1) > 17) + t1 = substr(t1, 1, 14) "..." + switch (cols[j][i]) { # fix rendered text width + case "sa": + t1 = sprintf(" %-21s", t1) + break + case "he": case "dv": + t1 = sprintf(" %-20s", t1) + break + case "bo": case "or": case "ur": + t1 = sprintf(" %-19s", t1) + break + case "as": case "gom": case "mai": + case "gu": case "hi": case "bho": + case "ta": case "te": case "my": + case "ne": case "pa": case "km": + case "kn": case "yi": case "si": + t1 = sprintf(" %-18s", t1) + break + case "lzh": case "yue": + t1 = sprintf(" %-15s", t1) + break + case "ja": case "ko": + t1 = sprintf(" %-14s", t1) + break + case "zh-CN": case "zh-TW": + t1 = sprintf(" %-13s", t1) + break + default: + if (length(t1) <= 17) + t1 = sprintf(" %-17s", t1) + } + switch (length(cols[j][i])) { + case 1: case 2: case 3: case 4: + t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i]))) + break + case 5: + t2 = sprintf("- %s│", ansi("bold", cols[j][i])) + break + case 6: + t2 = sprintf("-%s│", ansi("bold", cols[j][i])) + break + case 7: + t2 = sprintf("-%s", ansi("bold", cols[j][i])) + break + default: + t2 = ansi("bold", cols[j][i]) + } + r = r t1 t2 + } else + r = r sprintf("%25s│", NULLSTR) + } + r = r RS } - r = r RS + r = r "└" replicate("─", 25) "┴" replicate("─", 25) "┴" replicate("─", 25) "┘" } - r = r "└" replicate("─", 25) "┴" replicate("─", 25) "┴" replicate("─", 25) "┘" } else { - r = "┌" replicate("─", 25) "┬" replicate("─", 25) "┬" replicate("─", 25) "┐" RS - for (i = 0; i < rows; i++) { - r = r "│" - for (j = 0; j < 3; j++) { - if (cols[j][i]) { - t1 = getName(cols[j][i]) - if (length(t1) > 17) - t1 = substr(t1, 1, 14) "..." - t1 = sprintf(" %-17s", t1) - switch (length(cols[j][i])) { - case 1: case 2: case 3: case 4: - t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i]))) - break - case 5: - t2 = sprintf("- %s│", ansi("bold", cols[j][i])) - break - case 6: - t2 = sprintf("-%s│", ansi("bold", cols[j][i])) - break - case 7: - t2 = sprintf("-%s", ansi("bold", cols[j][i])) - break - default: - t2 = ansi("bold", cols[j][i]) - } - r = r t1 t2 - } else - r = r sprintf("%25s│", NULLSTR) + if (colNum == 4) { # 4-column + offset = int((Option["width"] - 104) / 4) + r = "┌" replicate("─", 25 + offset) "┬" replicate("─", 25 + offset) \ + "┬" replicate("─", 25 + offset) "┬" replicate("─", 25 + offset) "┐" RS + for (i = 0; i < rows; i++) { + r = r "│" + for (j = 0; j < 4; j++) { + if (cols[j][i]) { + t1 = getName(cols[j][i]) + if (length(t1) > 17 + offset) + t1 = substr(t1, 1, 14 + offset) "..." + t1 = sprintf(" %-"17+offset"s", t1) + switch (length(cols[j][i])) { + case 1: case 2: case 3: case 4: + t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i]))) + break + case 5: + t2 = sprintf("- %s│", ansi("bold", cols[j][i])) + break + case 6: + t2 = sprintf("-%s│", ansi("bold", cols[j][i])) + break + case 7: + t2 = sprintf("-%s", ansi("bold", cols[j][i])) + break + default: + t2 = ansi("bold", cols[j][i]) + } + r = r t1 t2 + } else + r = r sprintf("%"25+offset"s│", NULLSTR) + } + r = r RS + } + r = r "└" replicate("─", 25 + offset) "┴" replicate("─", 25 + offset) \ + "┴" replicate("─", 25 + offset) "┴" replicate("─", 25 + offset) "┘" + } else { # fixed-width 3-column + r = "┌" replicate("─", 25) "┬" replicate("─", 25) "┬" replicate("─", 25) "┐" RS + for (i = 0; i < rows; i++) { + r = r "│" + for (j = 0; j < 3; j++) { + if (cols[j][i]) { + t1 = getName(cols[j][i]) + if (length(t1) > 17) + t1 = substr(t1, 1, 14) "..." + t1 = sprintf(" %-17s", t1) + switch (length(cols[j][i])) { + case 1: case 2: case 3: case 4: + t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i]))) + break + case 5: + t2 = sprintf("- %s│", ansi("bold", cols[j][i])) + break + case 6: + t2 = sprintf("-%s│", ansi("bold", cols[j][i])) + break + case 7: + t2 = sprintf("-%s", ansi("bold", cols[j][i])) + break + default: + t2 = ansi("bold", cols[j][i]) + } + r = r t1 t2 + } else + r = r sprintf("%25s│", NULLSTR) + } + r = r RS } - r = r RS + r = r "└" replicate("─", 25) "┴" replicate("─", 25) "┴" replicate("─", 25) "┘" } - r = r "└" replicate("─", 25) "┴" replicate("─", 25) "┴" replicate("─", 25) "┘" } return r } From 282eecfb04616ef42c41dc4908059c1d8f463ce8 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 16 Aug 2022 21:53:31 +0200 Subject: [PATCH 078/119] Translators/Auto: new engine for auto selection (google, bing) --- include/Translators/Auto.awk | 48 ++++++++++++++++++++++++++++++++++++ include/Translators/_.awk | 1 + translate | 1 + 3 files changed, 50 insertions(+) create mode 100644 include/Translators/Auto.awk diff --git a/include/Translators/Auto.awk b/include/Translators/Auto.awk new file mode 100644 index 00000000..e48c5f20 --- /dev/null +++ b/include/Translators/Auto.awk @@ -0,0 +1,48 @@ +#################################################################### +# Auto.awk # +#################################################################### +BEGIN { provides("auto") } + +function autoInit() { +} + +function autoTTSUrl(text, tl) { + # TODO: support Bing + return googleTTSUrl(text, tl) +} + +function autoWebTranslateUrl(uri, sl, tl, hl) { + # TODO: support Bing + return googleWebTranslateUrl(uri, sl, tl, hl) +} + +function autoTranslate(text, sl, tl, hl, + isVerbose, toSpeech, returnPlaylist, returnIl, + #### + engine, temp) { + if ((sl == "auto" || isSupportedByGoogle(sl)) && (tl == "auto" || isSupportedByGoogle(tl))) { + # both source and target languages are supported by Google + engine = Option["engine"] # auto + Option["engine"] = "google" + initHttpService() + temp = googleTranslate(text, sl, tl, hl, isVerbose, toSpeech, returnPlaylist, returnIl) + Option["engine"] = engine + } else if ((sl == "auto" || isSupportedByBing(sl)) && (tl == "auto" || isSupportedByBing(tl))) { + # both source and target languages are supported by Bing + engine = Option["engine"] # auto + Option["engine"] = "bing" + initHttpService() + temp = bingTranslate(text, sl, tl, hl, isVerbose, toSpeech, returnPlaylist, returnIl) + Option["engine"] = engine + } else { + # TODO: translate between Google-only and Bing-only languages + + # fallback to Google + engine = Option["engine"] # auto + Option["engine"] = "google" + initHttpService() + temp = googleTranslate(text, sl, tl, hl, isVerbose, toSpeech, returnPlaylist, returnIl) + Option["engine"] = engine + } + return temp +} diff --git a/include/Translators/_.awk b/include/Translators/_.awk index 7b092b39..12659f7f 100644 --- a/include/Translators/_.awk +++ b/include/Translators/_.awk @@ -3,3 +3,4 @@ @include "include/Translators/YandexTranslate.awk" @include "include/Translators/Apertium.awk" @include "include/Translators/SpellChecker.awk" +@include "include/Translators/Auto.awk" diff --git a/translate b/translate index 4c863392..dafe3592 100755 --- a/translate +++ b/translate @@ -16,6 +16,7 @@ gawk \ -i "${TRANS_DIR}/include/Translators/YandexTranslate.awk" \ -i "${TRANS_DIR}/include/Translators/Apertium.awk" \ -i "${TRANS_DIR}/include/Translators/SpellChecker.awk" \ +-i "${TRANS_DIR}/include/Translators/Auto.awk" \ -i "${TRANS_DIR}/include/Script.awk" \ -i "${TRANS_DIR}/include/REPL.awk" \ -f "${TRANS_DIR}/include/Main.awk" -- "$@" From 1068f0366e750441b6772af6a5f199cb23ec902c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 16 Aug 2022 23:06:08 +0200 Subject: [PATCH 079/119] Main: set default engine to auto --- include/Main.awk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/Main.awk b/include/Main.awk index 1c9f555d..b238f506 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -20,7 +20,7 @@ function init() { Option["debug"] = 0 # Translation engine - Option["engine"] = "google" + Option["engine"] = "auto" # Display Option["verbose"] = 1 @@ -780,8 +780,11 @@ BEGIN { print getList(Option["tl"]) exit ExitCode case "list-engines": + saveSortedIn = PROCINFO["sorted_in"] + PROCINFO["sorted_in"] = "@ind_num_asc" for (translator in Translator) print (Option["engine"] == translator ? "* " : " ") translator + PROCINFO["sorted_in"] = saveSortedIn exit ExitCode case "upgrade": upgrade() From 63968bc23fa826afbafe0409fdcd9113f61f9dbb Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 16 Aug 2022 23:13:45 +0200 Subject: [PATCH 080/119] Translators/BingTranslator: show error if statusCode is 400 --- include/Translators/BingTranslator.awk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index 67656f63..a58c2c77 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -276,6 +276,12 @@ function bingTranslate(text, sl, tl, hl, return } + if (ast[0 SUBSEP "statusCode"] == "400") { + e("[ERROR] " ucfirst(Option["engine"]) " does not support the specified language(s)") + ExitCode = 1 + return + } + translation = unparameterize(ast[0 SUBSEP 0 SUBSEP "translations" SUBSEP 0 SUBSEP "text"]) returnIl[0] = il = _sl == "auto-detect" ? From dcaef82c17e0943741976b8746f7041e4d32f71a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 17 Aug 2022 23:14:45 +0200 Subject: [PATCH 081/119] home language -> host language --- include/Help.awk | 9 ++++----- include/Main.awk | 22 +++++++++++++++++----- include/REPL.awk | 4 ++-- include/Translate.awk | 4 ++-- include/Translators/GoogleTranslate.awk | 8 ++++---- 5 files changed, 29 insertions(+), 18 deletions(-) diff --git a/include/Help.awk b/include/Help.awk index 967a71fb..1c0ee039 100644 --- a/include/Help.awk +++ b/include/Help.awk @@ -29,7 +29,7 @@ function getVersion( build, gitHead) { sprintf("%-22s%s\n", "web browser", Option["browser"] != NONE ? Option["browser"] :"[NONE]") \ sprintf("%-22s%s (%s)\n", "user locale", UserLocale, getName(UserLang)) \ - sprintf("%-22s%s\n", "home language", Option["hl"]) \ + sprintf("%-22s%s\n", "host language", Option["hl"]) \ sprintf("%-22s%s\n", "source language", join(Option["sls"], "+")) \ sprintf("%-22s%s\n", "target language", join(Option["tl"], "+")) \ sprintf("%-22s%s\n", "translation engine", Option["engine"]) \ @@ -178,10 +178,9 @@ function getHelp() { ", " ansi("bold", "-output ") ansi("underline", "FILENAME")) RS \ ins(2, "Specify the output file.") RS \ RS "Language preference options:" RS \ - ins(1, ansi("bold", "-l ") ansi("underline", "CODE") \ - ", " ansi("bold", "-hl ") ansi("underline", "CODE") \ - ", " ansi("bold", "-lang ") ansi("underline", "CODE")) RS \ - ins(2, "Specify your home language.") RS \ + ins(1, ansi("bold", "-hl ") ansi("underline", "CODE") \ + ", " ansi("bold", "-host ") ansi("underline", "CODE")) RS \ + ins(2, "Specify the host (interface) language.") RS \ ins(1, ansi("bold", "-s ") ansi("underline", "CODES") \ ", " ansi("bold", "-sl ") ansi("underline", "CODES") \ ", " ansi("bold", "-source ") ansi("underline", "CODES") \ diff --git a/include/Main.awk b/include/Main.awk index b238f506..92811c2d 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -75,7 +75,8 @@ function init() { Option["output"] = STDOUT # Language preference - Option["hl"] = ENVIRON["HOME_LANG"] ? ENVIRON["HOME_LANG"] : UserLang + Option["hl"] = ENVIRON["HOST_LANG"] ? ENVIRON["HOST_LANG"] : + ENVIRON["HOME_LANG"] ? ENVIRON["HOME_LANG"] : UserLang # FIXME[1.0]: HOME_LANG to be removed Option["sl"] = ENVIRON["SOURCE_LANG"] ? ENVIRON["SOURCE_LANG"] : "auto" Option["sls"][1] = Option["sl"] Option["tl"][1] = ENVIRON["TARGET_LANG"] ? ENVIRON["TARGET_LANG"] : UserLang @@ -229,8 +230,8 @@ BEGIN { # FIXME[1.0]: to be removed match(ARGV[pos], /^--?r$/) if (RSTART) { - w("[WARNING] Option '-r' has been deprecated since version 0.9.\n" \ - " Use option '-T' or '-reference' instead.") + w("[ERROR] Option '-r' has been deprecated since version 0.9.\n" \ + " Use option '-T' or '-reference' instead.") exit 1 } @@ -669,9 +670,20 @@ BEGIN { ## Language preference options - # -l CODE, -hl CODE, -lang CODE - match(ARGV[pos], /^--?(l(a(ng?)?)?|hl)(=(.*)?)?$/, group) + # -hl CODE, -host CODE + match(ARGV[pos], /^--?(host|hl)(=(.*)?)?$/, group) if (RSTART) { + Option["hl"] = group[2] ? + (group[3] ? group[3] : Option["hl"]) : + ARGV[++pos] + continue + } + # FIXME[1.0]: to be removed + # -l CODE, -lang CODE + match(ARGV[pos], /^--?(l(a(ng?)?)?)(=(.*)?)?$/, group) + if (RSTART) { + w("[WARNING] Option '-l' / '-lang' will be deprecated in the next version.\n" \ + " Use '-hl' / '-host' instead.") Option["hl"] = group[4] ? (group[5] ? group[5] : Option["hl"]) : ARGV[++pos] diff --git a/include/REPL.awk b/include/REPL.awk index 5c61b803..acaa3166 100644 --- a/include/REPL.awk +++ b/include/REPL.awk @@ -57,11 +57,11 @@ function prompt( i, p, temp) { if (p ~ /%_/) gsub(/%_/, showTranslationsOf(Option["hl"]), p) - # %l : home language + # %l : host language if (p ~ /%l/) gsub(/%l/, getDisplay(Option["hl"]), p) - # %L : home language (English name) + # %L : host language (English name) if (p ~ /%L/) gsub(/%L/, getName(Option["hl"]), p) diff --git a/include/Translate.awk b/include/Translate.awk index a6084961..3e2235ce 100644 --- a/include/Translate.awk +++ b/include/Translate.awk @@ -312,11 +312,11 @@ function translate(text, inline, i, j, playlist, il, saveSortedIn) { if (!getCode(Option["hl"])) { - # Check if home language is supported + # Check if host language is supported w("[WARNING] Unknown language code: " Option["hl"] ", fallback to English: en") Option["hl"] = "en" # fallback to English } else if (isRTL(Option["hl"])) { - # Check if home language is R-to-L + # Check if host language is R-to-L if (!FriBidi) w("[WARNING] " getName(Option["hl"]) " is a right-to-left language, but FriBidi is not found.") } diff --git a/include/Translators/GoogleTranslate.awk b/include/Translators/GoogleTranslate.awk index 9ea8025e..c15a67e9 100644 --- a/include/Translators/GoogleTranslate.awk +++ b/include/Translators/GoogleTranslate.awk @@ -284,9 +284,9 @@ function googleTranslate(text, sl, tl, hl, # Display: prompt message (Definitions of ...) if (r) r = r RS r = r m("-- display prompt message (Definitions of ...)") - if (isRTL(hl)) # home language is R-to-L + if (isRTL(hl)) # host language is R-to-L r = r prettify("prompt-message", s(showDefinitionsOf(hl, join(original, " ")))) - else { # home language is L-to-R + else { # host language is L-to-R split(showDefinitionsOf(hl, "\0%s\0"), group, "\0") for (i = 1; i <= length(group); i++) { if (group[i] == "%s") @@ -299,9 +299,9 @@ function googleTranslate(text, sl, tl, hl, # Display: prompt message (Translations of ...) if (r) r = r RS r = r m("-- display prompt message (Translations of ...)") - if (isRTL(hl)) # home language is R-to-L + if (isRTL(hl)) # host language is R-to-L r = r prettify("prompt-message", s(showTranslationsOf(hl, join(original, " ")))) - else { # home language is L-to-R + else { # host language is L-to-R split(showTranslationsOf(hl, "\0%s\0"), group, "\0") for (i = 1; i <= length(group); i++) { if (group[i] == "%s") From 187efcfdd878a8df849f9da1516cdb0886ccb375 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 17 Aug 2022 23:58:48 +0200 Subject: [PATCH 082/119] -list -> -language --- include/Help.awk | 4 ++-- include/Main.awk | 23 ++++++++++++++++++----- include/Translators/Apertium.awk | 2 +- include/Translators/BingTranslator.awk | 2 +- include/Translators/GoogleTranslate.awk | 2 +- include/Translators/YandexTranslate.awk | 2 +- 6 files changed, 24 insertions(+), 11 deletions(-) diff --git a/include/Help.awk b/include/Help.awk index 1c0ee039..78b900bd 100644 --- a/include/Help.awk +++ b/include/Help.awk @@ -63,7 +63,7 @@ function getHelp() { ins(1, ansi("bold", "-R") ", " ansi("bold", "-reference-english")) RS \ ins(2, "Print reference table of languages (in English names) and exit.") RS \ ins(1, ansi("bold", "-L ") ansi("underline", "CODES") \ - ", " ansi("bold", "-list ") ansi("underline", "CODES")) RS \ + ", " ansi("bold", "-language ") ansi("underline", "CODES")) RS \ ins(2, "Print details of languages and exit.") RS \ ins(1, ansi("bold", "-S") ", " ansi("bold", "-list-engines")) RS \ ins(2, "List available translation engines and exit.") RS \ @@ -472,7 +472,7 @@ function getReference(displayName, } # Return detailed information of languages as a string. -function getList(codes, code, i, r, saveSortedIn) { +function getLanguage(codes, code, i, r, saveSortedIn) { r = NULLSTR if (!isarray(codes)) r = getDetails(codes) diff --git a/include/Main.awk b/include/Main.awk index 92811c2d..00baf41a 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -242,10 +242,23 @@ BEGIN { continue } - # -L CODES, -list CODES - match(ARGV[pos], /^--?(L|list)(=(.*)?)?$/, group) + # -L CODES, -language CODES + match(ARGV[pos], /^--?(L|language)(=(.*)?)?$/, group) if (RSTART) { - InfoOnly = "list" + InfoOnly = "language" + if (group[2]) { + if (group[3]) split(group[3], Option["tl"], "+") + } else + split(ARGV[++pos], Option["tl"], "+") + continue + } + # FIXME[1.0]: to be removed + # -list CODE + match(ARGV[pos], /^--?(list)(=(.*)?)?$/, group) + if (RSTART) { + w("[WARNING] Option '-list' will be deprecated in the next version.\n" \ + " Use '-L' / '-language' instead.") + InfoOnly = "language" if (group[2]) { if (group[3]) split(group[3], Option["tl"], "+") } else @@ -788,8 +801,8 @@ BEGIN { case "reference-english": print getReference("name") exit ExitCode - case "list": - print getList(Option["tl"]) + case "language": + print getLanguage(Option["tl"]) exit ExitCode case "list-engines": saveSortedIn = PROCINFO["sorted_in"] diff --git a/include/Translators/Apertium.awk b/include/Translators/Apertium.awk index 717567fa..edf617df 100644 --- a/include/Translators/Apertium.awk +++ b/include/Translators/Apertium.awk @@ -71,7 +71,7 @@ function apertiumTranslate(text, sl, tl, hl, if (Option["verbose"] < -1) return il else if (Option["verbose"] < 0) - return getList(il) + return getLanguage(il) # Generate output if (!isVerbose) { diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index a58c2c77..a0638064 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -289,7 +289,7 @@ function bingTranslate(text, sl, tl, hl, if (Option["verbose"] < -1) return il if (Option["verbose"] < 0) - return getList(il) + return getLanguage(il) # Transliteration wShowTranslationPhonetics = Option["show-translation-phonetics"] diff --git a/include/Translators/GoogleTranslate.awk b/include/Translators/GoogleTranslate.awk index c15a67e9..8f506e2f 100644 --- a/include/Translators/GoogleTranslate.awk +++ b/include/Translators/GoogleTranslate.awk @@ -209,7 +209,7 @@ function googleTranslate(text, sl, tl, hl, if (Option["verbose"] < -1) return il else if (Option["verbose"] < 0) - return getList(il) + return getLanguage(il) # Generate output if (!isVerbose) { diff --git a/include/Translators/YandexTranslate.awk b/include/Translators/YandexTranslate.awk index 9b149041..64d50479 100644 --- a/include/Translators/YandexTranslate.awk +++ b/include/Translators/YandexTranslate.awk @@ -167,7 +167,7 @@ function yandexTranslate(text, sl, tl, hl, if (Option["verbose"] < -1) return il else if (Option["verbose"] < 0) - return getList(il) + return getLanguage(il) # Generate output if (!isVerbose) { From 481d9641911c30cb615bb53c42ef0d689b00e498 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Thu, 18 Aug 2022 23:04:09 +0200 Subject: [PATCH 083/119] new options: -list-languages, -list-languages-english, -list-codes, -list-all (close #353) --- include/Help.awk | 18 +++++++--- include/Main.awk | 90 +++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 90 insertions(+), 18 deletions(-) diff --git a/include/Help.awk b/include/Help.awk index 78b900bd..e6398728 100644 --- a/include/Help.awk +++ b/include/Help.awk @@ -59,14 +59,22 @@ function getHelp() { ins(1, ansi("bold", "-M") ", " ansi("bold", "-man")) RS \ ins(2, "Show man page and exit.") RS \ ins(1, ansi("bold", "-T") ", " ansi("bold", "-reference")) RS \ - ins(2, "Print reference table of languages and exit.") RS \ + ins(2, "Print reference table of languages (in endonyms) and codes, and exit.") RS \ ins(1, ansi("bold", "-R") ", " ansi("bold", "-reference-english")) RS \ - ins(2, "Print reference table of languages (in English names) and exit.") RS \ - ins(1, ansi("bold", "-L ") ansi("underline", "CODES") \ - ", " ansi("bold", "-language ") ansi("underline", "CODES")) RS \ - ins(2, "Print details of languages and exit.") RS \ + ins(2, "Print reference table of languages (in English names) and codes, and exit.") RS \ ins(1, ansi("bold", "-S") ", " ansi("bold", "-list-engines")) RS \ ins(2, "List available translation engines and exit.") RS \ + ins(1, ansi("bold", "-list-languages")) RS \ + ins(2, "List all languages (in endonyms) and exit.") RS \ + ins(1, ansi("bold", "-list-languages-english")) RS \ + ins(2, "List all languages (in English names) and exit.") RS \ + ins(1, ansi("bold", "-list-codes")) RS \ + ins(2, "List all codes and exit.") RS \ + ins(1, ansi("bold", "-list-all")) RS \ + ins(2, "List all languages (endonyms and English names) and codes, and exit.") RS \ + ins(1, ansi("bold", "-L ") ansi("underline", "CODES") \ + ", " ansi("bold", "-linguist ") ansi("underline", "CODES")) RS \ + ins(2, "Print details of languages and exit.") RS \ ins(1, ansi("bold", "-U") ", " ansi("bold", "-upgrade")) RS \ ins(2, "Check for upgrade of this program.") RS \ RS "Translator options:" RS \ diff --git a/include/Main.awk b/include/Main.awk index 00baf41a..9687a486 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -242,8 +242,43 @@ BEGIN { continue } - # -L CODES, -language CODES - match(ARGV[pos], /^--?(L|language)(=(.*)?)?$/, group) + # -S, -list-engines + match(ARGV[pos], /^--?(S|list-e(n(g(i(n(es?)?)?)?)?)?)$/) + if (RSTART) { + InfoOnly = "list-engines" + continue + } + + # -list-languages + match(ARGV[pos], /^--?(list-languages)$/) + if (RSTART) { + InfoOnly = "list-languages" + continue + } + + # -list-languages-english + match(ARGV[pos], /^--?(list-languages-english)$/) + if (RSTART) { + InfoOnly = "list-languages-english" + continue + } + + # -list-codes + match(ARGV[pos], /^--?(list-codes)$/) + if (RSTART) { + InfoOnly = "list-codes" + continue + } + + # -list-all + match(ARGV[pos], /^--?(list-all)$/) + if (RSTART) { + InfoOnly = "list-all" + continue + } + + # -L CODES, -linguist CODES + match(ARGV[pos], /^--?(L|linguist)(=(.*)?)?$/, group) if (RSTART) { InfoOnly = "language" if (group[2]) { @@ -257,7 +292,7 @@ BEGIN { match(ARGV[pos], /^--?(list)(=(.*)?)?$/, group) if (RSTART) { w("[WARNING] Option '-list' will be deprecated in the next version.\n" \ - " Use '-L' / '-language' instead.") + " Use '-L' / '-linguist' instead.") InfoOnly = "language" if (group[2]) { if (group[3]) split(group[3], Option["tl"], "+") @@ -266,13 +301,6 @@ BEGIN { continue } - # -S, -list-engines - match(ARGV[pos], /^--?(S|list-e(n(g(i(n(es?)?)?)?)?)?)$/) - if (RSTART) { - InfoOnly = "list-engines" - continue - } - # -U, -upgrade match(ARGV[pos], /^--?(U|upgrade)$/) if (RSTART) { @@ -801,9 +829,6 @@ BEGIN { case "reference-english": print getReference("name") exit ExitCode - case "language": - print getLanguage(Option["tl"]) - exit ExitCode case "list-engines": saveSortedIn = PROCINFO["sorted_in"] PROCINFO["sorted_in"] = "@ind_num_asc" @@ -811,6 +836,45 @@ BEGIN { print (Option["engine"] == translator ? "* " : " ") translator PROCINFO["sorted_in"] = saveSortedIn exit ExitCode + case "list-languages": + saveSortedIn = PROCINFO["sorted_in"] + PROCINFO["sorted_in"] = "@ind_num_asc" + for (code in Locale) + # only show languages that are supported + if (Locale[code]["supported-by"]) + print getDisplay(Locale[code]["endonym"]) + PROCINFO["sorted_in"] = saveSortedIn + exit ExitCode + case "list-languages-english": + saveSortedIn = PROCINFO["sorted_in"] + PROCINFO["sorted_in"] = "compName" + for (code in Locale) + # only show languages that are supported + if (Locale[code]["supported-by"]) + print Locale[code]["name"] #(Locale[code]["name2"] ? " / " Locale[code]["name2"] : "") + PROCINFO["sorted_in"] = saveSortedIn + exit ExitCode + case "list-codes": + saveSortedIn = PROCINFO["sorted_in"] + PROCINFO["sorted_in"] = "@ind_num_asc" + for (code in Locale) + # only show languages that are supported + if (Locale[code]["supported-by"]) + print code + PROCINFO["sorted_in"] = saveSortedIn + exit ExitCode + case "list-all": + saveSortedIn = PROCINFO["sorted_in"] + PROCINFO["sorted_in"] = "compName" + for (code in Locale) + # only show languages that are supported + if (Locale[code]["supported-by"]) + printf("%-10s %-30s %s\n", code, Locale[code]["name"], getDisplay(Locale[code]["endonym"])) + PROCINFO["sorted_in"] = saveSortedIn + exit ExitCode + case "language": + print getLanguage(Option["tl"]) + exit ExitCode case "upgrade": upgrade() exit ExitCode From a80ca32ef58f222b27a506aa1952a207fd9e8581 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 16:03:24 +0200 Subject: [PATCH 084/119] man: update --- man/trans.1 | 34 ++++++++++++++++++++++++---------- man/trans.1.md | 29 +++++++++++++++++++++-------- man/trans.1.template.md | 29 +++++++++++++++++++++-------- 3 files changed, 66 insertions(+), 26 deletions(-) diff --git a/man/trans.1 b/man/trans.1 index cf1f5787..95db390e 100644 --- a/man/trans.1 +++ b/man/trans.1 @@ -30,7 +30,8 @@ Print version and exit. .TP .B \f[B]\-H\f[R], \f[B]\-help\f[R] Print help message and exit. -\f[B]\-M\f[R], \f[B]\-man\f[R] +.TP +.B \f[B]\-M\f[R], \f[B]\-man\f[R] Show man page and exit. .TP .B \f[B]\-T\f[R], \f[B]\-reference\f[R] @@ -42,21 +43,34 @@ language itself). Print reference table of all supported languages and codes, and exit. Names of languages are displayed in English. .TP -.B \f[B]\-L\f[R] \f[I]CODES\f[R], \f[B]\-list\f[R] \f[I]CODES\f[R] +.B \f[B]\-S\f[R], \f[B]\-list\-engines\f[R] +List available translation engines and exit. +.TP +.B \f[B]\-list\-languages\f[R] +List all supported languages (in endonyms) and exit. +.TP +.B \f[B]\-list\-languages\-english\f[R] +List all supported languages (in English names) and exit. +.TP +.B \f[B]\-list\-codes\f[R] +List all supported codes and exit. +.TP +.B \f[B]\-list\-all\f[R] +List all supported languages (endonyms and English names) and codes, and +exit. +.TP +.B \f[B]\-L\f[R] \f[I]CODES\f[R], \f[B]\-linguist\f[R] \f[I]CODES\f[R] Print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign \[dq]+\[dq]. .TP -.B \f[B]\-S\f[R], \f[B]\-list\-engines\f[R] -List available translation engines and exit. -.TP .B \f[B]\-U\f[R], \f[B]\-upgrade\f[R] Check for upgrade of this program. .SS Translator options .TP .B \f[B]\-e\f[R] \f[I]ENGINE\f[R], \f[B]\-engine\f[R] \f[I]ENGINE\f[R] Specify the translation engine to use. -(default: google) +(default: auto) .SS Display options .TP .B \f[B]\-verbose\f[R] @@ -308,7 +322,7 @@ output. .RE .SS Language preference options .TP -.B \f[B]\-l\f[R] \f[I]CODE\f[R], \f[B]\-hl\f[R] \f[I]CODE\f[R], \f[B]\-lang\f[R] \f[I]CODE\f[R] +.B \f[B]\-hl\f[R] \f[I]CODE\f[R], \f[B]\-host\f[R] \f[I]CODE\f[R] Specify your home language (the language you would like to see for displaying prompt messages in the translation). .RS @@ -322,7 +336,7 @@ This option is optional. When its setting is omitted, English will be used. .PP This option overrides the setting of environment variables -$\f[B]LC_ALL\f[R], $\f[B]LANG\f[R], and $\f[B]HOME_LANG\f[R]. +$\f[B]LC_ALL\f[R], $\f[B]LANG\f[R], and $\f[B]HOST_LANG\f[R]. .RE .TP .B \f[B]\-s\f[R] \f[I]CODES\f[R], \f[B]\-sl\f[R] \f[I]CODES\f[R], \f[B]\-source\f[R] \f[I]CODES\f[R], \f[B]\-from\f[R] \f[I]CODES\f[R] @@ -410,8 +424,8 @@ Equivalent to option setting \f[B]\-proxy\f[R]. .B \f[B]USER_AGENT\f[R] Equivalent to option setting \f[B]\-user\-agent\f[R]. .TP -.B \f[B]HOME_LANG\f[R] -Equivalent to option setting \f[B]\-lang\f[R]. +.B \f[B]HOST_LANG\f[R] +Equivalent to option setting \f[B]\-host\f[R]. .TP .B \f[B]SOURCE_LANG\f[R] Equivalent to option setting \f[B]\-source\f[R]. diff --git a/man/trans.1.md b/man/trans.1.md index 663f20c5..73fae7ee 100644 --- a/man/trans.1.md +++ b/man/trans.1.md @@ -27,6 +27,7 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the **-H**, **-help** : Print help message and exit. + **-M**, **-man** : Show man page and exit. @@ -36,19 +37,31 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the **-R**, **-reference-english** : Print reference table of all supported languages and codes, and exit. Names of languages are displayed in English. -**-L** *CODES*, **-list** *CODES* -: Print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign "+". - **-S**, **-list-engines** : List available translation engines and exit. +**-list-languages** +: List all supported languages (in endonyms) and exit. + +**-list-languages-english** +: List all supported languages (in English names) and exit. + +**-list-codes** +: List all supported codes and exit. + +**-list-all** +: List all supported languages (endonyms and English names) and codes, and exit. + +**-L** *CODES*, **-linguist** *CODES* +: Print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign "+". + **-U**, **-upgrade** : Check for upgrade of this program. ## Translator options **-e** *ENGINE*, **-engine** *ENGINE* -: Specify the translation engine to use. (default: google) +: Specify the translation engine to use. (default: auto) ## Display options @@ -237,14 +250,14 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the ## Language preference options -**-l** *CODE*, **-hl** *CODE*, **-lang** *CODE* +**-hl** *CODE*, **-host** *CODE* : Specify your home language (the language you would like to see for displaying prompt messages in the translation). This option affects only the display in verbose mode (anything other than source language and target language will be displayed in your home language). This option has no effect in brief mode. This option is optional. When its setting is omitted, English will be used. - This option overrides the setting of environment variables $**LC_ALL**, $**LANG**, and $**HOME_LANG**. + This option overrides the setting of environment variables $**LC_ALL**, $**LANG**, and $**HOST_LANG**. **-s** *CODES*, **-sl** *CODES*, **-source** *CODES*, **-from** *CODES* : Specify the source language(s) (the language(s) of original text). When specifying two or more language codes, concatenate them by plus sign "+". @@ -312,8 +325,8 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the **USER_AGENT** : Equivalent to option setting **-user-agent**. -**HOME_LANG** -: Equivalent to option setting **-lang**. +**HOST_LANG** +: Equivalent to option setting **-host**. **SOURCE_LANG** : Equivalent to option setting **-source**. diff --git a/man/trans.1.template.md b/man/trans.1.template.md index 3cace144..1e378f20 100644 --- a/man/trans.1.template.md +++ b/man/trans.1.template.md @@ -27,6 +27,7 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the **-H**, **-help** : Print help message and exit. + **-M**, **-man** : Show man page and exit. @@ -36,19 +37,31 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the **-R**, **-reference-english** : Print reference table of all supported languages and codes, and exit. Names of languages are displayed in English. -**-L** *CODES*, **-list** *CODES* -: Print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign "+". - **-S**, **-list-engines** : List available translation engines and exit. +**-list-languages** +: List all supported languages (in endonyms) and exit. + +**-list-languages-english** +: List all supported languages (in English names) and exit. + +**-list-codes** +: List all supported codes and exit. + +**-list-all** +: List all supported languages (endonyms and English names) and codes, and exit. + +**-L** *CODES*, **-linguist** *CODES* +: Print details of languages and exit. When specifying two or more language codes, concatenate them by plus sign "+". + **-U**, **-upgrade** : Check for upgrade of this program. ## Translator options **-e** *ENGINE*, **-engine** *ENGINE* -: Specify the translation engine to use. (default: google) +: Specify the translation engine to use. (default: auto) ## Display options @@ -237,14 +250,14 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the ## Language preference options -**-l** *CODE*, **-hl** *CODE*, **-lang** *CODE* +**-hl** *CODE*, **-host** *CODE* : Specify your home language (the language you would like to see for displaying prompt messages in the translation). This option affects only the display in verbose mode (anything other than source language and target language will be displayed in your home language). This option has no effect in brief mode. This option is optional. When its setting is omitted, English will be used. - This option overrides the setting of environment variables $**LC_ALL**, $**LANG**, and $**HOME_LANG**. + This option overrides the setting of environment variables $**LC_ALL**, $**LANG**, and $**HOST_LANG**. **-s** *CODES*, **-sl** *CODES*, **-source** *CODES*, **-from** *CODES* : Specify the source language(s) (the language(s) of original text). When specifying two or more language codes, concatenate them by plus sign "+". @@ -312,8 +325,8 @@ If neither *TEXT* nor the input file is specified by command-line arguments, the **USER_AGENT** : Equivalent to option setting **-user-agent**. -**HOME_LANG** -: Equivalent to option setting **-lang**. +**HOST_LANG** +: Equivalent to option setting **-host**. **SOURCE_LANG** : Equivalent to option setting **-source**. From c07c9050535e52c151cdda0a68bd89a020eca337 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 16:55:26 +0200 Subject: [PATCH 085/119] Main: update default user-agent --- include/Main.awk | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/Main.awk b/include/Main.awk index 9687a486..c85bd772 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -59,10 +59,11 @@ function init() { # Networking Option["proxy"] = ENVIRON["HTTP_PROXY"] ? ENVIRON["HTTP_PROXY"] : ENVIRON["http_proxy"] Option["user-agent"] = ENVIRON["USER_AGENT"] ? ENVIRON["USER_AGENT"] : - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) " \ + "Mozilla/5.0 (Windows NT 10.0; Win64; x64) " \ "AppleWebKit/537.36 (KHTML, like Gecko) " \ - "Chrome/81.0.4044.138 " \ - "Safari/537.36" + "Chrome/104.0.0.0 " \ + "Safari/537.36 " \ + "Edg/104.0.1293.54" Option["ip-version"] = 0 # Interactive shell From 217f1da85e50aed7f2e996240fdbc91cbbbdae6a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 17:12:13 +0200 Subject: [PATCH 086/119] build.awk: update readme generator --- build.awk | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/build.awk b/build.awk index 4012ce53..b7c31285 100755 --- a/build.awk +++ b/build.awk @@ -50,7 +50,7 @@ function man( text) { return system("pandoc -s -f markdown-smart -t man " ManMarkdown " -o " Man) } -function readme( code, col, cols, content, group, i, j, num, language, r, rows, text) { +function readme( code, col, cols, content, group, i, iso, j, num, r, rows, text) { text = readFrom(ReadmeTemplate) content = getOutput("gawk -f translate.awk -- -no-ansi -h") @@ -82,9 +82,11 @@ function readme( code, col, cols, content, group, i, j, num, language, r, row r = r "| " for (j = 0; j < 3; j++) if (cols[j][i]) { - split(getName(cols[j][i]), group, " ") - language = length(group) == 1 ? group[1] "_language" : join(group, "_") - r = r "**[" getName(cols[j][i]) "](" "http://en.wikipedia.org/wiki/" language ")**
**" getEndonym(cols[j][i]) "** | **`" cols[j][i] "`** | " + split(getISO(cols[j][i]), group, "-") + iso = group[1] + + r = r "**[" getName(cols[j][i]) "](" "http://en.wikipedia.org/wiki/ISO_639:" iso \ + ")**
**" getEndonym(cols[j][i]) "** | **`" cols[j][i] "`** | " } r = r RS } From e263cd826a5eb0f3d1d5978e06165a526fa654c8 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 17:12:36 +0200 Subject: [PATCH 087/119] README: update --- README.md | 119 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 71 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index ca5ce6a6..f9aa152e 100644 --- a/README.md +++ b/README.md @@ -351,13 +351,21 @@ Information options: -M, -man Show man page and exit. -T, -reference - Print reference table of languages and exit. + Print reference table of languages (in endonyms) and codes, and exit. -R, -reference-english - Print reference table of languages (in English names) and exit. - -L CODES, -list CODES - Print details of languages and exit. + Print reference table of languages (in English names) and codes, and exit. -S, -list-engines List available translation engines and exit. + -list-languages + List all languages (in endonyms) and exit. + -list-languages-english + List all languages (in English names) and exit. + -list-codes + List all codes and exit. + -list-all + List all languages (endonyms and English names) and codes, and exit. + -L CODES, -linguist CODES + Print details of languages and exit. -U, -upgrade Check for upgrade of this program. @@ -468,8 +476,8 @@ I/O options: Specify the output file. Language preference options: - -l CODE, -hl CODE, -lang CODE - Specify your home language. + -hl CODE, -host CODE + Specify the host (interface) language. -s CODES, -sl CODES, -source CODES, -from CODES Specify the source language(s), joined by '+'. -t CODES, -tl CODES, -target CODES, -to CODES @@ -494,48 +502,63 @@ For more details on languages and corresponding codes, see **[wiki: Languages](h | Language | Code | Language | Code | Language | Code | | :------: | :--: | :------: | :--: | :------: | :--: | -| **[Afrikaans](http://en.wikipedia.org/wiki/Afrikaans_language)**
**Afrikaans** | **`af`** | **[Hill Mari](http://en.wikipedia.org/wiki/Hill_Mari)**
**Кырык мары** | **`mrj`** | **[Portuguese](http://en.wikipedia.org/wiki/Portuguese_language)**
**Português** | **`pt`** | -| **[Albanian](http://en.wikipedia.org/wiki/Albanian_language)**
**Shqip** | **`sq`** | **[Hindi](http://en.wikipedia.org/wiki/Hindi_language)**
**हिन्दी** | **`hi`** | **[Punjabi](http://en.wikipedia.org/wiki/Punjabi_language)**
**ਪੰਜਾਬੀ** | **`pa`** | -| **[Amharic](http://en.wikipedia.org/wiki/Amharic_language)**
**አማርኛ** | **`am`** | **[Hmong](http://en.wikipedia.org/wiki/Hmong_language)**
**Hmoob** | **`hmn`** | **[Querétaro Otomi](http://en.wikipedia.org/wiki/Querétaro_Otomi)**
**Hñąñho** | **`otq`** | -| **[Arabic](http://en.wikipedia.org/wiki/Arabic_language)**
**العربية** | **`ar`** | **[Hmong Daw](http://en.wikipedia.org/wiki/Hmong_Daw)**
**Hmoob Daw** | **`mww`** | **[Romanian](http://en.wikipedia.org/wiki/Romanian_language)**
**Română** | **`ro`** | -| **[Armenian](http://en.wikipedia.org/wiki/Armenian_language)**
**Հայերեն** | **`hy`** | **[Hungarian](http://en.wikipedia.org/wiki/Hungarian_language)**
**Magyar** | **`hu`** | **[Russian](http://en.wikipedia.org/wiki/Russian_language)**
**Русский** | **`ru`** | -| **[Azerbaijani](http://en.wikipedia.org/wiki/Azerbaijani_language)**
**Azərbaycanca** | **`az`** | **[Icelandic](http://en.wikipedia.org/wiki/Icelandic_language)**
**Íslenska** | **`is`** | **[Samoan](http://en.wikipedia.org/wiki/Samoan_language)**
**Gagana Sāmoa** | **`sm`** | -| **[Bashkir](http://en.wikipedia.org/wiki/Bashkir_language)**
**башҡорт теле** | **`ba`** | **[Igbo](http://en.wikipedia.org/wiki/Igbo_language)**
**Igbo** | **`ig`** | **[Scots Gaelic](http://en.wikipedia.org/wiki/Scots_Gaelic)**
**Gàidhlig** | **`gd`** | -| **[Basque](http://en.wikipedia.org/wiki/Basque_language)**
**Euskara** | **`eu`** | **[Indonesian](http://en.wikipedia.org/wiki/Indonesian_language)**
**Bahasa Indonesia** | **`id`** | **[Serbian (Cyrillic)](http://en.wikipedia.org/wiki/Serbian_(Cyrillic))**
**српски** | **`sr-Cyrl`** | -| **[Belarusian](http://en.wikipedia.org/wiki/Belarusian_language)**
**беларуская** | **`be`** | **[Irish](http://en.wikipedia.org/wiki/Irish_language)**
**Gaeilge** | **`ga`** | **[Serbian (Latin)](http://en.wikipedia.org/wiki/Serbian_(Latin))**
**srpski** | **`sr-Latn`** | -| **[Bengali](http://en.wikipedia.org/wiki/Bengali_language)**
**বাংলা** | **`bn`** | **[Italian](http://en.wikipedia.org/wiki/Italian_language)**
**Italiano** | **`it`** | **[Sesotho](http://en.wikipedia.org/wiki/Sesotho_language)**
**Sesotho** | **`st`** | -| **[Bosnian](http://en.wikipedia.org/wiki/Bosnian_language)**
**Bosanski** | **`bs`** | **[Japanese](http://en.wikipedia.org/wiki/Japanese_language)**
**日本語** | **`ja`** | **[Shona](http://en.wikipedia.org/wiki/Shona_language)**
**chiShona** | **`sn`** | -| **[Bulgarian](http://en.wikipedia.org/wiki/Bulgarian_language)**
**български** | **`bg`** | **[Javanese](http://en.wikipedia.org/wiki/Javanese_language)**
**Basa Jawa** | **`jv`** | **[Sindhi](http://en.wikipedia.org/wiki/Sindhi_language)**
**سنڌي** | **`sd`** | -| **[Cantonese](http://en.wikipedia.org/wiki/Cantonese_language)**
**粵語** | **`yue`** | **[Kannada](http://en.wikipedia.org/wiki/Kannada_language)**
**ಕನ್ನಡ** | **`kn`** | **[Sinhala](http://en.wikipedia.org/wiki/Sinhala_language)**
**සිංහල** | **`si`** | -| **[Catalan](http://en.wikipedia.org/wiki/Catalan_language)**
**Català** | **`ca`** | **[Kazakh](http://en.wikipedia.org/wiki/Kazakh_language)**
**Қазақ тілі** | **`kk`** | **[Slovak](http://en.wikipedia.org/wiki/Slovak_language)**
**Slovenčina** | **`sk`** | -| **[Cebuano](http://en.wikipedia.org/wiki/Cebuano_language)**
**Cebuano** | **`ceb`** | **[Khmer](http://en.wikipedia.org/wiki/Khmer_language)**
**ភាសាខ្មែរ** | **`km`** | **[Slovenian](http://en.wikipedia.org/wiki/Slovenian_language)**
**Slovenščina** | **`sl`** | -| **[Chichewa](http://en.wikipedia.org/wiki/Chichewa_language)**
**Nyanja** | **`ny`** | **[Kinyarwanda](http://en.wikipedia.org/wiki/Kinyarwanda_language)**
**Ikinyarwanda** | **`rw`** | **[Somali](http://en.wikipedia.org/wiki/Somali_language)**
**Soomaali** | **`so`** | -| **[Chinese Simplified](http://en.wikipedia.org/wiki/Chinese_Simplified)**
**简体中文** | **`zh-CN`** | **[Klingon](http://en.wikipedia.org/wiki/Klingon_language)**
**tlhIngan Hol** | **`tlh`** | **[Spanish](http://en.wikipedia.org/wiki/Spanish_language)**
**Español** | **`es`** | -| **[Chinese Traditional](http://en.wikipedia.org/wiki/Chinese_Traditional)**
**正體中文** | **`zh-TW`** | **[Klingon (pIqaD)](http://en.wikipedia.org/wiki/Klingon_(pIqaD))**
** ** | **`tlh-Qaak`** | **[Sundanese](http://en.wikipedia.org/wiki/Sundanese_language)**
**Basa Sunda** | **`su`** | -| **[Corsican](http://en.wikipedia.org/wiki/Corsican_language)**
**Corsu** | **`co`** | **[Korean](http://en.wikipedia.org/wiki/Korean_language)**
**한국어** | **`ko`** | **[Swahili](http://en.wikipedia.org/wiki/Swahili_language)**
**Kiswahili** | **`sw`** | -| **[Croatian](http://en.wikipedia.org/wiki/Croatian_language)**
**Hrvatski** | **`hr`** | **[Kurdish](http://en.wikipedia.org/wiki/Kurdish_language)**
**Kurdî** | **`ku`** | **[Swedish](http://en.wikipedia.org/wiki/Swedish_language)**
**Svenska** | **`sv`** | -| **[Czech](http://en.wikipedia.org/wiki/Czech_language)**
**Čeština** | **`cs`** | **[Kyrgyz](http://en.wikipedia.org/wiki/Kyrgyz_language)**
**Кыргызча** | **`ky`** | **[Tahitian](http://en.wikipedia.org/wiki/Tahitian_language)**
**Reo Tahiti** | **`ty`** | -| **[Danish](http://en.wikipedia.org/wiki/Danish_language)**
**Dansk** | **`da`** | **[Lao](http://en.wikipedia.org/wiki/Lao_language)**
**ລາວ** | **`lo`** | **[Tajik](http://en.wikipedia.org/wiki/Tajik_language)**
**Тоҷикӣ** | **`tg`** | -| **[Dutch](http://en.wikipedia.org/wiki/Dutch_language)**
**Nederlands** | **`nl`** | **[Latin](http://en.wikipedia.org/wiki/Latin_language)**
**Latina** | **`la`** | **[Tamil](http://en.wikipedia.org/wiki/Tamil_language)**
**தமிழ்** | **`ta`** | -| **[Eastern Mari](http://en.wikipedia.org/wiki/Eastern_Mari)**
**Олык марий** | **`mhr`** | **[Latvian](http://en.wikipedia.org/wiki/Latvian_language)**
**Latviešu** | **`lv`** | **[Tatar](http://en.wikipedia.org/wiki/Tatar_language)**
**татарча** | **`tt`** | -| **[Emoji](http://en.wikipedia.org/wiki/Emoji_language)**
**Emoji** | **`emj`** | **[Lithuanian](http://en.wikipedia.org/wiki/Lithuanian_language)**
**Lietuvių** | **`lt`** | **[Telugu](http://en.wikipedia.org/wiki/Telugu_language)**
**తెలుగు** | **`te`** | -| **[English](http://en.wikipedia.org/wiki/English_language)**
**English** | **`en`** | **[Luxembourgish](http://en.wikipedia.org/wiki/Luxembourgish_language)**
**Lëtzebuergesch** | **`lb`** | **[Thai](http://en.wikipedia.org/wiki/Thai_language)**
**ไทย** | **`th`** | -| **[Esperanto](http://en.wikipedia.org/wiki/Esperanto_language)**
**Esperanto** | **`eo`** | **[Macedonian](http://en.wikipedia.org/wiki/Macedonian_language)**
**Македонски** | **`mk`** | **[Tongan](http://en.wikipedia.org/wiki/Tongan_language)**
**Lea faka-Tonga** | **`to`** | -| **[Estonian](http://en.wikipedia.org/wiki/Estonian_language)**
**Eesti** | **`et`** | **[Malagasy](http://en.wikipedia.org/wiki/Malagasy_language)**
**Malagasy** | **`mg`** | **[Turkish](http://en.wikipedia.org/wiki/Turkish_language)**
**Türkçe** | **`tr`** | -| **[Fijian](http://en.wikipedia.org/wiki/Fijian_language)**
**Vosa Vakaviti** | **`fj`** | **[Malay](http://en.wikipedia.org/wiki/Malay_language)**
**Bahasa Melayu** | **`ms`** | **[Turkmen](http://en.wikipedia.org/wiki/Turkmen_language)**
**Türkmen** | **`tk`** | -| **[Filipino](http://en.wikipedia.org/wiki/Filipino_language)**
**Tagalog** | **`tl`** | **[Malayalam](http://en.wikipedia.org/wiki/Malayalam_language)**
**മലയാളം** | **`ml`** | **[Udmurt](http://en.wikipedia.org/wiki/Udmurt_language)**
**удмурт** | **`udm`** | -| **[Finnish](http://en.wikipedia.org/wiki/Finnish_language)**
**Suomi** | **`fi`** | **[Maltese](http://en.wikipedia.org/wiki/Maltese_language)**
**Malti** | **`mt`** | **[Ukrainian](http://en.wikipedia.org/wiki/Ukrainian_language)**
**Українська** | **`uk`** | -| **[French](http://en.wikipedia.org/wiki/French_language)**
**Français** | **`fr`** | **[Maori](http://en.wikipedia.org/wiki/Maori_language)**
**Māori** | **`mi`** | **[Urdu](http://en.wikipedia.org/wiki/Urdu_language)**
**اُردُو** | **`ur`** | -| **[Frisian](http://en.wikipedia.org/wiki/Frisian_language)**
**Frysk** | **`fy`** | **[Marathi](http://en.wikipedia.org/wiki/Marathi_language)**
**मराठी** | **`mr`** | **[Uyghur](http://en.wikipedia.org/wiki/Uyghur_language)**
**ئۇيغۇر تىلى** | **`ug`** | -| **[Galician](http://en.wikipedia.org/wiki/Galician_language)**
**Galego** | **`gl`** | **[Mongolian](http://en.wikipedia.org/wiki/Mongolian_language)**
**Монгол** | **`mn`** | **[Uzbek](http://en.wikipedia.org/wiki/Uzbek_language)**
**Oʻzbek tili** | **`uz`** | -| **[Georgian](http://en.wikipedia.org/wiki/Georgian_language)**
**ქართული** | **`ka`** | **[Myanmar](http://en.wikipedia.org/wiki/Myanmar_language)**
**မြန်မာစာ** | **`my`** | **[Vietnamese](http://en.wikipedia.org/wiki/Vietnamese_language)**
**Tiếng Việt** | **`vi`** | -| **[German](http://en.wikipedia.org/wiki/German_language)**
**Deutsch** | **`de`** | **[Nepali](http://en.wikipedia.org/wiki/Nepali_language)**
**नेपाली** | **`ne`** | **[Welsh](http://en.wikipedia.org/wiki/Welsh_language)**
**Cymraeg** | **`cy`** | -| **[Greek](http://en.wikipedia.org/wiki/Greek_language)**
**Ελληνικά** | **`el`** | **[Norwegian](http://en.wikipedia.org/wiki/Norwegian_language)**
**Norsk** | **`no`** | **[Xhosa](http://en.wikipedia.org/wiki/Xhosa_language)**
**isiXhosa** | **`xh`** | -| **[Gujarati](http://en.wikipedia.org/wiki/Gujarati_language)**
**ગુજરાતી** | **`gu`** | **[Oriya](http://en.wikipedia.org/wiki/Oriya_language)**
**ଓଡ଼ିଆ** | **`or`** | **[Yiddish](http://en.wikipedia.org/wiki/Yiddish_language)**
**ייִדיש** | **`yi`** | -| **[Haitian Creole](http://en.wikipedia.org/wiki/Haitian_Creole)**
**Kreyòl Ayisyen** | **`ht`** | **[Papiamento](http://en.wikipedia.org/wiki/Papiamento_language)**
**Papiamentu** | **`pap`** | **[Yoruba](http://en.wikipedia.org/wiki/Yoruba_language)**
**Yorùbá** | **`yo`** | -| **[Hausa](http://en.wikipedia.org/wiki/Hausa_language)**
**Hausa** | **`ha`** | **[Pashto](http://en.wikipedia.org/wiki/Pashto_language)**
**پښتو** | **`ps`** | **[Yucatec Maya](http://en.wikipedia.org/wiki/Yucatec_Maya)**
**Màaya T'àan** | **`yua`** | -| **[Hawaiian](http://en.wikipedia.org/wiki/Hawaiian_language)**
**ʻŌlelo Hawaiʻi** | **`haw`** | **[Persian](http://en.wikipedia.org/wiki/Persian_language)**
**فارسی** | **`fa`** | **[Zulu](http://en.wikipedia.org/wiki/Zulu_language)**
**isiZulu** | **`zu`** | -| **[Hebrew](http://en.wikipedia.org/wiki/Hebrew_language)**
**עִבְרִית** | **`he`** | **[Polish](http://en.wikipedia.org/wiki/Polish_language)**
**Polski** | **`pl`** | +| **[Afrikaans](http://en.wikipedia.org/wiki/ISO_639:afr)**
**Afrikaans** | **`af`** | **[Hebrew](http://en.wikipedia.org/wiki/ISO_639:heb)**
**עִבְרִית** | **`he`** | **[Portuguese (Brazilian)](http://en.wikipedia.org/wiki/ISO_639:por)**
**Português Brasileiro** | **`pt-BR`** | +| **[Albanian](http://en.wikipedia.org/wiki/ISO_639:sqi)**
**Shqip** | **`sq`** | **[Hill Mari](http://en.wikipedia.org/wiki/ISO_639:mrj)**
**Кырык мары** | **`mrj`** | **[Portuguese (European)](http://en.wikipedia.org/wiki/ISO_639:por)**
**Português Europeu** | **`pt-PT`** | +| **[Amharic](http://en.wikipedia.org/wiki/ISO_639:amh)**
**አማርኛ** | **`am`** | **[Hindi](http://en.wikipedia.org/wiki/ISO_639:hin)**
**हिन्दी** | **`hi`** | **[Punjabi](http://en.wikipedia.org/wiki/ISO_639:pan)**
**ਪੰਜਾਬੀ** | **`pa`** | +| **[Arabic](http://en.wikipedia.org/wiki/ISO_639:ara)**
**العربية** | **`ar`** | **[Hmong](http://en.wikipedia.org/wiki/ISO_639:hmn)**
**Hmoob** | **`hmn`** | **[Quechua](http://en.wikipedia.org/wiki/ISO_639:que)**
**Runasimi** | **`qu`** | +| **[Armenian](http://en.wikipedia.org/wiki/ISO_639:hye)**
**Հայերեն** | **`hy`** | **[Hungarian](http://en.wikipedia.org/wiki/ISO_639:hun)**
**Magyar** | **`hu`** | **[Querétaro Otomi](http://en.wikipedia.org/wiki/ISO_639:otq)**
**Hñąñho** | **`otq`** | +| **[Assamese](http://en.wikipedia.org/wiki/ISO_639:asm)**
**অসমীয়া** | **`as`** | **[Icelandic](http://en.wikipedia.org/wiki/ISO_639:isl)**
**Íslenska** | **`is`** | **[Romanian](http://en.wikipedia.org/wiki/ISO_639:ron)**
**Română** | **`ro`** | +| **[Aymara](http://en.wikipedia.org/wiki/ISO_639:aym)**
**Aymar aru** | **`ay`** | **[Igbo](http://en.wikipedia.org/wiki/ISO_639:ibo)**
**Igbo** | **`ig`** | **[Romansh](http://en.wikipedia.org/wiki/ISO_639:roh)**
**Rumantsch** | **`rm`** | +| **[Azerbaijani](http://en.wikipedia.org/wiki/ISO_639:aze)**
**Azərbaycanca** | **`az`** | **[Ilocano](http://en.wikipedia.org/wiki/ISO_639:ilo)**
**Ilokano** | **`ilo`** | **[Russian](http://en.wikipedia.org/wiki/ISO_639:rus)**
**Русский** | **`ru`** | +| **[Bambara](http://en.wikipedia.org/wiki/ISO_639:bam)**
**Bamanankan** | **`bm`** | **[Indonesian](http://en.wikipedia.org/wiki/ISO_639:ind)**
**Bahasa Indonesia** | **`id`** | **[Samoan](http://en.wikipedia.org/wiki/ISO_639:smo)**
**Gagana Sāmoa** | **`sm`** | +| **[Bashkir](http://en.wikipedia.org/wiki/ISO_639:bak)**
**Башҡортса** | **`ba`** | **[Interlingue](http://en.wikipedia.org/wiki/ISO_639:ile)**
**Interlingue** | **`ie`** | **[Sanskrit](http://en.wikipedia.org/wiki/ISO_639:san)**
**संस्कृतम्** | **`sa`** | +| **[Basque](http://en.wikipedia.org/wiki/ISO_639:eus)**
**Euskara** | **`eu`** | **[Inuinnaqtun](http://en.wikipedia.org/wiki/ISO_639:ikt)**
**Inuinnaqtun** | **`ikt`** | **[Scots Gaelic](http://en.wikipedia.org/wiki/ISO_639:gla)**
**Gàidhlig** | **`gd`** | +| **[Belarusian](http://en.wikipedia.org/wiki/ISO_639:bel)**
**беларуская** | **`be`** | **[Inuktitut](http://en.wikipedia.org/wiki/ISO_639:iku)**
**ᐃᓄᒃᑎᑐᑦ** | **`iu`** | **[Sepedi](http://en.wikipedia.org/wiki/ISO_639:nso)**
**Sepedi** | **`nso`** | +| **[Bengali](http://en.wikipedia.org/wiki/ISO_639:ben)**
**বাংলা** | **`bn`** | **[Inuktitut (Latin)](http://en.wikipedia.org/wiki/ISO_639:iku)**
**Inuktitut** | **`iu-Latn`** | **[Serbian (Cyrillic)](http://en.wikipedia.org/wiki/ISO_639:srp)**
**Српски** | **`sr-Cyrl`** | +| **[Bhojpuri](http://en.wikipedia.org/wiki/ISO_639:bho)**
**भोजपुरी** | **`bho`** | **[Irish](http://en.wikipedia.org/wiki/ISO_639:gle)**
**Gaeilge** | **`ga`** | **[Serbian (Latin)](http://en.wikipedia.org/wiki/ISO_639:srp)**
**Srpski** | **`sr-Latn`** | +| **[Bosnian](http://en.wikipedia.org/wiki/ISO_639:bos)**
**Bosanski** | **`bs`** | **[Italian](http://en.wikipedia.org/wiki/ISO_639:ita)**
**Italiano** | **`it`** | **[Sesotho](http://en.wikipedia.org/wiki/ISO_639:sot)**
**Sesotho** | **`st`** | +| **[Breton](http://en.wikipedia.org/wiki/ISO_639:bre)**
**Brezhoneg** | **`br`** | **[Japanese](http://en.wikipedia.org/wiki/ISO_639:jpn)**
**日本語** | **`ja`** | **[Setswana](http://en.wikipedia.org/wiki/ISO_639:tsn)**
**Setswana** | **`tn`** | +| **[Bulgarian](http://en.wikipedia.org/wiki/ISO_639:bul)**
**български** | **`bg`** | **[Javanese](http://en.wikipedia.org/wiki/ISO_639:jav)**
**Basa Jawa** | **`jv`** | **[Shona](http://en.wikipedia.org/wiki/ISO_639:sna)**
**chiShona** | **`sn`** | +| **[Cantonese](http://en.wikipedia.org/wiki/ISO_639:yue)**
**粵語** | **`yue`** | **[Kannada](http://en.wikipedia.org/wiki/ISO_639:kan)**
**ಕನ್ನಡ** | **`kn`** | **[Sindhi](http://en.wikipedia.org/wiki/ISO_639:snd)**
**سنڌي** | **`sd`** | +| **[Catalan](http://en.wikipedia.org/wiki/ISO_639:cat)**
**Català** | **`ca`** | **[Kazakh](http://en.wikipedia.org/wiki/ISO_639:kaz)**
**Қазақ тілі** | **`kk`** | **[Sinhala](http://en.wikipedia.org/wiki/ISO_639:sin)**
**සිංහල** | **`si`** | +| **[Cebuano](http://en.wikipedia.org/wiki/ISO_639:ceb)**
**Cebuano** | **`ceb`** | **[Khmer](http://en.wikipedia.org/wiki/ISO_639:khm)**
**ភាសាខ្មែរ** | **`km`** | **[Slovak](http://en.wikipedia.org/wiki/ISO_639:slk)**
**Slovenčina** | **`sk`** | +| **[Cherokee](http://en.wikipedia.org/wiki/ISO_639:chr)**
**ᏣᎳᎩ** | **`chr`** | **[Kinyarwanda](http://en.wikipedia.org/wiki/ISO_639:kin)**
**Ikinyarwanda** | **`rw`** | **[Slovenian](http://en.wikipedia.org/wiki/ISO_639:slv)**
**Slovenščina** | **`sl`** | +| **[Chichewa](http://en.wikipedia.org/wiki/ISO_639:nya)**
**Nyanja** | **`ny`** | **[Klingon](http://en.wikipedia.org/wiki/ISO_639:tlh)**
**tlhIngan Hol** | **`tlh-Latn`** | **[Somali](http://en.wikipedia.org/wiki/ISO_639:som)**
**Soomaali** | **`so`** | +| **[Chinese (Literary)](http://en.wikipedia.org/wiki/ISO_639:lzh)**
**文言** | **`lzh`** | **[Konkani](http://en.wikipedia.org/wiki/ISO_639:gom)**
**कोंकणी** | **`gom`** | **[Spanish](http://en.wikipedia.org/wiki/ISO_639:spa)**
**Español** | **`es`** | +| **[Chinese (Simplified)](http://en.wikipedia.org/wiki/ISO_639:zho)**
**简体中文** | **`zh-CN`** | **[Korean](http://en.wikipedia.org/wiki/ISO_639:kor)**
**한국어** | **`ko`** | **[Sundanese](http://en.wikipedia.org/wiki/ISO_639:sun)**
**Basa Sunda** | **`su`** | +| **[Chinese (Traditional)](http://en.wikipedia.org/wiki/ISO_639:zho)**
**繁體中文** | **`zh-TW`** | **[Krio](http://en.wikipedia.org/wiki/ISO_639:kri)**
**Krio** | **`kri`** | **[Swahili](http://en.wikipedia.org/wiki/ISO_639:swa)**
**Kiswahili** | **`sw`** | +| **[Chuvash](http://en.wikipedia.org/wiki/ISO_639:chv)**
**Чӑвашла** | **`cv`** | **[Kurdish (Central)](http://en.wikipedia.org/wiki/ISO_639:ckb)**
**سۆرانی** | **`ckb`** | **[Swedish](http://en.wikipedia.org/wiki/ISO_639:swe)**
**Svenska** | **`sv`** | +| **[Corsican](http://en.wikipedia.org/wiki/ISO_639:cos)**
**Corsu** | **`co`** | **[Kurdish (Northern)](http://en.wikipedia.org/wiki/ISO_639:kmr)**
**Kurmancî** | **`ku`** | **[Tahitian](http://en.wikipedia.org/wiki/ISO_639:tah)**
**Reo Tahiti** | **`ty`** | +| **[Croatian](http://en.wikipedia.org/wiki/ISO_639:hrv)**
**Hrvatski** | **`hr`** | **[Kyrgyz](http://en.wikipedia.org/wiki/ISO_639:kir)**
**Кыргызча** | **`ky`** | **[Tajik](http://en.wikipedia.org/wiki/ISO_639:tgk)**
**Тоҷикӣ** | **`tg`** | +| **[Czech](http://en.wikipedia.org/wiki/ISO_639:ces)**
**Čeština** | **`cs`** | **[Lao](http://en.wikipedia.org/wiki/ISO_639:lao)**
**ລາວ** | **`lo`** | **[Tamil](http://en.wikipedia.org/wiki/ISO_639:tam)**
**தமிழ்** | **`ta`** | +| **[Danish](http://en.wikipedia.org/wiki/ISO_639:dan)**
**Dansk** | **`da`** | **[Latin](http://en.wikipedia.org/wiki/ISO_639:lat)**
**Latina** | **`la`** | **[Tatar](http://en.wikipedia.org/wiki/ISO_639:tat)**
**татарча** | **`tt`** | +| **[Dari](http://en.wikipedia.org/wiki/ISO_639:prs)**
**دری** | **`prs`** | **[Latvian](http://en.wikipedia.org/wiki/ISO_639:lav)**
**Latviešu** | **`lv`** | **[Telugu](http://en.wikipedia.org/wiki/ISO_639:tel)**
**తెలుగు** | **`te`** | +| **[Dhivehi](http://en.wikipedia.org/wiki/ISO_639:div)**
**ދިވެހި** | **`dv`** | **[Lingala](http://en.wikipedia.org/wiki/ISO_639:lin)**
**Lingála** | **`ln`** | **[Thai](http://en.wikipedia.org/wiki/ISO_639:tha)**
**ไทย** | **`th`** | +| **[Dogri](http://en.wikipedia.org/wiki/ISO_639:doi)**
**डोगरी** | **`doi`** | **[Lithuanian](http://en.wikipedia.org/wiki/ISO_639:lit)**
**Lietuvių** | **`lt`** | **[Tibetan](http://en.wikipedia.org/wiki/ISO_639:bod)**
**བོད་ཡིག** | **`bo`** | +| **[Dutch](http://en.wikipedia.org/wiki/ISO_639:nld)**
**Nederlands** | **`nl`** | **[Luganda](http://en.wikipedia.org/wiki/ISO_639:lug)**
**Luganda** | **`lg`** | **[Tigrinya](http://en.wikipedia.org/wiki/ISO_639:tir)**
**ትግርኛ** | **`ti`** | +| **[Dzongkha](http://en.wikipedia.org/wiki/ISO_639:dzo)**
**རྫོང་ཁ** | **`dz`** | **[Luxembourgish](http://en.wikipedia.org/wiki/ISO_639:ltz)**
**Lëtzebuergesch** | **`lb`** | **[Tongan](http://en.wikipedia.org/wiki/ISO_639:ton)**
**Lea faka-Tonga** | **`to`** | +| **[Eastern Mari](http://en.wikipedia.org/wiki/ISO_639:mhr)**
**Олык марий** | **`mhr`** | **[Macedonian](http://en.wikipedia.org/wiki/ISO_639:mkd)**
**Македонски** | **`mk`** | **[Tsonga](http://en.wikipedia.org/wiki/ISO_639:tso)**
**Xitsonga** | **`ts`** | +| **[English](http://en.wikipedia.org/wiki/ISO_639:eng)**
**English** | **`en`** | **[Maithili](http://en.wikipedia.org/wiki/ISO_639:mai)**
**मैथिली** | **`mai`** | **[Turkish](http://en.wikipedia.org/wiki/ISO_639:tur)**
**Türkçe** | **`tr`** | +| **[Esperanto](http://en.wikipedia.org/wiki/ISO_639:epo)**
**Esperanto** | **`eo`** | **[Malagasy](http://en.wikipedia.org/wiki/ISO_639:mlg)**
**Malagasy** | **`mg`** | **[Turkmen](http://en.wikipedia.org/wiki/ISO_639:tuk)**
**Türkmen** | **`tk`** | +| **[Estonian](http://en.wikipedia.org/wiki/ISO_639:est)**
**Eesti** | **`et`** | **[Malay](http://en.wikipedia.org/wiki/ISO_639:msa)**
**Bahasa Melayu** | **`ms`** | **[Twi](http://en.wikipedia.org/wiki/ISO_639:twi)**
**Twi** | **`tw`** | +| **[Ewe](http://en.wikipedia.org/wiki/ISO_639:ewe)**
**Eʋegbe** | **`ee`** | **[Malayalam](http://en.wikipedia.org/wiki/ISO_639:mal)**
**മലയാളം** | **`ml`** | **[Udmurt](http://en.wikipedia.org/wiki/ISO_639:udm)**
**Удмурт** | **`udm`** | +| **[Faroese](http://en.wikipedia.org/wiki/ISO_639:fao)**
**Føroyskt** | **`fo`** | **[Maltese](http://en.wikipedia.org/wiki/ISO_639:mlt)**
**Malti** | **`mt`** | **[Ukrainian](http://en.wikipedia.org/wiki/ISO_639:ukr)**
**Українська** | **`uk`** | +| **[Fijian](http://en.wikipedia.org/wiki/ISO_639:fij)**
**Vosa Vakaviti** | **`fj`** | **[Maori](http://en.wikipedia.org/wiki/ISO_639:mri)**
**Māori** | **`mi`** | **[Upper Sorbian](http://en.wikipedia.org/wiki/ISO_639:hsb)**
**Hornjoserbšćina** | **`hsb`** | +| **[Filipino](http://en.wikipedia.org/wiki/ISO_639:fil)**
**Filipino** | **`tl`** | **[Marathi](http://en.wikipedia.org/wiki/ISO_639:mar)**
**मराठी** | **`mr`** | **[Urdu](http://en.wikipedia.org/wiki/ISO_639:urd)**
**اُردُو** | **`ur`** | +| **[Finnish](http://en.wikipedia.org/wiki/ISO_639:fin)**
**Suomi** | **`fi`** | **[Meiteilon](http://en.wikipedia.org/wiki/ISO_639:mni)**
**ꯃꯤꯇꯩꯂꯣꯟ** | **`mni-Mtei`** | **[Uyghur](http://en.wikipedia.org/wiki/ISO_639:uig)**
**ئۇيغۇر تىلى** | **`ug`** | +| **[French](http://en.wikipedia.org/wiki/ISO_639:fra)**
**Français** | **`fr`** | **[Mizo](http://en.wikipedia.org/wiki/ISO_639:lus)**
**Mizo ṭawng** | **`lus`** | **[Uzbek](http://en.wikipedia.org/wiki/ISO_639:uzb)**
**Oʻzbek tili** | **`uz`** | +| **[French (Canadian)](http://en.wikipedia.org/wiki/ISO_639:fra)**
**Français canadien** | **`fr-CA`** | **[Mongolian](http://en.wikipedia.org/wiki/ISO_639:mon)**
**Монгол** | **`mn`** | **[Vietnamese](http://en.wikipedia.org/wiki/ISO_639:vie)**
**Tiếng Việt** | **`vi`** | +| **[Frisian](http://en.wikipedia.org/wiki/ISO_639:fry)**
**Frysk** | **`fy`** | **[Mongolian (Traditional)](http://en.wikipedia.org/wiki/ISO_639:mon)**
**ᠮᠣᠩᠭᠣᠯ** | **`mn-Mong`** | **[Volapük](http://en.wikipedia.org/wiki/ISO_639:vol)**
**Volapük** | **`vo`** | +| **[Galician](http://en.wikipedia.org/wiki/ISO_639:glg)**
**Galego** | **`gl`** | **[Myanmar](http://en.wikipedia.org/wiki/ISO_639:mya)**
**မြန်မာစာ** | **`my`** | **[Welsh](http://en.wikipedia.org/wiki/ISO_639:cym)**
**Cymraeg** | **`cy`** | +| **[Georgian](http://en.wikipedia.org/wiki/ISO_639:kat)**
**ქართული** | **`ka`** | **[Nepali](http://en.wikipedia.org/wiki/ISO_639:nep)**
**नेपाली** | **`ne`** | **[Wolof](http://en.wikipedia.org/wiki/ISO_639:wol)**
**Wollof** | **`wo`** | +| **[German](http://en.wikipedia.org/wiki/ISO_639:deu)**
**Deutsch** | **`de`** | **[Norwegian](http://en.wikipedia.org/wiki/ISO_639:nor)**
**Norsk** | **`no`** | **[Xhosa](http://en.wikipedia.org/wiki/ISO_639:xho)**
**isiXhosa** | **`xh`** | +| **[Greek](http://en.wikipedia.org/wiki/ISO_639:ell)**
**Ελληνικά** | **`el`** | **[Occitan](http://en.wikipedia.org/wiki/ISO_639:oci)**
**Occitan** | **`oc`** | **[Yakut](http://en.wikipedia.org/wiki/ISO_639:sah)**
**Sakha** | **`sah`** | +| **[Greenlandic](http://en.wikipedia.org/wiki/ISO_639:kal)**
**Kalaallisut** | **`kl`** | **[Odia](http://en.wikipedia.org/wiki/ISO_639:ori)**
**ଓଡ଼ିଆ** | **`or`** | **[Yiddish](http://en.wikipedia.org/wiki/ISO_639:yid)**
**ייִדיש** | **`yi`** | +| **[Guarani](http://en.wikipedia.org/wiki/ISO_639:gug)**
**Avañe'ẽ** | **`gn`** | **[Oromo](http://en.wikipedia.org/wiki/ISO_639:orm)**
**Afaan Oromoo** | **`om`** | **[Yoruba](http://en.wikipedia.org/wiki/ISO_639:yor)**
**Yorùbá** | **`yo`** | +| **[Gujarati](http://en.wikipedia.org/wiki/ISO_639:guj)**
**ગુજરાતી** | **`gu`** | **[Papiamento](http://en.wikipedia.org/wiki/ISO_639:pap)**
**Papiamentu** | **`pap`** | **[Yucatec Maya](http://en.wikipedia.org/wiki/ISO_639:yua)**
**Màaya T'àan** | **`yua`** | +| **[Haitian Creole](http://en.wikipedia.org/wiki/ISO_639:hat)**
**Kreyòl Ayisyen** | **`ht`** | **[Pashto](http://en.wikipedia.org/wiki/ISO_639:pus)**
**پښتو** | **`ps`** | **[Zulu](http://en.wikipedia.org/wiki/ISO_639:zul)**
**isiZulu** | **`zu`** | +| **[Hausa](http://en.wikipedia.org/wiki/ISO_639:hau)**
**Hausa** | **`ha`** | **[Persian](http://en.wikipedia.org/wiki/ISO_639:fas)**
**فارسی** | **`fa`** | +| **[Hawaiian](http://en.wikipedia.org/wiki/ISO_639:haw)**
**ʻŌlelo Hawaiʻi** | **`haw`** | **[Polish](http://en.wikipedia.org/wiki/ISO_639:pol)**
**Polski** | **`pl`** | ## Wiki From 9c9211c561a782370aca341d334c447c603bdf02 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 17:17:54 +0200 Subject: [PATCH 088/119] version 0.9.7 --- man/trans.1 | 2 +- man/trans.1.md | 4 ++-- metainfo.awk | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/trans.1 b/man/trans.1 index 95db390e..fbaae51f 100644 --- a/man/trans.1 +++ b/man/trans.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 2.5 .\" -.TH "TRANS" "1" "2020\-05\-11" "0.9.6.12" "" +.TH "TRANS" "1" "2022\-08\-19" "0.9.7" "" .hy .SH NAME .PP diff --git a/man/trans.1.md b/man/trans.1.md index 73fae7ee..4e637e5e 100644 --- a/man/trans.1.md +++ b/man/trans.1.md @@ -1,6 +1,6 @@ -% TRANS(1) 0.9.6.12 +% TRANS(1) 0.9.7 % Mort Yao -% 2020-05-11 +% 2022-08-19 # NAME diff --git a/metainfo.awk b/metainfo.awk index 85482fb5..6689f170 100644 --- a/metainfo.awk +++ b/metainfo.awk @@ -1,8 +1,8 @@ BEGIN { Name = "Translate Shell" Description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc." - Version = "0.9.6.12" - ReleaseDate = "2020-05-11" + Version = "0.9.7" + ReleaseDate = "2022-08-19" Command = "trans" EntryPoint = "translate.awk" EntryScript = "translate" From 99441507a2848c7ad97b5e5cc0baea0fee539382 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 18:13:03 +0200 Subject: [PATCH 089/119] README: update --- README.md | 2 +- README.template.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f9aa152e..7811e45f 100644 --- a/README.md +++ b/README.md @@ -317,7 +317,7 @@ A browser session will open for viewing the translation (via Google Translate's ### Language Details -Use the `-list` (`-L`) option to view details of one or more languages: +Use the `-linguist` (`-L`) option to view details of one or more languages: $ trans -L fr $ trans -L de+en diff --git a/README.template.md b/README.template.md index 1d987003..3fd6156e 100644 --- a/README.template.md +++ b/README.template.md @@ -317,7 +317,7 @@ A browser session will open for viewing the translation (via Google Translate's ### Language Details -Use the `-list` (`-L`) option to view details of one or more languages: +Use the `-linguist` (`-L`) option to view details of one or more languages: $ trans -L fr $ trans -L de+en From 43941d2dc1eeba923061829052775edc82c5bc4a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 19:20:59 +0200 Subject: [PATCH 090/119] build.awk: update wiki generator --- build.awk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.awk b/build.awk index b7c31285..08f5e628 100755 --- a/build.awk +++ b/build.awk @@ -117,12 +117,12 @@ function wiki( code, group, iso, language, saveSortedIn) { split(getISO(code), group, "-") iso = group[1] - split(getName(code), group, " ") - language = length(group) == 1 ? group[1] "_language" : - group[2] ~ /^\(.*\)$/ ? group[1] "_language" : join(group, "_") + #split(getName(code), group, " ") + #language = length(group) == 1 ? group[1] "_language" : + # group[2] ~ /^\(.*\)$/ ? group[1] "_language" : join(group, "_") print sprintf("| **`%s`**
[`%s`](%s) | **[%s](%s)**
**%s** | %s | `%s` | %s | %s |", getCode(code), iso, "http://www.ethnologue.com/language/" iso, - getName(code), "http://en.wikipedia.org/wiki/" language, getEndonym(code), + getName(code), "http://en.wikipedia.org/wiki/ISO_639:" iso, getEndonym(code), getFamily(code), getScript(code), isRTL(code) ? "✓" : NULLSTR, hasDictionary(code) ? "✓" : NULLSTR) > WikiLanguages From 639808342e798074b407241b63cf472bea3a254b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 19 Aug 2022 22:26:20 +0200 Subject: [PATCH 091/119] LanguageData: fix hyphen --- include/LanguageData.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/LanguageData.awk b/include/LanguageData.awk index 991c1562..09dac9bd 100644 --- a/include/LanguageData.awk +++ b/include/LanguageData.awk @@ -2452,7 +2452,7 @@ function initLocale() { #Locale["ts"]["synonyms"] #Locale["ts"]["examples"] #Locale["ts"]["see-also"] - Locale["ts"]["family"] = "Atlantic–Congo" + Locale["ts"]["family"] = "Atlantic-Congo" Locale["ts"]["branch"] = "Bantu" Locale["ts"]["iso"] = "tso" Locale["ts"]["glotto"] = "tson1249" From a7ac43d8a0b0438092bfa4c4200061b98f5517ff Mon Sep 17 00:00:00 2001 From: Vladimir Sinitsin <58597891+VladimirSinitsin@users.noreply.github.com> Date: Tue, 20 Sep 2022 11:55:30 +0300 Subject: [PATCH 092/119] Update the name of antigen plugin in README - added a pointer to the current branch --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7811e45f..40db3334 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ See **[wiki: Distros](https://github.com/soimort/translate-shell/wiki/Distros)** Add the following line to your `.zshrc`: - antigen bundle soimort/translate-shell + antigen bundle soimort/translate-shell@develop ### Option #3. From Git From e00e41c7e9553b2a0e47f3371c545fc79922f9f3 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 1 Oct 2022 00:36:35 +0200 Subject: [PATCH 093/119] REPL: support setting sl and tl by :set (fix #451) --- include/REPL.awk | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/include/REPL.awk b/include/REPL.awk index acaa3166..5c77713b 100644 --- a/include/REPL.awk +++ b/include/REPL.awk @@ -68,7 +68,7 @@ function prompt( i, p, temp) { # %s : source languages, separated by "+" # 's' is the format-control character for string - # %S : source languages (English names), seperated by "+" + # %S : source languages (English names), separated by "+" if (p ~ /%S/) { temp = getName(Option["sls"][1]) for (i = 2; i <= length(Option["sls"]); i++) @@ -144,6 +144,15 @@ function repl(line, command, group, name, i, value, words) { name = words[2] value = words[3] Option[name] = value + # :set sl and :set tl should work as intended + # TODO: support multiple language codes + if (name == "sl") { + delete Option["sls"] + Option["sls"][1] = Option["sl"] + } else if (name == "tl") { + delete Option["tl"] + Option["tl"][1] = value + } } else if (command ~ /^:show$/) { name = words[2] print prettify("welcome-submessage", toString(Option[name], 1, 0, 1)) @@ -155,6 +164,8 @@ function repl(line, command, group, name, i, value, words) { value = words[2] Option["engine"] = value initHttpService() + } else if (command ~ /^:reset$/) { + # TODO: reset source and target languages, etc. } else { match(command, /^[{(\[]?((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group) if (RSTART) { From 28e57f7cf4ba75432c0610f5e64322db591b1f9d Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 1 Oct 2022 01:02:58 +0200 Subject: [PATCH 094/119] REPL: get things right --- include/REPL.awk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/REPL.awk b/include/REPL.awk index 5c77713b..d817b291 100644 --- a/include/REPL.awk +++ b/include/REPL.awk @@ -143,15 +143,16 @@ function repl(line, command, group, name, i, value, words) { } else if (command ~ /^:set$/) { name = words[2] value = words[3] - Option[name] = value # :set sl and :set tl should work as intended # TODO: support multiple language codes if (name == "sl") { delete Option["sls"] - Option["sls"][1] = Option["sl"] + Option["sls"][1] = value } else if (name == "tl") { delete Option["tl"] Option["tl"][1] = value + } else { + Option[name] = value } } else if (command ~ /^:show$/) { name = words[2] From cc38910ecc9303c9f29583cbce9580b051c6bcc4 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 26 Oct 2022 15:50:20 +0200 Subject: [PATCH 095/119] CONTRIBUTING.md: remove CLAHub (down now) --- CONTRIBUTING.md | 2 +- wiki | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc606c79..fef78936 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ ### Waiving Copyrights -This is a public domain software, which means the author(s) do not retain any copyright interest in this repository. You ("the contributor") will be asked to **[sign the Contributor License Agreement](https://www.clahub.com/agreements/soimort/translate-shell)** before your contribution can be considered. +This is a public domain software, which means the author(s) do not retain any copyright interest in this repository. By submitting a pull request, you (as a contributor) must agree that your code is also put into the public domain, as this software is. ### Following the Coding Style diff --git a/wiki b/wiki index 886345f3..eb31d6e9 160000 --- a/wiki +++ b/wiki @@ -1 +1 @@ -Subproject commit 886345f3029775bc18512649f5086e2233bec50a +Subproject commit eb31d6e9cd017beba5e796bb3f27f68af440a534 From 08412012b8c2ad226124d6d4936bcf4e084d70d5 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sat, 29 Oct 2022 22:58:57 +0200 Subject: [PATCH 096/119] Translate: separate header and body correctly, per RFC 2616 (#378) --- include/Translate.awk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/Translate.awk b/include/Translate.awk index 3e2235ce..78635c63 100644 --- a/include/Translate.awk +++ b/include/Translate.awk @@ -119,6 +119,7 @@ function getResponse(text, sl, tl, hl, if (HttpAuthUser && HttpAuthPass) # TODO: digest auth header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n" + header = header "\r\n" # separate header and body correctly, per RFC 2616 content = NULLSTR; isBody = 0 while (1) { @@ -189,6 +190,7 @@ function postResponse(text, sl, tl, hl, type, if (HttpAuthUser && HttpAuthPass) # TODO: digest auth header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n" + header = header "\r\n" # separate header and body correctly, per RFC 2616 content = NULLSTR; isBody = 0 while (1) { From 89568ec49f3dab3707c5c2ea995b05dee04ab619 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 30 Oct 2022 16:18:00 +0100 Subject: [PATCH 097/119] Translate: fix redundant CRLF in postResponse --- include/Translate.awk | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/Translate.awk b/include/Translate.awk index 78635c63..30bee512 100644 --- a/include/Translate.awk +++ b/include/Translate.awk @@ -119,11 +119,11 @@ function getResponse(text, sl, tl, hl, if (HttpAuthUser && HttpAuthPass) # TODO: digest auth header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n" - header = header "\r\n" # separate header and body correctly, per RFC 2616 content = NULLSTR; isBody = 0 while (1) { - print header |& HttpService + # separate header and body correctly with CRLF, per RFC 2616 + print (header "\r\n") |& HttpService while ((HttpService |& getline) > 0) { if (isBody) content = content ? content "\n" $0 : $0 @@ -190,7 +190,6 @@ function postResponse(text, sl, tl, hl, type, if (HttpAuthUser && HttpAuthPass) # TODO: digest auth header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n" - header = header "\r\n" # separate header and body correctly, per RFC 2616 content = NULLSTR; isBody = 0 while (1) { From b3888ec7b1e7b3d3114a3ec113998f6907ac577a Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Sun, 30 Oct 2022 17:17:04 +0100 Subject: [PATCH 098/119] Translate: log request header --- include/Translate.awk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/Translate.awk b/include/Translate.awk index 30bee512..e5f171f7 100644 --- a/include/Translate.awk +++ b/include/Translate.awk @@ -119,6 +119,7 @@ function getResponse(text, sl, tl, hl, if (HttpAuthUser && HttpAuthPass) # TODO: digest auth header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n" + l(header) # log request header content = NULLSTR; isBody = 0 while (1) { @@ -190,6 +191,7 @@ function postResponse(text, sl, tl, hl, type, if (HttpAuthUser && HttpAuthPass) # TODO: digest auth header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n" + l(header) # log request header content = NULLSTR; isBody = 0 while (1) { From 60fa757a0275b2652a1f2b155c03fdc36feda741 Mon Sep 17 00:00:00 2001 From: Jan Blechta Date: Thu, 12 Jan 2023 16:36:38 +0100 Subject: [PATCH 099/119] Fix regression in Bing --- include/Translators/BingTranslator.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Translators/BingTranslator.awk b/include/Translators/BingTranslator.awk index a0638064..7676b262 100644 --- a/include/Translators/BingTranslator.awk +++ b/include/Translators/BingTranslator.awk @@ -66,7 +66,7 @@ function bingSetup( ast, content, cookie, group, header, isBody, key, exit 1 } - match(content, /params_RichTranslateHelper = ([^;]+);/, group) + match(content, /params_AbusePreventionHelper = ([^;]+);/, group) if (group[1]) { tokenize(tokens, group[1]) parseJson(ast, tokens) From cca3dfba9d786fbbcfc16b0f2179a106762e48d4 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 31 Jan 2023 22:44:00 +0100 Subject: [PATCH 100/119] Translators/Auto: autoTTSUrl should invoke initHttpService (fix #481) --- include/Translators/Auto.awk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/Translators/Auto.awk b/include/Translators/Auto.awk index e48c5f20..333f82ac 100644 --- a/include/Translators/Auto.awk +++ b/include/Translators/Auto.awk @@ -8,12 +8,18 @@ function autoInit() { function autoTTSUrl(text, tl) { # TODO: support Bing + Option["engine"] = "google" + initHttpService() return googleTTSUrl(text, tl) + # TODO: reset engine to auto } function autoWebTranslateUrl(uri, sl, tl, hl) { # TODO: support Bing + Option["engine"] = "google" + initHttpService() return googleWebTranslateUrl(uri, sl, tl, hl) + # TODO: reset engine to auto } function autoTranslate(text, sl, tl, hl, From 7c85dec6e9ecd91efaf673e9f5b5d3a0a1c29a5e Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Feb 2023 15:31:25 +0100 Subject: [PATCH 101/119] README: update (closes #463) --- README.md | 1 + README.template.md | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 40db3334..9da42c90 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ In order to be happy, the best way is to be loved by people. * gawk comes with all GNU/Linux distributions. * On FreeBSD, gawk is available in the ports. * On macOS, gawk is available in MacPorts and Homebrew. + * Please note that gawk 5.2.0 has a [known bug](https://github.com/soimort/translate-shell/issues/463) -- update to gawk 5.2.1 instead. * **[GNU Bash](http://www.gnu.org/software/bash/)** or **[Zsh](http://www.zsh.org/)** * You may use Translate Shell from any Unix shell of your choice (bash, zsh, ksh, tcsh, fish, etc.); however, the wrapper script requires either **bash** or **zsh** installed. diff --git a/README.template.md b/README.template.md index 3fd6156e..2d3ae081 100644 --- a/README.template.md +++ b/README.template.md @@ -66,6 +66,7 @@ In order to be happy, the best way is to be loved by people. * gawk comes with all GNU/Linux distributions. * On FreeBSD, gawk is available in the ports. * On macOS, gawk is available in MacPorts and Homebrew. + * Please note that gawk 5.2.0 has a [known bug](https://github.com/soimort/translate-shell/issues/463) -- update to gawk 5.2.1 instead. * **[GNU Bash](http://www.gnu.org/software/bash/)** or **[Zsh](http://www.zsh.org/)** * You may use Translate Shell from any Unix shell of your choice (bash, zsh, ksh, tcsh, fish, etc.); however, the wrapper script requires either **bash** or **zsh** installed. @@ -130,7 +131,7 @@ See **[wiki: Distros](https://github.com/soimort/translate-shell/wiki/Distros)** Add the following line to your `.zshrc`: - antigen bundle soimort/translate-shell + antigen bundle soimort/translate-shell@develop ### Option #3. From Git From 04cbf23af338f2b17667b8e73f3ed4dea4464478 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 8 Feb 2023 15:40:36 +0100 Subject: [PATCH 102/119] version 0.9.7.1 --- man/trans.1 | 2 +- man/trans.1.md | 4 ++-- metainfo.awk | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/trans.1 b/man/trans.1 index fbaae51f..6172db88 100644 --- a/man/trans.1 +++ b/man/trans.1 @@ -1,6 +1,6 @@ .\" Automatically generated by Pandoc 2.5 .\" -.TH "TRANS" "1" "2022\-08\-19" "0.9.7" "" +.TH "TRANS" "1" "2023\-02\-08" "0.9.7.1" "" .hy .SH NAME .PP diff --git a/man/trans.1.md b/man/trans.1.md index 4e637e5e..847d64e6 100644 --- a/man/trans.1.md +++ b/man/trans.1.md @@ -1,6 +1,6 @@ -% TRANS(1) 0.9.7 +% TRANS(1) 0.9.7.1 % Mort Yao -% 2022-08-19 +% 2023-02-08 # NAME diff --git a/metainfo.awk b/metainfo.awk index 6689f170..38ccec93 100644 --- a/metainfo.awk +++ b/metainfo.awk @@ -1,8 +1,8 @@ BEGIN { Name = "Translate Shell" Description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc." - Version = "0.9.7" - ReleaseDate = "2022-08-19" + Version = "0.9.7.1" + ReleaseDate = "2023-02-08" Command = "trans" EntryPoint = "translate.awk" EntryScript = "translate" From f4a9a311079fdab2a50cec1187311068e33f6b60 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 15 Feb 2023 16:45:25 +0100 Subject: [PATCH 103/119] update workflow --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d6c17a5..331a7921 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,9 @@ on: branches: - develop - stable + pull_request: + branches: + - develop jobs: build: From 92c206b274a45128ee9779f0ed765bd57339f207 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Tue, 14 Feb 2023 13:49:49 +0800 Subject: [PATCH 104/119] Fix spelling issue Suggested-by: anorack --- include/Utils.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Utils.awk b/include/Utils.awk index e9dc62b5..9a30e6f9 100644 --- a/include/Utils.awk +++ b/include/Utils.awk @@ -78,7 +78,7 @@ function newerVersion(ver1, ver2, i, group1, group2) { return 0 } -# Fork a rlwrap process as the wrapper. Return non-zero if failed, +# Fork an rlwrap process as the wrapper. Return non-zero if failed, function rlwrapMe( i, command) { initRlwrap() From 43fc3e65b35dcdf3b81bdae83ef7bba63ddb097b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 24 Feb 2023 18:58:03 +0100 Subject: [PATCH 105/119] Commons: handle Unicode ZERO WIDTH NON-JOINER correctly, fix #486 --- include/Commons.awk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/Commons.awk b/include/Commons.awk index 83b9ef14..658b0bbf 100644 --- a/include/Commons.awk +++ b/include/Commons.awk @@ -204,6 +204,8 @@ function escapeChar(char) { return ">" # Unicode Character 'GREATER-THAN SIGN' case "u200b": return "" # Unicode Character 'ZERO WIDTH SPACE' + case "u200c": + return "" # Unicode Character 'ZERO WIDTH NON-JOINER' default: return char } From d4a58731439456bc6d4d4b6cc86a7712aea488c8 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 18 Oct 2023 16:24:03 +0200 Subject: [PATCH 106/119] Translators/GoogleTranslate: show "-no-auto" hint only when -no-auto is not in use --- include/Translators/GoogleTranslate.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Translators/GoogleTranslate.awk b/include/Translators/GoogleTranslate.awk index 8f506e2f..802eefc2 100644 --- a/include/Translators/GoogleTranslate.awk +++ b/include/Translators/GoogleTranslate.awk @@ -156,7 +156,7 @@ function googleTranslate(text, sl, tl, hl, # 7 - autocorrection if (i ~ "^0" SUBSEP "7" SUBSEP "5$") { - if (ast[i] == "true") + if (!Option["no-autocorrect"] && ast[i] == "true") w("Showing translation for: (use -no-auto to disable autocorrect)") else w("Did you mean: " \ From 928168cf6ac8911d51df80d6d2f5e95147da6a05 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 18 Oct 2023 17:16:32 +0200 Subject: [PATCH 107/119] update .circleci/config.yml --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3bf91d55..55c3d978 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,7 +5,7 @@ jobs: LC_ALL: C.UTF-8 LANG: C.UTF-8 docker: - - image: debian:stretch + - image: cimg/base:2023.09 steps: - checkout - run: From 24044af0090cb83fb02d844fff0a60b535f8138c Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 18 Oct 2023 17:19:20 +0200 Subject: [PATCH 108/119] update .circleci/config.yml --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 55c3d978..b2e71504 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,9 +11,9 @@ jobs: - run: name: Install Dependencies command: | - apt-get update - apt-get -y install locales make - apt-get -y install util-linux bsdmainutils gawk curl rlwrap emacs + sudo apt-get update + sudo apt-get -y install locales make + sudo apt-get -y install util-linux bsdmainutils gawk curl rlwrap emacs - run: name: Sanity Check command: | From f664171050bf5d441859bf1238b5094b70b752c9 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 20 Oct 2023 02:31:38 +0200 Subject: [PATCH 109/119] vte>=0.57.3 supports BiDi (fix #464) --- include/Main.awk | 4 ++-- include/Utils.awk | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/Main.awk b/include/Main.awk index c85bd772..69a06139 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -139,8 +139,8 @@ function initMisc( command, group, temp) { if (Option["no-bidi"] || BiDiTerm == "mlterm") # mlterm implements its own padding BiDi = BiDiNoPad = NULLSTR - else if (!Option["force-bidi"] && BiDiTerm == "konsole") { - # konsole implements no padding; we should handle this + else if (!Option["force-bidi"] && (BiDiTerm == "vte" || BiDiTerm == "konsole")) { + # vte & konsole implement no padding; we should handle this BiDiNoPad = NULLSTR BiDi = "sed \"s/'/\\\\\\'/\" | xargs -0 printf '%%%ss'" } diff --git a/include/Utils.awk b/include/Utils.awk index 9a30e6f9..0ea2ee79 100644 --- a/include/Utils.awk +++ b/include/Utils.awk @@ -23,6 +23,9 @@ function initBiDiTerm() { BiDiTerm = "mlterm" else if (ENVIRON["KONSOLE_VERSION"]) BiDiTerm = "konsole" + else if (ENVIRON["VTE_VERSION"]) + if (int(ENVIRON["VTE_VERSION"]) >= 5703) + BiDiTerm = "vte" } # Detect external bidirectional algorithm utility (fribidi); From d3dec1def999d236e0975ff41fefb58514f04c8b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 3 Nov 2023 05:04:06 +0100 Subject: [PATCH 110/119] Main: allow only lowercase letters in language codes (fix #503) --- include/Main.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Main.awk b/include/Main.awk index 69a06139..d66add4c 100644 --- a/include/Main.awk +++ b/include/Main.awk @@ -755,7 +755,7 @@ BEGIN { # Shortcut format # 'CODE:CODE+...' or 'CODE=CODE+...' - match(ARGV[pos], /^[{(\[]?((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group) + match(ARGV[pos], /^[{(\[]?((@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)?(:|=)((@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group) if (RSTART) { if (group[1]) { split(group[1], Option["sls"], "+") From c5d9d8b2121de7dec49b8e2171aed03e8af95e5b Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Fri, 3 Nov 2023 17:29:15 +0100 Subject: [PATCH 111/119] REPL: allow only lowercase letters in language codes --- include/REPL.awk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/REPL.awk b/include/REPL.awk index d817b291..ee836e55 100644 --- a/include/REPL.awk +++ b/include/REPL.awk @@ -168,7 +168,7 @@ function repl(line, command, group, name, i, value, words) { } else if (command ~ /^:reset$/) { # TODO: reset source and target languages, etc. } else { - match(command, /^[{(\[]?((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group) + match(command, /^[{(\[]?((@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)?(:|=)((@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[a-z][a-z][a-z]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group) if (RSTART) { if (group[1]) { split(group[1], Option["sls"], "+") From 4aa3ae1867a013e32319ff7f41d7bb6fef76af51 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Tue, 5 Dec 2023 19:22:04 +0100 Subject: [PATCH 112/119] Utils: set rlwrap's application name to trans --- include/Utils.awk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/Utils.awk b/include/Utils.awk index 0ea2ee79..7d0c3f3f 100644 --- a/include/Utils.awk +++ b/include/Utils.awk @@ -91,10 +91,10 @@ function rlwrapMe( i, command) { } if (ENVIRON["TRANS_ENTRY"]) { - command = Rlwrap " " ENVIRON["TRANS_ENTRY"] " " \ + command = Rlwrap " -C trans " ENVIRON["TRANS_ENTRY"] " " \ parameterize("-no-rlwrap") # never fork rlwrap again! } else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) { - command = Rlwrap " sh " \ + command = Rlwrap " -C trans " " sh " \ parameterize(ENVIRON["TRANS_DIR"] "/" EntryScript) \ " - " parameterize("-no-rlwrap") # never fork rlwrap again! } else { From d7a00923c71a8d72a0b167ddd6bf8cb1ca942771 Mon Sep 17 00:00:00 2001 From: Evgeniy Isaev Date: Sat, 27 Jan 2024 23:19:43 +0200 Subject: [PATCH 113/119] Translate: fixed Yandex engine (#359) --- include/Translators/YandexTranslate.awk | 47 +++++++++++++------------ 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/include/Translators/YandexTranslate.awk b/include/Translators/YandexTranslate.awk index 64d50479..03b6f3bc 100644 --- a/include/Translators/YandexTranslate.awk +++ b/include/Translators/YandexTranslate.awk @@ -5,21 +5,15 @@ # Last Updated: 11 Aug 2018 BEGIN { provides("yandex") } -function genSID( content, group, temp) { - content = curl("http://translate.yandex.com") - - match(content, /SID:[[:space:]]*'([^']+)'/, group) - if (group[1]) { - split(group[1], temp, ".") - SID = reverse(temp[1]) "." reverse(temp[2]) "." reverse(temp[3]) - } else { - e("[ERROR] Oops! Something went wrong and I can't translate it for you :(") - exit 1 - } +function genUcid() { + "uuidgen" | getline uuid; + close("uuidgen"); + gsub("-", "", uuid); + ucid = tolower(uuid) } function yandexInit() { - genSID() # generate a one-time key + genUcid() # generate a one-time key YandexWebTranslate = "z5h64q92x9.net" # host for web translation HttpProtocol = "http://" @@ -27,19 +21,28 @@ function yandexInit() { HttpPort = 80 } -function yandexRequestUrl(text, sl, tl, hl, group) { +function yandexPostRequestUrl(text, sl, tl, hl, group) { # Quick hack: Yandex doesn't support digraphia code (yet) split(sl, group, "-"); sl = group[1] split(tl, group, "-"); tl = group[1] - return HttpPathPrefix "/api/v1/tr.json/translate?" \ - "id=" SID "-0-0&srv=tr-text" \ - "&text=" preprocess(text) "&lang=" (sl == "auto" ? tl : sl "-" tl) + return HttpPathPrefix "/api/v1/tr.json/translate" \ + "?ucid=" ucid \ + "&srv=android" \ + "&text=" preprocess(text) \ + "&lang=" (sl == "auto" ? tl : sl "-" tl) } function yandexPostRequestBody(text, sl, tl, hl, type) { - # type == "translit" - return "text=" quote(text) "&lang=" sl + return "" +} + +function yandexPostRequestContentType(text, sl, tl, hl, type) { + return "application/x-www-form-urlencoded" +} + +function yandexPostRequestUserAgent(text, sl, tl, hl, type) { + return "" } function yandexGetDictionaryResponse(text, sl, tl, hl, content, header, isBody, url) { @@ -131,7 +134,7 @@ function yandexTranslate(text, sl, tl, hl, _tl = getCode(tl); if (!_tl) _tl = tl _hl = getCode(hl); if (!_hl) _hl = hl - content = getResponse(text, _sl, _tl, _hl) + content = postResponse(text, _sl, _tl, _hl) if (Option["dump"]) return content tokenize(tokens, content) @@ -156,8 +159,7 @@ function yandexTranslate(text, sl, tl, hl, # Transliteration wShowTranslationPhonetics = Option["show-translation-phonetics"] if (wShowTranslationPhonetics && _tl != "emj") { - split(_tl, group, "-") - data = yandexPostRequestBody(translation, group[1], group[1], _hl, "translit") + data = "text=" text "&lang=" tl content = curlPost("https://translate.yandex.net/translit/translit", data) phonetics = (content ~ /not supported$/) ? "" : unparameterize(content) } @@ -188,8 +190,7 @@ function yandexTranslate(text, sl, tl, hl, # Transliteration (original) wShowOriginalPhonetics = Option["show-original-phonetics"] if (wShowTranslationPhonetics && il != "emj") { - split(il, group, "-") - data = yandexPostRequestBody(text, group[1], group[1], _hl, "translit") + data = "text=" text "&lang=" sl content = curlPost("https://translate.yandex.net/translit/translit", data) oPhonetics = (content ~ /not supported$/) ? "" : unparameterize(content) } From 4473645fcfcdf57b01680b5bb48a6b56fd7e5f80 Mon Sep 17 00:00:00 2001 From: Mort Yao Date: Wed, 11 Dec 2024 00:49:27 +0100 Subject: [PATCH 114/119] update workflow (actions/checkout@v4) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 331a7921..2460517b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - name: Install dependencies run: | sudo apt-get update From d6c8d7bc5736232d6925634b333e50511001d9db Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Aug 2025 11:31:50 +0300 Subject: [PATCH 115/119] Add language and engine completions --- translate-shell | 62 ++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/translate-shell b/translate-shell index ca704981..e016cbd8 100644 --- a/translate-shell +++ b/translate-shell @@ -1,17 +1,57 @@ +_complete_option() { + COMPREPLY=($(compgen -W "$(trans -help -no-ansi \ + | awk '{\ + for (i = 1; i <= NF; i++) {\ + if (index($i, "-") == 1) {\ + sub(/[,\.]$/, "", $i);\ + print $i\ + }\ + }\ + }')" -- "$cur")) +} + +_complete_engine() { + COMPREPLY=($(compgen -W "$(trans -list-engines | awk '{ print gensub(/ |\*/, "", "g") }')" -- "$cur")) +} + +_complete_language() { + COMPREPLY=($(compgen -W "$(trans -list-codes; trans -list-languages; trans -list-languages-english | sort)" -- "$cur")) +} + +_has_language_delimiter() { + case "$cur" in + *[:=]*) + true + ;; + *) + false + ;; + esac +} + _translate() { COMPREPLY=() - cur=`_get_cword` + cur="$(_get_cword)" + prev="${COMP_WORDS[COMP_CWORD-1]}" - if [ $COMP_CWORD -eq 1 ]; then - COMPREPLY=($(compgen -W "$(trans -help -no-ansi \ - | awk '{\ - for (i = 1; i <= NF; i++) {\ - if (index($i, "-") == 1) {\ - sub(/[,\.]$/, "", $i);\ - print $i\ - }\ - }\ - }')" -- "$cur")) + if [ "${prev:0:1}" = "-" ]; then + case "$prev" in + -s|-sl|-source|-from|-t|-tl|-target|-to) + _complete_language + ;; + -e|-engine) + _complete_engine + ;; + esac + elif [ "${cur:0:1}" = "-" ]; then + _complete_option + # Complete shorcut formatted languages. + elif _has_language_delimiter; then + # Remove first language and/or delimiter. + cur="${cur/*[:=]/}" + _complete_language + else + _complete_language fi return 0 From 7ba54f1f5d17dff26fc1cc79289688a9101cd66f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Aug 2025 11:32:48 +0300 Subject: [PATCH 116/119] Rename file --- translate-shell => translate-shell.bash | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translate-shell => translate-shell.bash (100%) diff --git a/translate-shell b/translate-shell.bash similarity index 100% rename from translate-shell rename to translate-shell.bash From 9e599a255a7eefaca534b13005ff3908cef9a2e8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Aug 2025 15:06:28 +0300 Subject: [PATCH 117/119] Add support for multiple target languages --- translate-shell.bash | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/translate-shell.bash b/translate-shell.bash index e016cbd8..a0a1fe95 100644 --- a/translate-shell.bash +++ b/translate-shell.bash @@ -15,6 +15,13 @@ _complete_engine() { } _complete_language() { + local multiple="$1" + if [ "$multiple" ]; then + # Without this '+' and whatever precedes it, is removed from the command line. + COMP_WORDBREAKS+=+ + cur="${cur//*+/}" + fi + COMPREPLY=($(compgen -W "$(trans -list-codes; trans -list-languages; trans -list-languages-english | sort)" -- "$cur")) } @@ -31,13 +38,18 @@ _has_language_delimiter() { _translate() { COMPREPLY=() + # Remove '+'s if they are added to this variable in _complete_language(). Maybe not needed? + COMP_WORDBREAKS="${COMP_WORDBREAKS//+/}" cur="$(_get_cword)" prev="${COMP_WORDS[COMP_CWORD-1]}" if [ "${prev:0:1}" = "-" ]; then case "$prev" in - -s|-sl|-source|-from|-t|-tl|-target|-to) - _complete_language + -s|-sl|-source|-from) + _complete_language false + ;; + -t|-tl|-target|-to) + _complete_language true ;; -e|-engine) _complete_engine @@ -47,11 +59,11 @@ _translate() { _complete_option # Complete shorcut formatted languages. elif _has_language_delimiter; then - # Remove first language and/or delimiter. + # Remove first language and/or delimiter from cur. cur="${cur/*[:=]/}" - _complete_language + _complete_language true else - _complete_language + _complete_language true fi return 0 From 96ddaad975022511f891d8a7ed94b7dffceaabea Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 1 Aug 2025 15:08:27 +0300 Subject: [PATCH 118/119] Add completion script to Makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ed5eda4d..495db3d7 100644 --- a/Makefile +++ b/Makefile @@ -36,8 +36,10 @@ install: build install $(BUILDDIR)/$(COMMAND) $(DESTDIR)$(PREFIX)/bin/$(COMMAND) &&\ mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1 &&\ install $(MANDIR)/$(COMMAND).1 $(DESTDIR)$(PREFIX)/share/man/man1/$(COMMAND).1 &&\ + mkdir -p $(DESTDIR)$(PREFIX)/etc/bash_completion.d &&\ + install translate-shell.bash $(DESTDIR)$(PREFIX)/etc/bash_completion.d &&\ echo "[OK] $(NAME) installed." uninstall: - @rm $(DESTDIR)$(PREFIX)/bin/$(COMMAND) $(DESTDIR)$(PREFIX)/share/man/man1/$(COMMAND).1 &&\ + @rm $(DESTDIR)$(PREFIX)/bin/$(COMMAND) $(DESTDIR)$(PREFIX)/share/man/man1/$(COMMAND).1 $(DESTDIR)$(PREFIX)/etc/bash_completion.d/translate-shell.bash &&\ echo "[OK] $(NAME) uninstalled." From ae45f104f3dd0581132058cd152b1719f9bf8667 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 2 Aug 2025 10:51:44 +0300 Subject: [PATCH 119/119] Add home language and linguist option completion --- translate-shell.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translate-shell.bash b/translate-shell.bash index a0a1fe95..5c250103 100644 --- a/translate-shell.bash +++ b/translate-shell.bash @@ -45,10 +45,10 @@ _translate() { if [ "${prev:0:1}" = "-" ]; then case "$prev" in - -s|-sl|-source|-from) + -s|-sl|-source|-from|-hl|-host) _complete_language false ;; - -t|-tl|-target|-to) + -t|-tl|-target|-to|-L|-linguist) _complete_language true ;; -e|-engine)