Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:latest
MAINTAINER soimort

RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories
RUN echo "https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories

RUN apk add bash gawk curl mplayer fribidi less hunspell wget \
&& wget git.io/trans \
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
For more information, please refer to <https://unlicense.org/>
138 changes: 69 additions & 69 deletions README.md

Large diffs are not rendered by default.

24 changes: 12 additions & 12 deletions README.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,29 +61,29 @@ In order to be happy, the best way is to be loved by people.
### Dependencies

* **[GNU Awk](https://www.gnu.org/software/gawk/)** (**gawk**) **4.0 or later**
* This program relies heavily on GNU extensions of the [AWK language](http://en.wikipedia.org/wiki/AWK), which are non-portable for other AWK implementations (e.g. nawk).
* This program relies heavily on GNU extensions of the [AWK language](https://en.wikipedia.org/wiki/AWK), which are non-portable for other AWK implementations (e.g. nawk).
* How to get gawk:
* 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/)**
* **[GNU Bash](https://www.gnu.org/software/bash/)** or **[Zsh](https://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.

### Recommended Dependencies

These dependencies are optional, but strongly recommended for full functionality:

* **[curl](http://curl.haxx.se/)** with **OpenSSL** support
* **[curl](https://curl.se/)** with **OpenSSL** support
* **[GNU FriBidi](http://fribidi.org/)**: _an implementation of the Unicode Bidirectional Algorithm (bidi)_
* required for displaying text in Right-to-Left scripts (e.g. Arabic, Hebrew)
* **[mplayer](http://www.mplayerhq.hu/)**, **[mpv](http://mpv.io/)**, **[mpg123](http://mpg123.org/)**, or **[eSpeak](http://espeak.sourceforge.net/)**
* **[mplayer](http://www.mplayerhq.hu/)**, **[mpv](https://mpv.io/)**, **[mpg123](https://mpg123.org/)**, or **[eSpeak](https://espeak.sourceforge.net/)**
* required for the Text-to-Speech functionality
* **[less](http://www.greenwoodsoftware.com/less/)**, **[more](http://pubs.opengroup.org/onlinepubs/9699919799/utilities/more.html)** or **[most](http://www.jedsoft.org/most/)**
* **[less](https://www.greenwoodsoftware.com/less/)**, **[more](https://pubs.opengroup.org/onlinepubs/9699919799/utilities/more.html)** or **[most](https://www.jedsoft.org/most/)**
* required for terminal paging
* **[rlwrap](http://utopia.knoware.nl/~hlub/uck/rlwrap/#rlwrap)**: *a GNU readline wrapper*
* **[rlwrap](https://github.com/hanslub42/rlwrap)**: *a GNU readline wrapper*
* required for readline-style editing and history in the interactive shell
* **[aspell](http://aspell.net/)** or **[hunspell](http://hunspell.github.io/)**
* **[aspell](http://aspell.net/)** or **[hunspell](https://hunspell.github.io/)**
* required for spell checking

### Environment and Fonts
Expand Down Expand Up @@ -114,7 +114,7 @@ Then you may start an interactive shell from the Docker image for translating:

### Option #1. Direct Download

Download [the self-contained executable](http://git.io/trans) and place it into your path. It's everything you need.
Download [the self-contained executable](https://git.io/trans) and place it into your path. It's everything you need.

$ wget git.io/trans
$ chmod +x ./trans
Expand Down Expand Up @@ -279,7 +279,7 @@ Sometimes the content of translation can be too much for display in one screen.

### Right-to-Left (RTL) Languages

[Right-to-Left (RTL) languages](http://en.wikipedia.org/wiki/Right-to-left) are well supported via [GNU FriBidi](http://fribidi.org/).
[Right-to-Left (RTL) languages](https://en.wikipedia.org/wiki/Right-to-left) are well supported via [GNU FriBidi](http://fribidi.org/).

The program will automatically adjust the screen width for padding when displaying right-to-left languages. Alternatively, you may use the `-width` (`-w`) option to specify the screen width:

Expand All @@ -300,7 +300,7 @@ Translations are written to standard output, or to the file specified by the `-o

### Translate a File

Instead of using the `-input` option, a [file URI scheme](http://en.wikipedia.org/wiki/File_URI_scheme) (`file://` followed by the file name) can be used as a command-line argument:
Instead of using the `-input` option, a [file URI scheme](https://en.wikipedia.org/wiki/File_URI_scheme) (`file://` followed by the file name) can be used as a command-line argument:

$ trans :fr file://input.txt

Expand All @@ -310,11 +310,11 @@ Instead of using the `-input` option, a [file URI scheme](http://en.wikipedia.or

To translate a web page, an http(s) URI scheme can be used as an argument:

$ trans :fr http://www.w3.org/
$ trans :fr https://www.w3.org/

A browser session will open for viewing the translation (via Google Translate's web interface). To specify your web browser of choice, use the `-browser` option:

$ trans -browser firefox :fr http://www.w3.org/
$ trans -browser firefox :fr https://www.w3.org/

### Language Details

Expand Down
8 changes: 4 additions & 4 deletions build.awk
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function readme( code, col, cols, content, group, i, iso, j, num, r, rows, te
split(getISO(cols[j][i]), group, "-")
iso = group[1]

r = r "**[" getName(cols[j][i]) "](" "http://en.wikipedia.org/wiki/ISO_639:" iso \
r = r "**[" getName(cols[j][i]) "](" "https://en.wikipedia.org/wiki/ISO_639:" iso \
")** <br/> **" getEndonym(cols[j][i]) "** | **`" cols[j][i] "`** | "
}
r = r RS
Expand All @@ -106,7 +106,7 @@ function wiki( code, group, iso, language, saveSortedIn) {
print "*Generated from the source code of Translate Shell " Version ".*\n" > WikiLanguages
print "*Version: [English](https://github.com/soimort/translate-shell/wiki/Languages) " \
"| [Chinese Simplified](https://github.com/soimort/translate-shell/wiki/Languages-%28%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%29)*\n" > WikiLanguages
print "| Code | Name | Family | [Writing system](https://github.com/soimort/translate-shell/wiki/Writing-Systems-and-Fonts) | Is [RTL](http://en.wikipedia.org/wiki/Right-to-left)? | Has dictionary? |" > WikiLanguages
print "| Code | Name | Family | [Writing system](https://github.com/soimort/translate-shell/wiki/Writing-Systems-and-Fonts) | Is [RTL](https://en.wikipedia.org/wiki/Right-to-left)? | Has dictionary? |" > WikiLanguages
print "| :--: | ---: | -----: | :------------: | :---------------------------------------------------: | :-------------: |" > WikiLanguages
saveSortedIn = PROCINFO["sorted_in"]
PROCINFO["sorted_in"] = "@ind_num_asc"
Expand All @@ -121,8 +121,8 @@ function wiki( code, group, iso, language, saveSortedIn) {
#language = length(group) == 1 ? group[1] "_language" :
# group[2] ~ /^\(.*\)$/ ? group[1] "_language" : join(group, "_")
print sprintf("| **`%s`** <br/> [`%s`](%s) | **[%s](%s)** <br/> **%s** | %s | `%s` | %s | %s |",
getCode(code), iso, "http://www.ethnologue.com/language/" iso,
getName(code), "http://en.wikipedia.org/wiki/ISO_639:" iso, getEndonym(code),
getCode(code), iso, "https://www.ethnologue.com/language/" iso,
getName(code), "https://en.wikipedia.org/wiki/ISO_639:" iso, getEndonym(code),
getFamily(code), getScript(code),
isRTL(code) ? "✓" : NULLSTR,
hasDictionary(code) ? "✓" : NULLSTR) > WikiLanguages
Expand Down
4 changes: 2 additions & 2 deletions include/LanguageData.awk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# See: <https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>
# <https://en.wikipedia.org/wiki/List_of_ISO_639-2_codes>
# <https://en.wikipedia.org/wiki/ISO_15924#List_of_codes>
# <http://glottolog.org/>
# <https://glottolog.org/>
function initLocale() {

# Afrikaans
Expand Down Expand Up @@ -2787,7 +2787,7 @@ function initLocaleAlias( i) {
}

# Other aliases
# See: <http://www.loc.gov/standards/iso639-2/php/code_changes.php>
# See: <https://www.loc.gov/standards/iso639-2/php/code_changes.php>
LocaleAlias["in"] = "id" # withdrawn language code for Indonesian
LocaleAlias["iw"] = "he" # withdrawn language code for Hebrew
LocaleAlias["ji"] = "yi" # withdrawn language code for Yiddish
Expand Down
2 changes: 1 addition & 1 deletion include/LanguageHelper.awk
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function compName(i1, v1, i2, v2) {

# Return the name of script (writing system).
# See: <https://en.wikipedia.org/wiki/ISO_15924#List_of_codes>
# <http://unicode.org/iso15924/iso15924-codes.html>
# <https://unicode.org/iso15924/iso15924-codes.html>
function scriptName(code) {
switch (code) {
case "Arab": return "Arabic"
Expand Down
2 changes: 1 addition & 1 deletion include/REPL.awk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function prompt( i, p, temp) {
# Roughly following ISO 8601:1988, with the notable exception of "%S", "%t" and "%T".
# GNU libc extensions like "%l", "%s" and "%_*" are not supported.
# See: <https://www.gnu.org/software/gawk/manual/html_node/Time-Functions.html>
# <http://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html>
# <https://pubs.opengroup.org/onlinepubs/007908799/xsh/strftime.html>
if (p ~ /%a/) gsub(/%a/, strftime("%a"), p)
if (p ~ /%A/) gsub(/%A/, strftime("%A"), p)
if (p ~ /%b/) gsub(/%b/, strftime("%b"), p)
Expand Down
4 changes: 2 additions & 2 deletions include/Translators/YandexTranslate.awk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BEGIN { provides("yandex") }

function genSID( content, group, temp) {
content = curl("http://translate.yandex.com")
content = curl("https://translate.yandex.com")

match(content, /SID:[[:space:]]*'([^']+)'/, group)
if (group[1]) {
Expand Down Expand Up @@ -47,7 +47,7 @@ function yandexGetDictionaryResponse(text, sl, tl, hl, content, header, isBod
split(sl, group, "-"); sl = group[1]
split(tl, group, "-"); tl = group[1]

url = "http://dictionary.yandex.net/dicservice.json/lookupMultiple?" \
url = "https://dictionary.yandex.net/dicservice.json/lookupMultiple?" \
"&text=" preprocess(text) "&dict=" sl "-" tl
content = curl(url) # but why?!

Expand Down