git clone https://github.com/christc4/lang-tools.git

Jump to: README.md cn.tpl


README.md

1# lang-tools
2
3## Dependencies
4
5[translate-shell](//github.com/soimort/translate-shell)
6
7> *NOTE*: to prevent ANSI escape sequences in terminal output you can use the built in `no-ansi` flag or pipe output into awk
8
9> Example: `% trans :en "$post_arg_searching_query1" | awk '{gsub(/\x1b\[[0-9;]*m/,"")}1'`
10
11### chinese
12
13#### Dependencies
14
15[pinyin-tool](https://github.com/briankung/pinyin-tool)

cn.tpl

1<h2>Pinyin</h2>
2<div>
3	<form action="" method="POST" enctype="multipart/form-data">
4	<input type="search" name="pinyin_query" placeholder="Type 中文…" required>
5	<input type="checkbox" id="search_this_directory" name="search_app_search_directory" value="search_app_search_directory">
6	<label for="search_this_directory">Generate HTML <code>ruby</code>?</label><br>
7	<input type="submit" value="Get pinyin">
8	</form>
9</div> 
10
11% if (! ~ $"post_arg_pinyin_query '') { 
12
13%	pinyin=`{echo $post_arg_pinyin_query | pinyin-tool}
14	<p>%($"pinyin%)
15% } 
16
17<br>
18
19% if(! ~ $#post_arg_search_app_search_directory 0){
20
21	<pre>
22%	echo '<ruby>'$post_arg_pinyin_query'<rt>'$pinyin'</rt></ruby>' | escape_html
23	</pre>
24
25% }
26
27<h2>Chinese to English</h2>
28<div>
29	<form action="" method="POST" enctype="multipart/form-data">
30	<input type="search" name="searching_query1" placeholder="δΈ­ζ–‡ to EN" required>
31	<input type="submit" value="Translate">
32	</form>
33</div> 
34
35% if (! ~ $"post_arg_searching_query1 '') { 
36	<pre>
37%		trans -no-ansi :en "$post_arg_searching_query1" 
38	</pre>
39% } 
40
41<h2>English to Chinese</h2>
42<div>
43	<form action="" method="POST" enctype="multipart/form-data">
44	<input type="search" name="searching_query2" placeholder="EN to δΈ­ζ–‡" required>
45	<input type="submit" value="Translate">
46	</form>
47</div> 
48
49% if (! ~ $"post_arg_searching_query2 '') { 
50	<pre>
51%		trans -no-ansi :zh "$post_arg_searching_query2" 
52	</pre>
53% }