-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
86 lines (56 loc) · 2.23 KB
/
README
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
= Translate
Translate provides an easy to translate word or expression into another,
using wordreference. This website does'nt provide API yet so I decided
to create this script which make GET requests and parse results using Hpricot.
Default translation is english to french but it can be overriden by
providing command line options or config file.
Translate can be used directly in command line or inside an other program.
== Installation
=== Gem installation
Download and install translate with the following:
gem install wrtranslate
=== Common installation
Checkout the source code on github: git clone git://github.com/fuse/translate.git
# ruby install.rb
It will ask you where you want to install the translate library and binary in
your path.
_Warning_:
Be carefull to *NOT* install translate with the both way.
== Usage
=== From command line
translate world
Will translate world from english to french.
translate casa -f it -t en
Will translate casa from italian to english.
If you want to know which language can be used :
translate -l
If you want to know all options of translate :
translate -h
=== From another program
You only have to create a new instance or the translation class by giving
the expression to translate and your options and explicitly call translate.
translation = Translation.new("maison", { :from => :fr, :to => :en, :more => true })
translation.translate
Results are directly available through translation.items
=== Setup default options
If you don't want to retype options each time you're using translate, just
create a yaml config file into your home named translate.yml using this syntax :
translate:
from: fr
to: en
width: 100
more: true
Priority is given to command line options, config file options and finally
default options.
== Licence
Translate is available under MIT-LICENSE.
= Other
Author: Martin Catty <[email protected]>
License: Copyright 2008 by Martin Catty.
Released under an MIT-style licence. See the LICENCE file
included in the distribution.
== Warranty
This software is provided "as is" and without any express or
implied warranties, including, without limitation, the implied
warranties of merchantibility and fitness for a particular
purpose.