sermoa-ruby_translate 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +23 -0
- data/README +41 -0
- metadata +3 -1
data/MIT-LICENSE
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
Copyright (c) 2009 Aimee Daniells
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
23
|
+
|
data/README
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
RubyTranslate provides a simple wrapper around the Google Translate API for detecting and translating languages.
|
2
|
+
|
3
|
+
Usage:
|
4
|
+
|
5
|
+
gem install sermoa-ruby_translate
|
6
|
+
require 'ruby_translate'
|
7
|
+
|
8
|
+
Detect:
|
9
|
+
|
10
|
+
RubyTranslate.detect("Mein Luftkissenfahrzeug ist voller Aale")
|
11
|
+
=> "de"
|
12
|
+
|
13
|
+
RubyTranslate.detect("Safisha viatu yangu mara moja!")
|
14
|
+
=> "sw"
|
15
|
+
|
16
|
+
Translate:
|
17
|
+
|
18
|
+
RubyTranslate.translate("Mein Luftkissenfahrzeug ist voller Aale", "en")
|
19
|
+
=> "My hovercraft is full of eels"
|
20
|
+
|
21
|
+
RubyTranslate.translate("Il y a un singe qui vole dans l'arbre.", "en")
|
22
|
+
=> "There is a flying monkey in the tree."
|
23
|
+
|
24
|
+
RubyTranslate.translate("They are singing in St Peter's Square", "it")
|
25
|
+
=> "Essi sono il canto, in Piazza San Pietro"
|
26
|
+
|
27
|
+
RubyTranslate.translate("Eu queria um outro pedacinho de Apfelstrudel, por favor", "sv", "pt")
|
28
|
+
=> "Jag ville ha en bit av Apfelstrudel, tack"
|
29
|
+
|
30
|
+
Note that the 'from' parameter is optional - if you do not provide it, RubyTranslate first uses detect to guess which language it is.
|
31
|
+
|
32
|
+
Acknowledgements:
|
33
|
+
|
34
|
+
Thanks to the following excellent sources for inspiration:
|
35
|
+
|
36
|
+
* http://ruby.geraldbauer.ca/google-translation-api.html
|
37
|
+
* http://github.com/elisehuard/google_translate/tree/master
|
38
|
+
* http://github.com/sishen/rtranslate/tree/master
|
39
|
+
* http://www.omniglot.com/language/phrases/hovercraft.htm
|
40
|
+
* http://www.omniglot.com/language/phrases/useful.htm
|
41
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sermoa-ruby_translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aimee Daniells
|
@@ -31,6 +31,8 @@ extensions: []
|
|
31
31
|
extra_rdoc_files: []
|
32
32
|
|
33
33
|
files:
|
34
|
+
- README
|
35
|
+
- MIT-LICENSE
|
34
36
|
- lib/ruby_translate.rb
|
35
37
|
has_rdoc: true
|
36
38
|
homepage: http://www.edendevelopment.co.uk
|