-
Notifications
You must be signed in to change notification settings - Fork 391
Yes, and no.
No because Translate Shell is not designed as a library. Since it does not rely on any Google API key, its quota can be very limited. This is sufficient for reasonable personal use (for example, looking up words or helping you translate articles), however, it might be not enough for building your own application (and doing so may infringe Google's terms of service).
Yes if you want to write a desktop / editor plugin or some text filter to automatize your translation tasks locally.
Of course you did. The default behavior is to await standard input, unless the program found something to translate.
If you have already given input to the program but it took too long to respond, check your network status.
(As of today, China is blocking all Google services through its national firewall system. You may use the -proxy
option or set the environment variable HTTP_PROXY
to specify an HTTP proxy, or call Translate Shell using proxychains.)
In principle, please don't.
In most cases, empty output is caused by network issues, which can be very hard to reproduce and diagnose on other networks/machines. There is also a possibility that your IP range has been blocked temporarily. Please try with different networks/IP addresses if you encounter this issue.
There is a limitation on the length of each translation. As a general suggestion, don't try to do everything in one hit. Split your text into sentences or short lines, and translate one at a time.
My terminal does not support ANSI escape sequences and the display looks like a mess. How do I disable them?
Translate Shell uses ANSI escape sequences to render colors and other fancy effects for display. You can disable them easily by using the option -no-ansi
, specifying theme as none -theme=none
, or faking to the program that your terminal is of dumb type TERM=dumb trans
.
Please install the FriBidi package.
By default, home language is set to the language of your current locale (i.e. environment variable LC_ALL
or LANG
). It will affect the display in verbose mode. If you are comfortable with your current locale (for example, en_US.UTF-8
), just leave it as it is.
If no target language is specified, text will be translated into the language of your current locale.
See wiki: Languages for details.
A language code is used to exclusively identify a language. Most languages supported by Google Translate have ISO 639-1 codes (two-letter codes); a few languages supported by Google Translate, must be identified using ISO 639-2 codes (three-letter codes) due to the lack of ISO 639-1 codes.
The ISO 639-1 code of the Chinese language is zh
; however, an uppercase region code must be appended to distinguish two of its writing systems (zh-CN
for Simplified Chinese, used in China and Singapore; zh-TW
for Traditional Chinese, used in Taiwan and Hong Kong). zh
is an alias of zh-CN
.
Many languages other than Chinese, also have multiple writing systems (scripts) in use. Google Translate supports only one script for each of these languages.
- Belarusian (
be
): Cyrillic alphabet - Bosnian (
bs
): Latin alphabet - Hausa (
ha
): Latin alphabet - Javanese (
jv
orjw
): Latin alphabet - Kazakh (
kk
): Cyrillic alphabet - Mongolian (
mn
): Cyrillic alphabet - Punjabi (
pa
): Gurmukhī alphabet - Serbian (
sr
): Cyrillic alphabet - Sundanese (
su
): Latin alphabet - Tajik (
tg
): Cyrillic alphabet - Uzbek (
uz
): Latin alphabet
See wiki: Writing Systems and Fonts for details.
Right-to-left (RTL) languages are those languages which make use of right-to-left writing systems, i.e., languages written from right to left. Some languages supported by Google Translate are RTL languages.
- Arabic (
ar
): Arabic alphabet - Persian (
fa
): Arabic alphabet - Hebrew (
he
oriw
): Hebrew alphabet - Urdu (
ur
): Arabic alphabet - Yiddish (
yi
orji
): Hebrew alphabet
In order to display bi-directional text correctly for these languages, GNU FriBidi, which implements the Unicode bidirectional algorithm, should be used.