Two translation tools under the command line: SDCV & Translate-shell

Source: Internet
Author: User

Now open the browser has a variety of relevant plug-ins available, take word translation, etc. at your fingertips, but in the command line to browse the information encountered when the new words copied to the online search, one back more annoying, so found two tools, introduce it separately:

SDCV After installation because of the lack of dictionaries, and can not be used directly, to http://download.huzheng.org/to download, personal recommendations LANGDAO-EC-GB LANGDAO-CE-GB dreye4in1

After decompression, put to ~/stardict/dic/ , such as SDCV Hello will show the explanation of Hello, separate input SDCV will start interactive mode,

The ~/.sdcv_ordering file can specify the dictionary lookup order, and the- u option can also specify a dictionary for the lookup.

If SDCV cannot find the given word, it attempts to blur the match, and the-e option forces an exact lookup.

SDCV also supports paging, specified by the environment variable $SDCV _pager , and the --color option can highlight the output, my settings are as follows:

Alias dts= ' Sdcv-e--color '

Export sdcv_pager= ' less-i-r-m '

SDCV itself is not many options, manuals are better understood, in more detail see man.

Translate-shell is a command-line front end for Google Translate , which is available after installation using the trans command, and here are some important options:

Trans exports ANSI escape by default, so when you see something strange, you first use -no-ansi to close the escape character, which is later said.

The trans interface uses the same language as the terminal, and the- l option can be modified.

- s and- T respectively control the source language and target language, that is, "translate s language into T language" meaning, the shorthand form is [Source]:[target],

For example, En:zh is representative of English to Chinese, : zh means automatic detection of source language and translation into Chinese,

The source language is automatically detected when you omit source,

When you omit target, all languages will be translated into English (after all, aliens speak English ...),

- t to list supported languages,- l can query for more detailed information.

The program uses the Google translation engine by default and- s can list all supported engines and then- e to select them.

Trans itself prefers a large segment of translation, and the- d option can be used as a normal dictionary,

By default, the program uses -verbose to output a lot of content, and the- B option can streamline the output, but some are too thin for dictionary queries.

To translate the file, you can use the-i option.

Trans also supports paging, which is initiated by- v , and -pager is used to specify the pager, which mentions the issue of ANSI escaping.

As with many programs, escaping can highlight output, but be aware that the pager also supports escaping. My options are as follows:

Alias gts= ' trans-t zh-cn-l zh-cn-d-v-pager "Less-i-r-m"-no-play--'

Trans has many options and more content to meet the Man manual page.

Two software each has pros and cons, trans is actually a network search, to ensure the timeliness, but the corresponding need to have a network, slower,

But more importantly, as said earlier, trans is more inclined to full-text translation, if only a simple look-up dictionary, personal feeling no sdcv good,

Coupled with the domestic network environment, all understand ...

And SDCV does not need the network, the local query speed faster, take to look up the dictionary more handy.

Two software can be used to complement the use of it.

Two translation tools under the command line: SDCV & Translate-shell

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.