Skip to content
Mort Yao edited this page Oct 15, 2022 · 7 revisions

A configuration file ("initialization script") can be put into one of the following paths:

  • .trans under the current working directory;
  • ~/.translate-shell/init.trans under user's home directory;
  • $XDG_CONFIG_HOME/translate-shell/init.trans (or default: ~/.config/translate-shell/init.trans) under user's home directory;
  • /etc/translate-shell (system-wide).

A sample init.trans file:

(using brief mode, English as host/interface language, translating to Chinese)

{
 :translate-shell "0.9.0"
 :verbose         false
 :hl              "en"
 :tl              "zh"
}

Another sample:

(using verbose mode, not showing original text, using 2-space indentation, viewing in a terminal pager, English as host language, translating to German and French via Bing Translator with a customized user-agent string)

{
 :translate-shell "0.9.0"
 :verbose         true
 :show-original   false
 :indent          2
 :view            true
 :hl              "en"
 :tl              ["de" "fr"]
 :engine          "bing"
 :user-agent      "Mozilla/5.0 (X11; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0"
}
Clone this wiki locally