We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1888432 commit 144da55Copy full SHA for 144da55
1 file changed
.bin/translate_email.sh
@@ -0,0 +1,16 @@
1
+# Usage:
2
+# echo "salut" | translate_email.sh
3
+
4
+# Read from stdio
5
+email="$(cat -)"
6
7
+# Assume plain text email
8
+content="$email"
9
10
+# Convert from HTML email to Markdown
11
+if grep -qi "<html" <<< "$email"; then
12
+ content="$(echo "$email" | pandoc --strip-comments --from=html --to=gfm-raw_html+pipe_tables+autolink_bare_uris)"
13
+fi
14
15
+# Translate
16
+echo "$content" | trans --show-original n -b -no-autocorrect
0 commit comments