Hello community, here is the log from the commit of package translate-shell for openSUSE:Factory checked in at 2018-08-22 14:20:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/translate-shell (Old) and /work/SRC/openSUSE:Factory/.translate-shell.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "translate-shell" Wed Aug 22 14:20:11 2018 rev:13 rq:630735 version:0.9.6.8 Changes: -------- --- /work/SRC/openSUSE:Factory/translate-shell/translate-shell.changes 2018-05-01 23:34:26.408935177 +0200 +++ /work/SRC/openSUSE:Factory/.translate-shell.new/translate-shell.changes 2018-08-22 14:20:49.638419074 +0200 @@ -1,0 +2,8 @@ +Tue Aug 21 09:12:54 UTC 2018 - idon...@suse.com + +- Update to version 0.9.6.8 + * Fixed engine support: DeepL, Bing TTS + * New languages (Yandex only): Emoji + * Close command pipelines everywhere + +------------------------------------------------------------------- Old: ---- translate-shell-0.9.6.7.tar.gz New: ---- translate-shell-0.9.6.8.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ translate-shell.spec ++++++ --- /var/tmp/diff_new_pack.8JMHGV/_old 2018-08-22 14:20:50.022419984 +0200 +++ /var/tmp/diff_new_pack.8JMHGV/_new 2018-08-22 14:20:50.026419993 +0200 @@ -17,7 +17,7 @@ Name: translate-shell -Version: 0.9.6.7 +Version: 0.9.6.8 Release: 0 Summary: Command line translator using various online services as backends License: Unlicense ++++++ translate-shell-0.9.6.7.tar.gz -> translate-shell-0.9.6.8.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/.circleci/config.yml new/translate-shell-0.9.6.8/.circleci/config.yml --- old/translate-shell-0.9.6.7/.circleci/config.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/translate-shell-0.9.6.8/.circleci/config.yml 2018-08-11 14:26:02.000000000 +0200 @@ -0,0 +1,20 @@ +version: 2 +jobs: + build: + environment: + LC_ALL: C.UTF-8 + LANG: C.UTF-8 + docker: + - image: debian:stretch + steps: + - checkout + - 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 + - run: + name: Sanity Check + command: | + make test diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/.travis.yml new/translate-shell-0.9.6.8/.travis.yml --- old/translate-shell-0.9.6.7/.travis.yml 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/.travis.yml 2018-08-11 14:26:02.000000000 +0200 @@ -1,11 +1,17 @@ os: - linux + - osx before_install: | - sudo add-apt-repository ppa:schot/gawk -y - sudo apt-get update -q - sudo apt-get install gawk - sudo apt-get install rlwrap - sudo apt-get install emacs + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo add-apt-repository ppa:schot/gawk -y; fi + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update -q; fi + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install gawk; fi + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install rlwrap; fi + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install emacs; fi + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install gawk; fi + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install rlwrap; fi + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install emacs; fi + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install bash; fi script: make check diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/Makefile new/translate-shell-0.9.6.8/Makefile --- old/translate-shell-0.9.6.7/Makefile 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/Makefile 2018-08-11 14:26:02.000000000 +0200 @@ -29,8 +29,8 @@ $(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' ] &&\ - [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e deepl Ninja`" = 'Ninja' ] + [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e yandex Ninja`" = 'Ninja' ] &&\ + [ "`$(BUILDDIR)/$(COMMAND) -no-init -D -b -e deepl -s en -t de hello`" = 'Hallo' ] install: build @mkdir -p $(DESTDIR)$(PREFIX)/bin &&\ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/README.md new/translate-shell-0.9.6.8/README.md --- old/translate-shell-0.9.6.7/README.md 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/README.md 2018-08-11 14:26:02.000000000 +0200 @@ -461,46 +461,47 @@ | Language | Code | Language | Code | Language | Code | | :------: | :--: | :------: | :--: | :------: | :--: | -| **[Afrikaans](http://en.wikipedia.org/wiki/Afrikaans_language)** <br/> **Afrikaans** | **`af`** | **[Hebrew](http://en.wikipedia.org/wiki/Hebrew_language)** <br/> **עִבְרִית** | **`he`** | **[Polish](http://en.wikipedia.org/wiki/Polish_language)** <br/> **Polski** | **`pl`** | -| **[Albanian](http://en.wikipedia.org/wiki/Albanian_language)** <br/> **Shqip** | **`sq`** | **[Hill Mari](http://en.wikipedia.org/wiki/Hill_Mari)** <br/> **Кырык мары** | **`mrj`** | **[Portuguese](http://en.wikipedia.org/wiki/Portuguese_language)** <br/> **Português** | **`pt`** | -| **[Amharic](http://en.wikipedia.org/wiki/Amharic_language)** <br/> **አማርኛ** | **`am`** | **[Hindi](http://en.wikipedia.org/wiki/Hindi_language)** <br/> **हिन्दी** | **`hi`** | **[Punjabi](http://en.wikipedia.org/wiki/Punjabi_language)** <br/> **ਪੰਜਾਬੀ** | **`pa`** | -| **[Arabic](http://en.wikipedia.org/wiki/Arabic_language)** <br/> **العربية** | **`ar`** | **[Hmong](http://en.wikipedia.org/wiki/Hmong_language)** <br/> **Hmoob** | **`hmn`** | **[Querétaro Otomi](http://en.wikipedia.org/wiki/Querétaro_Otomi)** <br/> **Hñąñho** | **`otq`** | -| **[Armenian](http://en.wikipedia.org/wiki/Armenian_language)** <br/> **Հայերեն** | **`hy`** | **[Hmong Daw](http://en.wikipedia.org/wiki/Hmong_Daw)** <br/> **Hmoob Daw** | **`mww`** | **[Romanian](http://en.wikipedia.org/wiki/Romanian_language)** <br/> **Română** | **`ro`** | -| **[Azerbaijani](http://en.wikipedia.org/wiki/Azerbaijani_language)** <br/> **Azərbaycanca** | **`az`** | **[Hungarian](http://en.wikipedia.org/wiki/Hungarian_language)** <br/> **Magyar** | **`hu`** | **[Russian](http://en.wikipedia.org/wiki/Russian_language)** <br/> **Русский** | **`ru`** | -| **[Bashkir](http://en.wikipedia.org/wiki/Bashkir_language)** <br/> **башҡорт теле** | **`ba`** | **[Icelandic](http://en.wikipedia.org/wiki/Icelandic_language)** <br/> **Íslenska** | **`is`** | **[Samoan](http://en.wikipedia.org/wiki/Samoan_language)** <br/> **Gagana Sāmoa** | **`sm`** | -| **[Basque](http://en.wikipedia.org/wiki/Basque_language)** <br/> **Euskara** | **`eu`** | **[Igbo](http://en.wikipedia.org/wiki/Igbo_language)** <br/> **Igbo** | **`ig`** | **[Scots Gaelic](http://en.wikipedia.org/wiki/Scots_Gaelic)** <br/> **Gàidhlig** | **`gd`** | -| **[Belarusian](http://en.wikipedia.org/wiki/Belarusian_language)** <br/> **беларуская** | **`be`** | **[Indonesian](http://en.wikipedia.org/wiki/Indonesian_language)** <br/> **Bahasa Indonesia** | **`id`** | **[Serbian (Cyrillic)](http://en.wikipedia.org/wiki/Serbian_(Cyrillic))** <br/> **српски** | **`sr-Cyrl`** | -| **[Bengali](http://en.wikipedia.org/wiki/Bengali_language)** <br/> **বাংলা** | **`bn`** | **[Irish](http://en.wikipedia.org/wiki/Irish_language)** <br/> **Gaeilge** | **`ga`** | **[Serbian (Latin)](http://en.wikipedia.org/wiki/Serbian_(Latin))** <br/> **srpski** | **`sr-Latn`** | -| **[Bosnian](http://en.wikipedia.org/wiki/Bosnian_language)** <br/> **Bosanski** | **`bs`** | **[Italian](http://en.wikipedia.org/wiki/Italian_language)** <br/> **Italiano** | **`it`** | **[Sesotho](http://en.wikipedia.org/wiki/Sesotho_language)** <br/> **Sesotho** | **`st`** | -| **[Bulgarian](http://en.wikipedia.org/wiki/Bulgarian_language)** <br/> **български** | **`bg`** | **[Japanese](http://en.wikipedia.org/wiki/Japanese_language)** <br/> **日本語** | **`ja`** | **[Shona](http://en.wikipedia.org/wiki/Shona_language)** <br/> **chiShona** | **`sn`** | -| **[Cantonese](http://en.wikipedia.org/wiki/Cantonese_language)** <br/> **粵語** | **`yue`** | **[Javanese](http://en.wikipedia.org/wiki/Javanese_language)** <br/> **Basa Jawa** | **`jv`** | **[Sindhi](http://en.wikipedia.org/wiki/Sindhi_language)** <br/> **سنڌي** | **`sd`** | -| **[Catalan](http://en.wikipedia.org/wiki/Catalan_language)** <br/> **Català** | **`ca`** | **[Kannada](http://en.wikipedia.org/wiki/Kannada_language)** <br/> **ಕನ್ನಡ** | **`kn`** | **[Sinhala](http://en.wikipedia.org/wiki/Sinhala_language)** <br/> **සිංහල** | **`si`** | -| **[Cebuano](http://en.wikipedia.org/wiki/Cebuano_language)** <br/> **Cebuano** | **`ceb`** | **[Kazakh](http://en.wikipedia.org/wiki/Kazakh_language)** <br/> **Қазақ тілі** | **`kk`** | **[Slovak](http://en.wikipedia.org/wiki/Slovak_language)** <br/> **Slovenčina** | **`sk`** | -| **[Chichewa](http://en.wikipedia.org/wiki/Chichewa_language)** <br/> **Nyanja** | **`ny`** | **[Khmer](http://en.wikipedia.org/wiki/Khmer_language)** <br/> **ភាសាខ្មែរ** | **`km`** | **[Slovenian](http://en.wikipedia.org/wiki/Slovenian_language)** <br/> **Slovenščina** | **`sl`** | -| **[Chinese Simplified](http://en.wikipedia.org/wiki/Chinese_Simplified)** <br/> **简体中文** | **`zh-CN`** | **[Klingon](http://en.wikipedia.org/wiki/Klingon_language)** <br/> **tlhIngan Hol** | **`tlh`** | **[Somali](http://en.wikipedia.org/wiki/Somali_language)** <br/> **Soomaali** | **`so`** | -| **[Chinese Traditional](http://en.wikipedia.org/wiki/Chinese_Traditional)** <br/> **正體中文** | **`zh-TW`** | **[Klingon (pIqaD)](http://en.wikipedia.org/wiki/Klingon_(pIqaD))** <br/> ** ** | **`tlh-Qaak`** | **[Spanish](http://en.wikipedia.org/wiki/Spanish_language)** <br/> **Español** | **`es`** | -| **[Corsican](http://en.wikipedia.org/wiki/Corsican_language)** <br/> **Corsu** | **`co`** | **[Korean](http://en.wikipedia.org/wiki/Korean_language)** <br/> **한국어** | **`ko`** | **[Sundanese](http://en.wikipedia.org/wiki/Sundanese_language)** <br/> **Basa Sunda** | **`su`** | -| **[Croatian](http://en.wikipedia.org/wiki/Croatian_language)** <br/> **Hrvatski** | **`hr`** | **[Kurdish](http://en.wikipedia.org/wiki/Kurdish_language)** <br/> **Kurdî** | **`ku`** | **[Swahili](http://en.wikipedia.org/wiki/Swahili_language)** <br/> **Kiswahili** | **`sw`** | -| **[Czech](http://en.wikipedia.org/wiki/Czech_language)** <br/> **Čeština** | **`cs`** | **[Kyrgyz](http://en.wikipedia.org/wiki/Kyrgyz_language)** <br/> **Кыргызча** | **`ky`** | **[Swedish](http://en.wikipedia.org/wiki/Swedish_language)** <br/> **Svenska** | **`sv`** | -| **[Danish](http://en.wikipedia.org/wiki/Danish_language)** <br/> **Dansk** | **`da`** | **[Lao](http://en.wikipedia.org/wiki/Lao_language)** <br/> **ລາວ** | **`lo`** | **[Tahitian](http://en.wikipedia.org/wiki/Tahitian_language)** <br/> **Reo Tahiti** | **`ty`** | -| **[Dutch](http://en.wikipedia.org/wiki/Dutch_language)** <br/> **Nederlands** | **`nl`** | **[Latin](http://en.wikipedia.org/wiki/Latin_language)** <br/> **Latina** | **`la`** | **[Tajik](http://en.wikipedia.org/wiki/Tajik_language)** <br/> **Тоҷикӣ** | **`tg`** | -| **[Eastern Mari](http://en.wikipedia.org/wiki/Eastern_Mari)** <br/> **Олык марий** | **`mhr`** | **[Latvian](http://en.wikipedia.org/wiki/Latvian_language)** <br/> **Latviešu** | **`lv`** | **[Tamil](http://en.wikipedia.org/wiki/Tamil_language)** <br/> **தமிழ்** | **`ta`** | -| **[English](http://en.wikipedia.org/wiki/English_language)** <br/> **English** | **`en`** | **[Lithuanian](http://en.wikipedia.org/wiki/Lithuanian_language)** <br/> **Lietuvių** | **`lt`** | **[Tatar](http://en.wikipedia.org/wiki/Tatar_language)** <br/> **татарча** | **`tt`** | -| **[Esperanto](http://en.wikipedia.org/wiki/Esperanto_language)** <br/> **Esperanto** | **`eo`** | **[Luxembourgish](http://en.wikipedia.org/wiki/Luxembourgish_language)** <br/> **Lëtzebuergesch** | **`lb`** | **[Telugu](http://en.wikipedia.org/wiki/Telugu_language)** <br/> **తెలుగు** | **`te`** | -| **[Estonian](http://en.wikipedia.org/wiki/Estonian_language)** <br/> **Eesti** | **`et`** | **[Macedonian](http://en.wikipedia.org/wiki/Macedonian_language)** <br/> **Македонски** | **`mk`** | **[Thai](http://en.wikipedia.org/wiki/Thai_language)** <br/> **ไทย** | **`th`** | -| **[Fijian](http://en.wikipedia.org/wiki/Fijian_language)** <br/> **Vosa Vakaviti** | **`fj`** | **[Malagasy](http://en.wikipedia.org/wiki/Malagasy_language)** <br/> **Malagasy** | **`mg`** | **[Tongan](http://en.wikipedia.org/wiki/Tongan_language)** <br/> **Lea faka-Tonga** | **`to`** | -| **[Filipino](http://en.wikipedia.org/wiki/Filipino_language)** <br/> **Tagalog** | **`tl`** | **[Malay](http://en.wikipedia.org/wiki/Malay_language)** <br/> **Bahasa Melayu** | **`ms`** | **[Turkish](http://en.wikipedia.org/wiki/Turkish_language)** <br/> **Türkçe** | **`tr`** | -| **[Finnish](http://en.wikipedia.org/wiki/Finnish_language)** <br/> **Suomi** | **`fi`** | **[Malayalam](http://en.wikipedia.org/wiki/Malayalam_language)** <br/> **മലയാളം** | **`ml`** | **[Udmurt](http://en.wikipedia.org/wiki/Udmurt_language)** <br/> **удмурт** | **`udm`** | -| **[French](http://en.wikipedia.org/wiki/French_language)** <br/> **Français** | **`fr`** | **[Maltese](http://en.wikipedia.org/wiki/Maltese_language)** <br/> **Malti** | **`mt`** | **[Ukrainian](http://en.wikipedia.org/wiki/Ukrainian_language)** <br/> **Українська** | **`uk`** | -| **[Frisian](http://en.wikipedia.org/wiki/Frisian_language)** <br/> **Frysk** | **`fy`** | **[Maori](http://en.wikipedia.org/wiki/Maori_language)** <br/> **Māori** | **`mi`** | **[Urdu](http://en.wikipedia.org/wiki/Urdu_language)** <br/> **اُردُو** | **`ur`** | -| **[Galician](http://en.wikipedia.org/wiki/Galician_language)** <br/> **Galego** | **`gl`** | **[Marathi](http://en.wikipedia.org/wiki/Marathi_language)** <br/> **मराठी** | **`mr`** | **[Uzbek](http://en.wikipedia.org/wiki/Uzbek_language)** <br/> **Oʻzbek tili** | **`uz`** | -| **[Georgian](http://en.wikipedia.org/wiki/Georgian_language)** <br/> **ქართული** | **`ka`** | **[Mongolian](http://en.wikipedia.org/wiki/Mongolian_language)** <br/> **Монгол** | **`mn`** | **[Vietnamese](http://en.wikipedia.org/wiki/Vietnamese_language)** <br/> **Tiếng Việt** | **`vi`** | -| **[German](http://en.wikipedia.org/wiki/German_language)** <br/> **Deutsch** | **`de`** | **[Myanmar](http://en.wikipedia.org/wiki/Myanmar_language)** <br/> **မြန်မာစာ** | **`my`** | **[Welsh](http://en.wikipedia.org/wiki/Welsh_language)** <br/> **Cymraeg** | **`cy`** | -| **[Greek](http://en.wikipedia.org/wiki/Greek_language)** <br/> **Ελληνικά** | **`el`** | **[Nepali](http://en.wikipedia.org/wiki/Nepali_language)** <br/> **नेपाली** | **`ne`** | **[Xhosa](http://en.wikipedia.org/wiki/Xhosa_language)** <br/> **isiXhosa** | **`xh`** | -| **[Gujarati](http://en.wikipedia.org/wiki/Gujarati_language)** <br/> **ગુજરાતી** | **`gu`** | **[Norwegian](http://en.wikipedia.org/wiki/Norwegian_language)** <br/> **Norsk** | **`no`** | **[Yiddish](http://en.wikipedia.org/wiki/Yiddish_language)** <br/> **ייִדיש** | **`yi`** | -| **[Haitian Creole](http://en.wikipedia.org/wiki/Haitian_Creole)** <br/> **Kreyòl Ayisyen** | **`ht`** | **[Papiamento](http://en.wikipedia.org/wiki/Papiamento_language)** <br/> **Papiamentu** | **`pap`** | **[Yoruba](http://en.wikipedia.org/wiki/Yoruba_language)** <br/> **Yorùbá** | **`yo`** | -| **[Hausa](http://en.wikipedia.org/wiki/Hausa_language)** <br/> **Hausa** | **`ha`** | **[Pashto](http://en.wikipedia.org/wiki/Pashto_language)** <br/> **پښتو** | **`ps`** | **[Yucatec Maya](http://en.wikipedia.org/wiki/Yucatec_Maya)** <br/> **Màaya T'àan** | **`yua`** | -| **[Hawaiian](http://en.wikipedia.org/wiki/Hawaiian_language)** <br/> **ʻŌlelo Hawaiʻi** | **`haw`** | **[Persian](http://en.wikipedia.org/wiki/Persian_language)** <br/> **فارسی** | **`fa`** | **[Zulu](http://en.wikipedia.org/wiki/Zulu_language)** <br/> **isiZulu** | **`zu`** | +| **[Afrikaans](http://en.wikipedia.org/wiki/Afrikaans_language)** <br/> **Afrikaans** | **`af`** | **[Hebrew](http://en.wikipedia.org/wiki/Hebrew_language)** <br/> **עִבְרִית** | **`he`** | **[Portuguese](http://en.wikipedia.org/wiki/Portuguese_language)** <br/> **Português** | **`pt`** | +| **[Albanian](http://en.wikipedia.org/wiki/Albanian_language)** <br/> **Shqip** | **`sq`** | **[Hill Mari](http://en.wikipedia.org/wiki/Hill_Mari)** <br/> **Кырык мары** | **`mrj`** | **[Punjabi](http://en.wikipedia.org/wiki/Punjabi_language)** <br/> **ਪੰਜਾਬੀ** | **`pa`** | +| **[Amharic](http://en.wikipedia.org/wiki/Amharic_language)** <br/> **አማርኛ** | **`am`** | **[Hindi](http://en.wikipedia.org/wiki/Hindi_language)** <br/> **हिन्दी** | **`hi`** | **[Querétaro Otomi](http://en.wikipedia.org/wiki/Querétaro_Otomi)** <br/> **Hñąñho** | **`otq`** | +| **[Arabic](http://en.wikipedia.org/wiki/Arabic_language)** <br/> **العربية** | **`ar`** | **[Hmong](http://en.wikipedia.org/wiki/Hmong_language)** <br/> **Hmoob** | **`hmn`** | **[Romanian](http://en.wikipedia.org/wiki/Romanian_language)** <br/> **Română** | **`ro`** | +| **[Armenian](http://en.wikipedia.org/wiki/Armenian_language)** <br/> **Հայերեն** | **`hy`** | **[Hmong Daw](http://en.wikipedia.org/wiki/Hmong_Daw)** <br/> **Hmoob Daw** | **`mww`** | **[Russian](http://en.wikipedia.org/wiki/Russian_language)** <br/> **Русский** | **`ru`** | +| **[Azerbaijani](http://en.wikipedia.org/wiki/Azerbaijani_language)** <br/> **Azərbaycanca** | **`az`** | **[Hungarian](http://en.wikipedia.org/wiki/Hungarian_language)** <br/> **Magyar** | **`hu`** | **[Samoan](http://en.wikipedia.org/wiki/Samoan_language)** <br/> **Gagana Sāmoa** | **`sm`** | +| **[Bashkir](http://en.wikipedia.org/wiki/Bashkir_language)** <br/> **башҡорт теле** | **`ba`** | **[Icelandic](http://en.wikipedia.org/wiki/Icelandic_language)** <br/> **Íslenska** | **`is`** | **[Scots Gaelic](http://en.wikipedia.org/wiki/Scots_Gaelic)** <br/> **Gàidhlig** | **`gd`** | +| **[Basque](http://en.wikipedia.org/wiki/Basque_language)** <br/> **Euskara** | **`eu`** | **[Igbo](http://en.wikipedia.org/wiki/Igbo_language)** <br/> **Igbo** | **`ig`** | **[Serbian (Cyrillic)](http://en.wikipedia.org/wiki/Serbian_(Cyrillic))** <br/> **српски** | **`sr-Cyrl`** | +| **[Belarusian](http://en.wikipedia.org/wiki/Belarusian_language)** <br/> **беларуская** | **`be`** | **[Indonesian](http://en.wikipedia.org/wiki/Indonesian_language)** <br/> **Bahasa Indonesia** | **`id`** | **[Serbian (Latin)](http://en.wikipedia.org/wiki/Serbian_(Latin))** <br/> **srpski** | **`sr-Latn`** | +| **[Bengali](http://en.wikipedia.org/wiki/Bengali_language)** <br/> **বাংলা** | **`bn`** | **[Irish](http://en.wikipedia.org/wiki/Irish_language)** <br/> **Gaeilge** | **`ga`** | **[Sesotho](http://en.wikipedia.org/wiki/Sesotho_language)** <br/> **Sesotho** | **`st`** | +| **[Bosnian](http://en.wikipedia.org/wiki/Bosnian_language)** <br/> **Bosanski** | **`bs`** | **[Italian](http://en.wikipedia.org/wiki/Italian_language)** <br/> **Italiano** | **`it`** | **[Shona](http://en.wikipedia.org/wiki/Shona_language)** <br/> **chiShona** | **`sn`** | +| **[Bulgarian](http://en.wikipedia.org/wiki/Bulgarian_language)** <br/> **български** | **`bg`** | **[Japanese](http://en.wikipedia.org/wiki/Japanese_language)** <br/> **日本語** | **`ja`** | **[Sindhi](http://en.wikipedia.org/wiki/Sindhi_language)** <br/> **سنڌي** | **`sd`** | +| **[Cantonese](http://en.wikipedia.org/wiki/Cantonese_language)** <br/> **粵語** | **`yue`** | **[Javanese](http://en.wikipedia.org/wiki/Javanese_language)** <br/> **Basa Jawa** | **`jv`** | **[Sinhala](http://en.wikipedia.org/wiki/Sinhala_language)** <br/> **සිංහල** | **`si`** | +| **[Catalan](http://en.wikipedia.org/wiki/Catalan_language)** <br/> **Català** | **`ca`** | **[Kannada](http://en.wikipedia.org/wiki/Kannada_language)** <br/> **ಕನ್ನಡ** | **`kn`** | **[Slovak](http://en.wikipedia.org/wiki/Slovak_language)** <br/> **Slovenčina** | **`sk`** | +| **[Cebuano](http://en.wikipedia.org/wiki/Cebuano_language)** <br/> **Cebuano** | **`ceb`** | **[Kazakh](http://en.wikipedia.org/wiki/Kazakh_language)** <br/> **Қазақ тілі** | **`kk`** | **[Slovenian](http://en.wikipedia.org/wiki/Slovenian_language)** <br/> **Slovenščina** | **`sl`** | +| **[Chichewa](http://en.wikipedia.org/wiki/Chichewa_language)** <br/> **Nyanja** | **`ny`** | **[Khmer](http://en.wikipedia.org/wiki/Khmer_language)** <br/> **ភាសាខ្មែរ** | **`km`** | **[Somali](http://en.wikipedia.org/wiki/Somali_language)** <br/> **Soomaali** | **`so`** | +| **[Chinese Simplified](http://en.wikipedia.org/wiki/Chinese_Simplified)** <br/> **简体中文** | **`zh-CN`** | **[Klingon](http://en.wikipedia.org/wiki/Klingon_language)** <br/> **tlhIngan Hol** | **`tlh`** | **[Spanish](http://en.wikipedia.org/wiki/Spanish_language)** <br/> **Español** | **`es`** | +| **[Chinese Traditional](http://en.wikipedia.org/wiki/Chinese_Traditional)** <br/> **正體中文** | **`zh-TW`** | **[Klingon (pIqaD)](http://en.wikipedia.org/wiki/Klingon_(pIqaD))** <br/> ** ** | **`tlh-Qaak`** | **[Sundanese](http://en.wikipedia.org/wiki/Sundanese_language)** <br/> **Basa Sunda** | **`su`** | +| **[Corsican](http://en.wikipedia.org/wiki/Corsican_language)** <br/> **Corsu** | **`co`** | **[Korean](http://en.wikipedia.org/wiki/Korean_language)** <br/> **한국어** | **`ko`** | **[Swahili](http://en.wikipedia.org/wiki/Swahili_language)** <br/> **Kiswahili** | **`sw`** | +| **[Croatian](http://en.wikipedia.org/wiki/Croatian_language)** <br/> **Hrvatski** | **`hr`** | **[Kurdish](http://en.wikipedia.org/wiki/Kurdish_language)** <br/> **Kurdî** | **`ku`** | **[Swedish](http://en.wikipedia.org/wiki/Swedish_language)** <br/> **Svenska** | **`sv`** | +| **[Czech](http://en.wikipedia.org/wiki/Czech_language)** <br/> **Čeština** | **`cs`** | **[Kyrgyz](http://en.wikipedia.org/wiki/Kyrgyz_language)** <br/> **Кыргызча** | **`ky`** | **[Tahitian](http://en.wikipedia.org/wiki/Tahitian_language)** <br/> **Reo Tahiti** | **`ty`** | +| **[Danish](http://en.wikipedia.org/wiki/Danish_language)** <br/> **Dansk** | **`da`** | **[Lao](http://en.wikipedia.org/wiki/Lao_language)** <br/> **ລາວ** | **`lo`** | **[Tajik](http://en.wikipedia.org/wiki/Tajik_language)** <br/> **Тоҷикӣ** | **`tg`** | +| **[Dutch](http://en.wikipedia.org/wiki/Dutch_language)** <br/> **Nederlands** | **`nl`** | **[Latin](http://en.wikipedia.org/wiki/Latin_language)** <br/> **Latina** | **`la`** | **[Tamil](http://en.wikipedia.org/wiki/Tamil_language)** <br/> **தமிழ்** | **`ta`** | +| **[Eastern Mari](http://en.wikipedia.org/wiki/Eastern_Mari)** <br/> **Олык марий** | **`mhr`** | **[Latvian](http://en.wikipedia.org/wiki/Latvian_language)** <br/> **Latviešu** | **`lv`** | **[Tatar](http://en.wikipedia.org/wiki/Tatar_language)** <br/> **татарча** | **`tt`** | +| **[Emoji](http://en.wikipedia.org/wiki/Emoji_language)** <br/> **Emoji** | **`emj`** | **[Lithuanian](http://en.wikipedia.org/wiki/Lithuanian_language)** <br/> **Lietuvių** | **`lt`** | **[Telugu](http://en.wikipedia.org/wiki/Telugu_language)** <br/> **తెలుగు** | **`te`** | +| **[English](http://en.wikipedia.org/wiki/English_language)** <br/> **English** | **`en`** | **[Luxembourgish](http://en.wikipedia.org/wiki/Luxembourgish_language)** <br/> **Lëtzebuergesch** | **`lb`** | **[Thai](http://en.wikipedia.org/wiki/Thai_language)** <br/> **ไทย** | **`th`** | +| **[Esperanto](http://en.wikipedia.org/wiki/Esperanto_language)** <br/> **Esperanto** | **`eo`** | **[Macedonian](http://en.wikipedia.org/wiki/Macedonian_language)** <br/> **Македонски** | **`mk`** | **[Tongan](http://en.wikipedia.org/wiki/Tongan_language)** <br/> **Lea faka-Tonga** | **`to`** | +| **[Estonian](http://en.wikipedia.org/wiki/Estonian_language)** <br/> **Eesti** | **`et`** | **[Malagasy](http://en.wikipedia.org/wiki/Malagasy_language)** <br/> **Malagasy** | **`mg`** | **[Turkish](http://en.wikipedia.org/wiki/Turkish_language)** <br/> **Türkçe** | **`tr`** | +| **[Fijian](http://en.wikipedia.org/wiki/Fijian_language)** <br/> **Vosa Vakaviti** | **`fj`** | **[Malay](http://en.wikipedia.org/wiki/Malay_language)** <br/> **Bahasa Melayu** | **`ms`** | **[Udmurt](http://en.wikipedia.org/wiki/Udmurt_language)** <br/> **удмурт** | **`udm`** | +| **[Filipino](http://en.wikipedia.org/wiki/Filipino_language)** <br/> **Tagalog** | **`tl`** | **[Malayalam](http://en.wikipedia.org/wiki/Malayalam_language)** <br/> **മലയാളം** | **`ml`** | **[Ukrainian](http://en.wikipedia.org/wiki/Ukrainian_language)** <br/> **Українська** | **`uk`** | +| **[Finnish](http://en.wikipedia.org/wiki/Finnish_language)** <br/> **Suomi** | **`fi`** | **[Maltese](http://en.wikipedia.org/wiki/Maltese_language)** <br/> **Malti** | **`mt`** | **[Urdu](http://en.wikipedia.org/wiki/Urdu_language)** <br/> **اُردُو** | **`ur`** | +| **[French](http://en.wikipedia.org/wiki/French_language)** <br/> **Français** | **`fr`** | **[Maori](http://en.wikipedia.org/wiki/Maori_language)** <br/> **Māori** | **`mi`** | **[Uzbek](http://en.wikipedia.org/wiki/Uzbek_language)** <br/> **Oʻzbek tili** | **`uz`** | +| **[Frisian](http://en.wikipedia.org/wiki/Frisian_language)** <br/> **Frysk** | **`fy`** | **[Marathi](http://en.wikipedia.org/wiki/Marathi_language)** <br/> **मराठी** | **`mr`** | **[Vietnamese](http://en.wikipedia.org/wiki/Vietnamese_language)** <br/> **Tiếng Việt** | **`vi`** | +| **[Galician](http://en.wikipedia.org/wiki/Galician_language)** <br/> **Galego** | **`gl`** | **[Mongolian](http://en.wikipedia.org/wiki/Mongolian_language)** <br/> **Монгол** | **`mn`** | **[Welsh](http://en.wikipedia.org/wiki/Welsh_language)** <br/> **Cymraeg** | **`cy`** | +| **[Georgian](http://en.wikipedia.org/wiki/Georgian_language)** <br/> **ქართული** | **`ka`** | **[Myanmar](http://en.wikipedia.org/wiki/Myanmar_language)** <br/> **မြန်မာစာ** | **`my`** | **[Xhosa](http://en.wikipedia.org/wiki/Xhosa_language)** <br/> **isiXhosa** | **`xh`** | +| **[German](http://en.wikipedia.org/wiki/German_language)** <br/> **Deutsch** | **`de`** | **[Nepali](http://en.wikipedia.org/wiki/Nepali_language)** <br/> **नेपाली** | **`ne`** | **[Yiddish](http://en.wikipedia.org/wiki/Yiddish_language)** <br/> **ייִדיש** | **`yi`** | +| **[Greek](http://en.wikipedia.org/wiki/Greek_language)** <br/> **Ελληνικά** | **`el`** | **[Norwegian](http://en.wikipedia.org/wiki/Norwegian_language)** <br/> **Norsk** | **`no`** | **[Yoruba](http://en.wikipedia.org/wiki/Yoruba_language)** <br/> **Yorùbá** | **`yo`** | +| **[Gujarati](http://en.wikipedia.org/wiki/Gujarati_language)** <br/> **ગુજરાતી** | **`gu`** | **[Papiamento](http://en.wikipedia.org/wiki/Papiamento_language)** <br/> **Papiamentu** | **`pap`** | **[Yucatec Maya](http://en.wikipedia.org/wiki/Yucatec_Maya)** <br/> **Màaya T'àan** | **`yua`** | +| **[Haitian Creole](http://en.wikipedia.org/wiki/Haitian_Creole)** <br/> **Kreyòl Ayisyen** | **`ht`** | **[Pashto](http://en.wikipedia.org/wiki/Pashto_language)** <br/> **پښتو** | **`ps`** | **[Zulu](http://en.wikipedia.org/wiki/Zulu_language)** <br/> **isiZulu** | **`zu`** | +| **[Hausa](http://en.wikipedia.org/wiki/Hausa_language)** <br/> **Hausa** | **`ha`** | **[Persian](http://en.wikipedia.org/wiki/Persian_language)** <br/> **فارسی** | **`fa`** | +| **[Hawaiian](http://en.wikipedia.org/wiki/Hawaiian_language)** <br/> **ʻŌlelo Hawaiʻi** | **`haw`** | **[Polish](http://en.wikipedia.org/wiki/Polish_language)** <br/> **Polski** | **`pl`** | ## Wiki diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Commons.awk new/translate-shell-0.9.6.8/include/Commons.awk --- old/translate-shell-0.9.6.7/include/Commons.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Commons.awk 2018-08-11 14:26:02.000000000 +0200 @@ -557,6 +557,7 @@ content = NULLSTR while ((command |& getline line) > 0) content = (content ? content "\n" : NULLSTR) line + close(command) return content } @@ -573,12 +574,15 @@ # Detect whether a program exists in path. # Return the name (or output) if the program call writes anything to stdout; # Otherwise, return a null string. -function detectProgram(prog, arg, returnOutput, temp) { - if (returnOutput) { - prog " " arg SUPERR | getline temp +function detectProgram(prog, arg, returnOutput, command, temp) { + command = prog " " arg SUPERR + command | getline temp + close(command) + if (returnOutput) return temp - } else - return (prog " " arg SUPERR | getline) ? prog : NULLSTR + if (temp) + return prog + return NULLSTR } # Return the HEAD revision if the current directory is a git repo; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Help.awk new/translate-shell-0.9.6.8/include/Help.awk --- old/translate-shell-0.9.6.7/include/Help.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Help.awk 2018-08-11 14:26:02.000000000 +0200 @@ -3,10 +3,10 @@ #################################################################### # Return version as a string. -function getVersion( build, gitHead, platform) { +function getVersion( build, gitHead) { initAudioPlayer() initPager() - platform = detectProgram("uname", "-s", 1) + Platform = Platform ? Platform : detectProgram("uname", "-s", 1) if (ENVIRON["TRANS_BUILD"]) build = "-" ENVIRON["TRANS_BUILD"] else { @@ -15,7 +15,7 @@ } return ansi("bold", sprintf("%-22s%s%s\n\n", Name, Version, build)) \ - sprintf("%-22s%s\n", "platform", platform) \ + sprintf("%-22s%s\n", "platform", Platform) \ sprintf("%-22s%s\n", "gawk (GNU Awk)", PROCINFO["version"]) \ sprintf("%s\n", FriBidi ? FriBidi : "fribidi (GNU FriBidi) [NOT INSTALLED]") \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Languages.awk new/translate-shell-0.9.6.8/include/Languages.awk --- old/translate-shell-0.9.6.7/include/Languages.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Languages.awk 2018-08-11 14:26:02.000000000 +0200 @@ -1816,6 +1816,11 @@ Locale["chr"]["glotto"] = "cher1273" Locale["chr"]["script"] = "Cher" + #? Emoji + Locale["emj"]["support"] = "yandex-only" + Locale["emj"]["name"] = "Emoji" + Locale["emj"]["endonym"] = "Emoji" + for (i in Locale) { # Initialize strings for displaying endonyms of locales Locale[i]["display"] = show(Locale[i]["endonym"], i) @@ -2035,14 +2040,16 @@ # 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, temp) { +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) - ("echo " parameterize(text) PIPE BiDiNoPad) | getline temp - else # non-RTL language, or FriBidi not installed + 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 } @@ -2054,15 +2061,17 @@ # Parameters: # code: ignore to apply bidirectional algorithm on every string # width: ignore to use default width for padding -function s(text, code, width, temp) { +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) - ("echo " parameterize(text) PIPE sprintf(BiDi, width)) | getline temp - else # non-RTL language, or FriBidi not installed + 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 } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Main.awk new/translate-shell-0.9.6.8/include/Main.awk --- old/translate-shell-0.9.6.7/include/Main.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Main.awk 2018-08-11 14:26:02.000000000 +0200 @@ -108,13 +108,15 @@ } # Miscellany initialization. -function initMisc( group, temp) { +function initMisc( command, group, temp) { # (Translate.awk) initHttpService() # Initialize screen width if not set if (!Option["width"] && detectProgram("tput", "-V")) { - "tput cols" SUPERR | getline temp + command = "tput cols" SUPERR + command | getline temp + close(commnad) Option["width"] = temp ? temp - 2 : 64 } @@ -160,9 +162,8 @@ # Initialize browser if (!Option["browser"]) { - "xdg-mime query default text/html" SUPERR | getline Option["browser"] - match(Option["browser"], "(.*).desktop$", group) - Option["browser"] = group[1] + Platform = detectProgram("uname", "-s", 1) + Option["browser"] = Platform == "Darwin" ? "open" : "xdg-open" } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Translate.awk new/translate-shell-0.9.6.8/include/Translate.awk --- old/translate-shell-0.9.6.7/include/Translate.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Translate.awk 2018-08-11 14:26:02.000000000 +0200 @@ -30,7 +30,7 @@ # Detect external audio player (mplayer, mpv, mpg123). function initAudioPlayer() { AudioPlayer = !system("mpv" SUPOUT SUPERR) ? - "mpv --loop-file=no" : + "mpv --no-config" : (!system("mplayer" SUPOUT SUPERR) ? "mplayer" : (!system("mpg123 --version" SUPOUT SUPERR) ? @@ -109,7 +109,7 @@ print header |& HttpService while ((HttpService |& getline) > 0) { if (isBody) - content = content ? content "\r\n" $0 : $0 + content = content ? content "\n" $0 : $0 else if (length($0) <= 1) isBody = 1 else { # interesting fields in header @@ -158,7 +158,7 @@ print (header "\r\n" reqBody) |& HttpService while ((HttpService |& getline) > 0) { if (isBody) - content = content ? content "\r\n" $0 : $0 + content = content ? content "\n" $0 : $0 else if (length($0) <= 1) isBody = 1 else { # interesting fields in header @@ -237,9 +237,10 @@ } # Start a browser session and translate a web page. -function webTranslation(uri, sl, tl, hl) { - system(Option["browser"] " " \ - parameterize(_WebTranslateUrl(uri, sl, tl, hl)) "&") +function webTranslation(uri, sl, tl, hl, temp) { + temp = _WebTranslateUrl(uri, sl, tl, hl) + if (temp) + system(Option["browser"] " " parameterize(temp) SUPOUT SUPERR) } # Translate the source text (into all target languages). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Translators/Apertium.awk new/translate-shell-0.9.6.8/include/Translators/Apertium.awk --- old/translate-shell-0.9.6.7/include/Translators/Apertium.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Translators/Apertium.awk 2018-08-11 14:26:02.000000000 +0200 @@ -65,7 +65,6 @@ return } - # FIXME: build a cache for recurring invocation of uprintf() translation = uprintf(unquote(unparameterize(ast[0 SUBSEP "responseData" SUBSEP "translatedText"]))) returnIl[0] = il = _sl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Translators/BingTranslator.awk new/translate-shell-0.9.6.8/include/Translators/BingTranslator.awk --- old/translate-shell-0.9.6.7/include/Translators/BingTranslator.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Translators/BingTranslator.awk 2018-08-11 14:26:02.000000000 +0200 @@ -2,7 +2,7 @@ # BingTranslator.awk # #################################################################### # -# Last Updated: 17 Mar 2018 +# Last Updated: 18 Mar 2018 BEGIN { provides("bing") } function bingInit() { @@ -30,7 +30,7 @@ cookie = cookie (cookie ? "; " : NULLSTR) group[1] } if (isBody) - content = content ? content "\r\n" $0 : $0 + content = content ? content "\n" $0 : $0 else if (length($0) <= 1) isBody = 1 else { # interesting fields in header @@ -94,21 +94,21 @@ else if (tl == "yue") ; else if (tl == "zh") tl = tl "-CN" - header = "GET " "/translator/api/language/Speak?" \ - "locale=" tl "&text=" preprocess(text) \ - "&gender=" gender "&media=audio/mp3" " HTTP/1.1\r\n" \ - "Host: " HttpHost "\r\n" \ + header = "GET " "/tspeak?&IG=" IG \ + "&language=" tl "&text=" preprocess(text) \ + "&options=" gender "&format=audio%2Fmp3" " HTTP/1.1\r\n" \ + "Host: " HttpHost "\r\n" \ "Connection: close\r\n" if (Option["user-agent"]) header = header "User-Agent: " Option["user-agent"] "\r\n" if (Cookie) - header = header "Cookie: " Cookie "\r\n" # must! + header = header "Cookie: " Cookie "\r\n" content = NULLSTR; isBody = 0 print header |& HttpService while ((HttpService |& getline) > 0) { if (isBody) - content = content ? content "\r\n" $0 : $0 + content = content ? content "\n" $0 : $0 else if (length($0) <= 1) isBody = 1 #l(sprintf("%4s bytes > %s", length($0), $0)) @@ -135,13 +135,13 @@ function bingPostRequestUrl(text, sl, tl, hl, type) { if (type == "translate") - return HttpPathPrefix "/ttranslate?&IG=" IG "&IID=translator.5032.2" + return HttpPathPrefix "/ttranslate?&IG=" IG else if (type == "translationlookup") - return HttpPathPrefix "/ttranslationlookup?&IG=" IG "&IID=translator.5032.2" + return HttpPathPrefix "/ttranslationlookup?&IG=" IG else if (type == "transliterate") - return HttpPathPrefix "/ttransliterate?&IG=" IG "&IID=translator.5032.1" + return HttpPathPrefix "/ttransliterate?&IG=" IG else # type == "detect" - return HttpPathPrefix "/tdetect?&IG=" IG "&IID=translator.5032.2" + return HttpPathPrefix "/tdetect?&IG=" IG } function bingPostRequestContentType(text, sl, tl, hl, type) { @@ -259,7 +259,7 @@ # Transliteration (original) wShowOriginalPhonetics = Option["show-original-phonetics"] if (wShowOriginalPhonetics) { - split(il, group, "-") + split(_sl, group, "-") content = postResponse(text, group[1], group[1], _hl, "transliterate") oPhonetics = unparameterize(content) if (oPhonetics == text) oPhonetics = "" @@ -272,9 +272,9 @@ # Display: original text & phonetics if (r) r = r RS RS r = r m("-- display original text") - r = r prettify("original", s(text, il)) + r = r prettify("original", s(text, _sl)) if (wShowOriginalPhonetics) - r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il)) + r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), _sl)) } if (wShowTranslation) { @@ -295,9 +295,9 @@ split(temp, group, /(%s|%S|%t|%T)/) r = r prettify("languages", group[1]) if (temp ~ /%s/) - r = r prettify("languages-sl", getDisplay(il)) + r = r prettify("languages-sl", getDisplay(_sl)) if (temp ~ /%S/) - r = r prettify("languages-sl", getName(il)) + r = r prettify("languages-sl", getName(_sl)) r = r prettify("languages", group[2]) if (temp ~ /%t/) r = r prettify("languages-tl", getDisplay(tl)) @@ -309,7 +309,7 @@ if (wShowDictionary && false) { # FIXME! # Dictionary API # Note: source language must be identified - dicContent = getResponse(text, il, _tl, _hl) + dicContent = getResponse(text, _sl, _tl, _hl) tokenize(dicTokens, dicContent) parseJson(dicAst, dicTokens) # FIXME: inefficient parser diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Translators/DeepLTranslator.awk new/translate-shell-0.9.6.8/include/Translators/DeepLTranslator.awk --- old/translate-shell-0.9.6.7/include/Translators/DeepLTranslator.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Translators/DeepLTranslator.awk 2018-08-11 14:26:02.000000000 +0200 @@ -2,12 +2,12 @@ # DeepLTranslator.awk # #################################################################### # -# Last Updated: 12 Dec 2017 +# Last Updated: 11 Aug 2018 BEGIN { provides("deepl") } function deeplInit() { HttpProtocol = "http://" - HttpHost = "www.deepl.com" + HttpHost = "www2.deepl.com" HttpPort = 80 } @@ -23,19 +23,35 @@ # Not implemented } -# Send an HTTP POST request and get response from DeepL Translator (via curl). -function deeplPost(text, sl, tl, hl, +# Send an HTTP POST request and get response from DeepL Translator (via curl) for splitting into sentences. +function deeplPostSplit(text, sl, tl, hl, #### content, data, url) { + data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_split_into_sentences\"," + data = data "\"params\":{\"texts\":[" parameterize(text, "\"") "]}}" + l(data) + url = "https://www2.deepl.com/jsonrpc" + content = curlPost(url, data) + return assert(content, "[ERROR] Null response.") +} + +# Send an HTTP POST request and get response from DeepL Translator (via curl). +function deeplPost(sentences, sl, tl, hl, + #### + content, data, i, url) { data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_handle_jobs\"," - data = data "\"params\":{\"jobs\":[{\"kind\":\"default\"," - data = data "\"raw_en_sentence\":" parameterize(text, "\"") "}]," + data = data "\"params\":{\"jobs\":[" + for (i in sentences) { + if (i > 0) data = data "," + data = data "{\"kind\":\"default\",\"raw_en_sentence\":" parameterize(sentences[i], "\"") "}" + } + data = data "]," data = data "\"lang\":{\"user_preferred_langs\":[\"" hl "\"]," data = data "\"source_lang_user_selected\":\"" sl "\"," data = data "\"target_lang\":\"" tl "\"}," data = data "\"priority\":1},\"id\":1}" l(data) - url = "https://www.deepl.com/jsonrpc" + url = "https://www2.deepl.com/jsonrpc" content = curlPost(url, data) return assert(content, "[ERROR] Null response.") } @@ -44,10 +60,10 @@ function deeplTranslate(text, sl, tl, hl, isVerbose, toSpeech, returnPlaylist, returnIl, #### - r, + r, i, j, k, lines, content, tokens, ast, _sl, _tl, _hl, il, - translation, translations, + sentences, translation, translations, wShowOriginal, wShowTranslation, wShowLanguages, wShowAlternatives, group, temp) { @@ -68,32 +84,53 @@ if (_tl != "auto") _tl = toupper(_tl) if (_hl != "auto") _hl = toupper(_hl) - content = deeplPost(text, _sl, _tl, _hl) - if (Option["dump"]) - return content - tokenize(tokens, content) - parseJson(ast, tokens) - - l(content, "content", 1, 1) - l(tokens, "tokens", 1, 0, 1) - l(ast, "ast") - if (!isarray(ast) || !anything(ast)) { - e("[ERROR] Oops! Something went wrong and I can't translate it for you :(") - ExitCode = 1 - return - } + split(text, lines, "\n") + for (k in lines) { + if (k > 1) translation = translation "\n" + + delete tokens; delete ast; delete sentences + + content = deeplPostSplit(lines[k], _sl, _tl, _hl) + tokenize(tokens, content) + parseJson(ast, tokens) + for (i in ast) { + if (i ~ "^0" SUBSEP "result" SUBSEP "splitted_texts" SUBSEP "[[:digit:]]+" SUBSEP "[[:digit:]]+") { + append(sentences, uprintf(unquote(unparameterize(ast[i])))) + } + } + content = deeplPost(sentences, _sl, _tl, _hl) + if (Option["dump"]) + return content + tokenize(tokens, content) + parseJson(ast, tokens) + + l(content, "content", 1, 1) + l(tokens, "tokens", 1, 0, 1) + l(ast, "ast") + if (!isarray(ast) || !anything(ast)) { + e("[ERROR] Oops! Something went wrong and I can't translate it for you :(") + ExitCode = 1 + return + } - saveSortedIn = PROCINFO["sorted_in"] - PROCINFO["sorted_in"] = "compareByIndexFields" - for (i in ast) { - if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP 0 SUBSEP "beams" SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") { - # FIXME: build a cache for recurring invocation of uprintf() - append(translations, uprintf(unquote(unparameterize(ast[i])))) + saveSortedIn = PROCINFO["sorted_in"] + PROCINFO["sorted_in"] = "compareByIndexFields" + j = 0 + for (i in ast) { + if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP "[[:digit:]]+" SUBSEP "beams" \ + SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") { + temp = uprintf(unquote(unparameterize(ast[i]))) + append(translations, temp) + } + if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP j SUBSEP "beams" \ + SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") { + translation = j > 0 ? translation " " temp : translation temp + j++ + } } + PROCINFO["sorted_in"] = saveSortedIn } - PROCINFO["sorted_in"] = saveSortedIn - translation = translations[0] returnIl[0] = il = tolower(unparameterize(ast[0 SUBSEP "result" SUBSEP "source_lang"])) if (Option["verbose"] < -1) return il diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Translators/SpellChecker.awk new/translate-shell-0.9.6.8/include/Translators/SpellChecker.awk --- old/translate-shell-0.9.6.7/include/Translators/SpellChecker.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Translators/SpellChecker.awk 2018-08-11 14:26:02.000000000 +0200 @@ -77,3 +77,31 @@ isVerbose, toSpeech, returnPlaylist, returnIl) { return spellTranslate(text, sl, tl, hl) } + +function spellTTSUrl(text, tl, narrator) { + e("[ERROR] Spell checker does not support TTS.") + ExitCode = 1 + return +} + +function aspellTTSUrl(text, tl, narrator) { + return spellTTSUrl(text, tl) +} + +function hunspellTTSUrl(text, tl, narrator) { + return spellTTSUrl(text, tl) +} + +function spellWebTranslateUrl(uri, sl, tl, hl) { + e("[ERROR] Spell checker does not support web translation.") + ExitCode = 1 + return +} + +function aspellWebTranslateUrl(uri, sl, tl, hl) { + return spellWebTranslateUrl(uri, sl, tl, hl) +} + +function hunspellWebTranslateUrl(uri, sl, tl, hl) { + return spellWebTranslateUrl(uri, sl, tl, hl) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Translators/YandexTranslate.awk new/translate-shell-0.9.6.8/include/Translators/YandexTranslate.awk --- old/translate-shell-0.9.6.7/include/Translators/YandexTranslate.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Translators/YandexTranslate.awk 2018-08-11 14:26:02.000000000 +0200 @@ -2,7 +2,7 @@ # YandexTranslate.awk # #################################################################### # -# Last Updated: 17 Mar 2018 +# Last Updated: 11 Aug 2018 BEGIN { provides("yandex") } function genSID( content, group, temp) { @@ -49,7 +49,7 @@ url = "http://dictionary.yandex.net/dicservice.json/lookupMultiple?" \ "&text=" preprocess(text) "&dict=" sl "-" tl - content = curl(url) + content = curl(url) # but why?! return assert(content, "[ERROR] Null response.") } @@ -155,7 +155,7 @@ # Transliteration wShowTranslationPhonetics = Option["show-translation-phonetics"] - if (wShowTranslationPhonetics) { + if (wShowTranslationPhonetics && _tl != "emj") { split(_tl, group, "-") data = yandexPostRequestBody(translation, group[1], group[1], _hl, "translit") content = curlPost("https://translate.yandex.net/translit/translit", data) @@ -187,7 +187,7 @@ # Transliteration (original) wShowOriginalPhonetics = Option["show-original-phonetics"] - if (wShowTranslationPhonetics) { + if (wShowTranslationPhonetics && il != "emj") { split(il, group, "-") data = yandexPostRequestBody(text, group[1], group[1], _hl, "translit") content = curlPost("https://translate.yandex.net/translit/translit", data) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/include/Utils.awk new/translate-shell-0.9.6.8/include/Utils.awk --- old/translate-shell-0.9.6.7/include/Utils.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/include/Utils.awk 2018-08-11 14:26:02.000000000 +0200 @@ -164,6 +164,7 @@ content = NULLSTR while ((command |& getline line) > 0) content = (content ? content "\n" : NULLSTR) line + close(command) return content } @@ -192,33 +193,37 @@ content = NULLSTR while ((command |& getline line) > 0) content = (content ? content "\n" : NULLSTR) line + close(command) return content } # Dump a Unicode string into a byte array. Return the length of the array. -# NOTE: can only be ran once for each text! Build a cache. function dump(text, group, command, temp) { # hexdump tricks: # (1) use -v (--no-squeezing) # (2) use "%u" (unsigned integers) command = "hexdump" " -v -e'1/1 \"%03u\" \" \"'" - ("echo " parameterize(text) PIPE command) | getline temp + command = "echo " parameterize(text) PIPE command + command | getline temp split(temp, group, " ") + close(command) return length(group) - 1 } # Base64 encode a string. -# NOTE: can only be ran once for each text! Build a cache. function base64(text, command, temp) { - command = "base64" - ("echo -n " parameterize(text) PIPE command) | getline temp + command = "echo -n " parameterize(text) PIPE "base64" + command = "bash -c " parameterize(command, "\"") + command | getline temp + close(command) return temp } # Print a Unicode-escaped string. (requires GNU Bash) -# NOTE: can only be ran once for each text! Build a cache. function uprintf(text, command, temp) { command = "echo -en " parameterize(text) - ("bash -c " parameterize(command, "\"")) | getline temp + command = "bash -c " parameterize(command, "\"") + command | getline temp + close(command) return temp } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/man/trans.1 new/translate-shell-0.9.6.8/man/trans.1 --- old/translate-shell-0.9.6.7/man/trans.1 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/man/trans.1 2018-08-11 14:26:02.000000000 +0200 @@ -1,6 +1,6 @@ -.\" Automatically generated by Pandoc 2.1.1 +.\" Automatically generated by Pandoc 2.2.3.2 .\" -.TH "TRANS" "1" "2018\-03\-17" "0.9.6.7" "" +.TH "TRANS" "1" "2018\-08\-11" "0.9.6.8" "" .hy .SH NAME .PP @@ -516,6 +516,9 @@ (current directory) .RS .RE +.SH FURTHER DOCUMENTATION +.PP +<https://github.com/soimort/translate-shell/wiki> .SH REPORTING BUGS .PP <https://github.com/soimort/translate-shell/issues> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/man/trans.1.md new/translate-shell-0.9.6.8/man/trans.1.md --- old/translate-shell-0.9.6.7/man/trans.1.md 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/man/trans.1.md 2018-08-11 14:26:02.000000000 +0200 @@ -1,6 +1,6 @@ -% TRANS(1) 0.9.6.7 +% TRANS(1) 0.9.6.8 % Mort Yao <soi@mort.ninja> -% 2018-03-17 +% 2018-08-11 # NAME @@ -319,6 +319,10 @@ *./.trans* : Initialization script. (current directory) +# FURTHER DOCUMENTATION + +<https://github.com/soimort/translate-shell/wiki> + # REPORTING BUGS <https://github.com/soimort/translate-shell/issues> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/man/trans.1.template.md new/translate-shell-0.9.6.8/man/trans.1.template.md --- old/translate-shell-0.9.6.7/man/trans.1.template.md 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/man/trans.1.template.md 2018-08-11 14:26:02.000000000 +0200 @@ -319,6 +319,10 @@ *./.trans* : Initialization script. (current directory) +# FURTHER DOCUMENTATION + +<https://github.com/soimort/translate-shell/wiki> + # REPORTING BUGS <https://github.com/soimort/translate-shell/issues> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/metainfo.awk new/translate-shell-0.9.6.8/metainfo.awk --- old/translate-shell-0.9.6.7/metainfo.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/metainfo.awk 2018-08-11 14:26:02.000000000 +0200 @@ -1,8 +1,8 @@ BEGIN { Name = "Translate Shell" Description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc." - Version = "0.9.6.7" - ReleaseDate = "2018-03-17" + Version = "0.9.6.8" + ReleaseDate = "2018-08-11" Command = "trans" EntryPoint = "translate.awk" EntryScript = "translate" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/translate-shell-0.9.6.7/test/TestUtils.awk new/translate-shell-0.9.6.8/test/TestUtils.awk --- old/translate-shell-0.9.6.7/test/TestUtils.awk 2018-03-17 18:15:05.000000000 +0100 +++ new/translate-shell-0.9.6.8/test/TestUtils.awk 2018-08-11 14:26:02.000000000 +0200 @@ -30,22 +30,24 @@ assertTrue(newerVersion("2", "1.9.9999")) } - T("curl()", 1) - { - delete tokens; delete ast - tokenize(tokens, curl("https://httpbin.org/get")) - parseJson(ast, tokens) - assertEqual(unparameterize(ast[0 SUBSEP "url"]), - "https://httpbin.org/get") - } - - T("curlPost()", 1) - { - delete tokens; delete ast - tokenize(tokens, curlPost("https://httpbin.org/post", "fizz=buzz")) - parseJson(ast, tokens) - assertEqual(unparameterize(ast[0 SUBSEP "url"]), - "https://httpbin.org/post") + if (yn(ENVIRON["NETWORK_ACCESS"])) { # if network access enabled + T("curl()", 1) + { + delete tokens; delete ast + tokenize(tokens, curl("https://httpbin.org/get")) + parseJson(ast, tokens) + assertEqual(unparameterize(ast[0 SUBSEP "url"]), + "https://httpbin.org/get") + } + + T("curlPost()", 1) + { + delete tokens; delete ast + tokenize(tokens, curlPost("https://httpbin.org/post", "fizz=buzz")) + parseJson(ast, tokens) + assertEqual(unparameterize(ast[0 SUBSEP "url"]), + "https://httpbin.org/post") + } } T("dump()", 3) @@ -68,6 +70,7 @@ T("uprintf", 1) { assertEqual(uprintf("Ma\\u00f1ana"), "Mañana") + assertEqual(uprintf("Ma\\u00f1ana"), "Mañana") } END_TEST()