forked from kisom/ctrans
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
37 lines (26 loc) · 1.06 KB
/
README
File metadata and controls
37 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ctrans.py
---------
very crude source code comment translator. powered by google translate.
currently handles C-style and scripting-style (i.e. '#') comments; note that
comments formatted as '### comment' will still end up as '# comment', this
is a bug i don't care about fixing atm; i'm more concerned with just getting
this working.
USAGE:
ctrans.py -s <filename>
translates a single file
ctrans.py -d <dir>
translates all source files in a directory
other flags:
-e set input file encoding
-o set output file encoding
-t set trace (debugging output)
DECODE/ENCODE NOTES:
the default encoding and decoding is utf-8. specifying 'auto' for the
decoding will attempt to guess the file's encoding. this is at best a guess,
and at worst completely wrong.
encoding is not a trivial matter, and there are a million ways a file might
be encoded.
TODO:
* add directory-translating mode
* add support for multiline C comment
* verify code is clean, was hacked together in a hurry