easy_translate 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/easy_translate.rb +56 -19
- data/lib/easy_translate/translator.rb +1 -1
- data/lib/easy_translate/version.rb +1 -1
- metadata +5 -5
data/lib/easy_translate.rb
CHANGED
@@ -12,24 +12,61 @@ module EasyTranslate
|
|
12
12
|
API_URL = 'ajax.googleapis.com'
|
13
13
|
API_TRANSLATE_PATH = '/ajax/services/language/translate'
|
14
14
|
API_DETECT_PATH = '/ajax/services/language/detect'
|
15
|
-
API_VERSION = '
|
15
|
+
API_VERSION = '2.0'
|
16
16
|
|
17
|
-
LANGUAGES = {
|
18
|
-
|
19
|
-
'
|
20
|
-
'
|
21
|
-
'
|
22
|
-
'
|
23
|
-
'
|
24
|
-
'
|
25
|
-
'
|
26
|
-
'
|
27
|
-
'
|
28
|
-
'
|
29
|
-
'
|
30
|
-
'
|
31
|
-
'
|
32
|
-
'
|
33
|
-
'
|
34
|
-
|
17
|
+
LANGUAGES = {
|
18
|
+
'af' => 'afrikaans',
|
19
|
+
'sq' => 'albanian',
|
20
|
+
'ar' => 'arabic',
|
21
|
+
'be' => 'belarusian',
|
22
|
+
'bg' => 'bulgarian',
|
23
|
+
'ca' => 'catalan',
|
24
|
+
'zh-CN' => 'chinese_simplified',
|
25
|
+
'zh-TW' => 'chinese_traditional',
|
26
|
+
'hr' => 'croatian',
|
27
|
+
'cs' => 'czech',
|
28
|
+
'da' => 'danish',
|
29
|
+
'nl' => 'dutch',
|
30
|
+
'en' => 'english',
|
31
|
+
'et' => 'estonian',
|
32
|
+
'tl' => 'filipino',
|
33
|
+
'fi' => 'finnish',
|
34
|
+
'fr' => 'french',
|
35
|
+
'gl' => 'galician',
|
36
|
+
'de' => 'german',
|
37
|
+
'el' => 'greek',
|
38
|
+
'ht' => 'haitian_creole',
|
39
|
+
'iw' => 'hebrew',
|
40
|
+
'hi' => 'hindi',
|
41
|
+
'hu' => 'hungarian',
|
42
|
+
'is' => 'icelandic',
|
43
|
+
'id' => 'indonesian',
|
44
|
+
'ga' => 'irish',
|
45
|
+
'it' => 'italian',
|
46
|
+
'ja' => 'japanese',
|
47
|
+
'lv' => 'latvian',
|
48
|
+
'lt' => 'lithuanian',
|
49
|
+
'mk' => 'macedonian',
|
50
|
+
'ms' => 'malay',
|
51
|
+
'mt' => 'maltese',
|
52
|
+
'no' => 'norwegian',
|
53
|
+
'fa' => 'persian',
|
54
|
+
'pl' => 'polish',
|
55
|
+
'pt' => 'portuguese',
|
56
|
+
'ro' => 'romanian',
|
57
|
+
'ru' => 'russian',
|
58
|
+
'sr' => 'serbian',
|
59
|
+
'sk' => 'slovak',
|
60
|
+
'sl' => 'slovenian',
|
61
|
+
'es' => 'spanish',
|
62
|
+
'sw' => 'swahili',
|
63
|
+
'sv' => 'swedish',
|
64
|
+
'th' => 'thai',
|
65
|
+
'tr' => 'turkish',
|
66
|
+
'uk' => 'ukrainian',
|
67
|
+
'vi' => 'vietnamese',
|
68
|
+
'cy' => 'welsh',
|
69
|
+
'yi' => 'yiddish'
|
70
|
+
}
|
71
|
+
|
35
72
|
end
|
@@ -143,7 +143,7 @@ module EasyTranslate
|
|
143
143
|
|
144
144
|
def self.index_func
|
145
145
|
return @index_func if @index_func
|
146
|
-
|
146
|
+
Hash.instance_methods.include?(:key) ? :key : :index
|
147
147
|
end
|
148
148
|
|
149
149
|
# a function used to get the lang code of any input.
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- John Crepezzi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-01-31 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|