easy_translate 0.1 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -13,34 +13,22 @@ module EasyTranslate
13
13
  API_TRANSLATE_PATH = '/ajax/services/language/translate'
14
14
  API_DETECT_PATH = '/ajax/services/language/detect'
15
15
  API_VERSION = '1.0'
16
-
17
- LANGUAGES = { 'tr' => 'turkish', 'sv' => 'swedish', 'km' => 'khmer',
18
- 'mk' => 'macedonian', 'chr' => 'cherokee', 'si' => 'sinhalese',
19
- 'zh-cn' => 'chinese_simplified', 'fi' => 'finnish', 'lo' => 'laothian',
20
- 'da' => 'danish', 'th' => 'thai', 'sk' => 'slovak', 'sq' => 'albanian',
21
- 'ms' => 'malay', 'no' => 'norwegian', '' => 'unknown', 'cy' => 'welsh',
22
- 'be' => 'belarusian', 'am' => 'amharic', 'ca' => 'catalan',
23
- 'zh' => 'chinese', 'id' => 'indonesian', 'ta' => 'tamil',
24
- 'fa' => 'persian', 'zh-tw' => 'chinese_traditional', 'uz' => 'uzbek',
25
- 'sw' => 'swahili', 'ja' => 'japanese', 'kk' => 'kazakh',
26
- 'gl' => 'galician', 'ps' => 'pashto', 'lv' => 'latvian', 'te' => 'telugu',
27
- 'sa' => 'sanskrit', 'kn' => 'kannada', 'af' => 'afrikaans',
28
- 'ka' => 'georgian', 'it' => 'italian', 'mr' => 'marathi', 'ug' => 'uighur',
29
- 'ro' => 'romanian', 'nl' => 'dutch', 'gu' => 'gujarati',
30
- 'eo' => 'esperanto', 'uk' => 'ukrainian', 'ru' => 'russian',
31
- 'ky' => 'kyrgyz', 'ga' => 'irish', 'tl' => 'tagalog', 'sr' => 'serbian',
32
- 'pa' => 'punjabi', 'mt' => 'maltese', 'ne' => 'nepali', 'or' => 'oriya',
33
- 'eu' => 'basque', 'dv' => 'dhivehi', 'sl' => 'slovenian',
34
- 'pl' => 'polish', 'el' => 'greek', 'ku' => 'kurdish', 'de' => 'german',
35
- 'iw' => 'hebrew', 'sd' => 'sindhi', 'et' => 'estonian', 'gn' => 'guarani',
36
- 'is' => 'icelandic', 'bn' => 'bengali', 'tl' => 'filipino',
37
- 'bo' => 'tibetan', 'es' => 'spanish', 'fr' => 'french',
38
- 'hy' => 'armenian', 'bg' => 'bulgarian', 'lt' => 'lithuanian',
39
- 'mn' => 'mongolian', 'az' => 'azerbaijani', 'yi' => 'yiddish',
40
- 'ur' => 'urdu', 'en' => 'english', 'pt-pt' => 'portuguese',
41
- 'vi' => 'vietnamese', 'ml' => 'malayalam', 'ar' => 'arabic',
42
- 'bh' => 'bihari', 'iu' => 'inuktitut', 'my' => 'burmese',
43
- 'hu' => 'hungarian', 'ko' => 'korean', 'tg' => 'tajik', 'cs' => 'czech',
44
- 'hi' => 'hindi', 'hr' => 'croatian' }
16
+
17
+ LANGUAGES = { 'af' => 'afrikaans', 'sq' => 'albanian', 'ar' => 'arabic',
18
+ 'hy' => 'armenian', 'az' => 'azerbaijani', 'eu' => 'basque', 'be' => 'belarusian',
19
+ 'bg' => 'bulgarian', 'ca' => 'catalan', 'zh-CN' => 'chinese_simplified',
20
+ 'zh-TW' => 'chinese_traditional', 'hr' => 'croatian', 'cs' => 'czech',
21
+ 'da' => 'danish', 'nl' => 'dutch', 'en' => 'english', 'et' => 'estonian',
22
+ 'tl' => 'filipino', 'fi' => 'finnish', 'fr' => 'french', 'gl' => 'galician',
23
+ 'ka' => 'georgian', 'de' => 'german', 'el' => 'greek', 'ht' => 'haitian_creole',
24
+ 'iw' => 'hebrew', 'hi' => 'hindi', 'hu' => 'hungarian', 'is' => 'icelandic',
25
+ 'id' => 'indonesian', 'ga' => 'irish', 'it' => 'italian', 'ja' => 'japanese',
26
+ 'ko' => 'korean', 'lv' => 'latvian', 'lt' => 'lithuanian', 'mk' => 'macedonian',
27
+ 'ms' => 'malay', 'mt' => 'maltese', 'no' => 'norwegian', 'fa' => 'persian',
28
+ 'pl' => 'polish', 'pt' => 'portuguese', 'ro' => 'romanian', 'ru' => 'russian',
29
+ 'sr' => 'serbian', 'sk' => 'slovak', 'sl' => 'slovenian', 'es' => 'spanish',
30
+ 'sw' => 'swahili', 'sv' => 'swedish', 'th' => 'thai', 'tr' => 'turkish',
31
+ 'uk' => 'ukrainian', 'ur' => 'urdu', 'vi' => 'vietnamese', 'cy' => 'welsh',
32
+ 'yi' => 'yiddish' }
45
33
 
46
34
  end
@@ -141,6 +141,7 @@ module EasyTranslate
141
141
  # a function used to get the lang code of any input.
142
142
  # can take -- :english, 'english', :en, 'en'
143
143
  def self.get_language(lang)
144
+ return unless lang
144
145
  lang = lang.to_s
145
146
  lang = EasyTranslate::LANGUAGES.include?(lang) ? lang : EasyTranslate::LANGUAGES.index(lang)
146
147
  raise ArgumentError.new('please supply a valid language') unless lang
@@ -1,5 +1,5 @@
1
1
  module EasyTranslate
2
2
 
3
- VERSION = '0.1'
3
+ VERSION = '0.1.1'
4
4
 
5
5
  end
metadata CHANGED
@@ -5,7 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- version: "0.1"
8
+ - 1
9
+ version: 0.1.1
9
10
  platform: ruby
10
11
  authors:
11
12
  - John Crepezzi