active_translation 0.7.1 → 0.7.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1234e553819683f3b7d5f77a491a8a39e1c1aef7f5fdef19190e2f046c7debfd
4
- data.tar.gz: 5823014a65f7a39d1f3cf625f30ab1021d8cc6def7b655aa2f8b893419f56a5a
3
+ metadata.gz: 95d3e129763f16bedcfba3e7fdc8b2571650f1492609d78649f84789f1e85580
4
+ data.tar.gz: 2a46a6f9ab2f2fd145791db066954d705095357a854a98db0801dd3c4ffaab85
5
5
  SHA512:
6
- metadata.gz: b5c18a5c9df15dddbd68088de1e7ed409d354bd9097430f1294559606abb6b527311515bf59fef1b60fb912496cc5d952dc0e0cbe38c5fd453c7dbfd156183f9
7
- data.tar.gz: 37384c54c3d287811635d616cafac796200ebc86c856ee5d827a9c2fd3c9db137abf7dfb7724250c3870a4718b590ebd58945b11a68f3b1ff4f138819756c1e8
6
+ metadata.gz: ca396a230135fb092c5dfe8e3aa43dcef5efd734de459cce75d8da8b9e2783642f4d713c756dbd528873e5b2e48bd9109114c5ff4dcb2a12188d01ce0d3aca14
7
+ data.tar.gz: ceb3e4c83ef21ac1edbc03591ba07accb98e5aa1cb75f58f154d0cd674060d5650876f3d01b3d62cebf2f2a21fe2f760627048b8cfdbc42edfd44e7ca41af9bd
data/README.md CHANGED
@@ -1,3 +1,6 @@
1
+ [![Gem Version](https://badge.fury.io/rb/active_translation.svg)](https://badge.fury.io/rb/active_translation)
2
+
3
+
1
4
  # WARNING KLAXON WARNING
2
5
 
3
6
  🚨 ActiveTranslation is pre-1.0 🚨
@@ -11,8 +14,6 @@ If you find a bug or problem, please report it. If you have an idea for a new fe
11
14
 
12
15
  ActiveTranslation is a Rails plugin that lets you easily translate ActiveRecord models. With a single line added to that model, you can declare which columns, which locales, and what constraints to allow or prevent translation.
13
16
 
14
- ActiveTranslation was built at and is sponsored by [Talentronic](https://talentronic.com)
15
-
16
17
 
17
18
  ## How does this differ from internationalization (`I18n`)?
18
19
 
@@ -341,6 +342,7 @@ So if you use the for an EULA, make it a manual attribute or don't use ActiveTra
341
342
 
342
343
  ActiveTranslation doesn't redact any content. It assumes you would never send PII or financial data for translation. So... please don't.
343
344
 
345
+
344
346
  ## Testing
345
347
 
346
348
  Ideally, you do not need to write any tests for translations or how they behave, since ActiveTranslation tests itself.
@@ -31,7 +31,6 @@ module ActiveTranslation
31
31
 
32
32
  def parse_response(response)
33
33
  response.body.dig("data", "translations", 0, "translatedText")
34
- # CGI.unescapeHTML(translation) if translation.is_a?(String)
35
34
  end
36
35
 
37
36
  def token
@@ -1,3 +1,3 @@
1
1
  module ActiveTranslation
2
- VERSION = "0.7.1"
2
+ VERSION = "0.7.3"
3
3
  end
@@ -7,13 +7,23 @@ Next steps:
7
7
  1. Run migrations:
8
8
  rails db:migrate
9
9
 
10
- 2. Configure your Google Translation API key:
11
- # config/initializers/active_translation.rb
10
+ 2. Configure your Google Translation API at config/initializers/active_translation.rb:
12
11
  ActiveTranslation.configure do |config|
13
- config.google_api_key = ENV['GOOGLE_TRANSLATION_API_KEY']
12
+ config.project_id = ENV.fetch("GOOGLE_TRANSLATION_PROJECT_ID", :missing_google_translation_project_id)
13
+ config.private_key_id = ENV.fetch("GOOGLE_TRANSLATION_PRIVATE_KEY_ID", :missing_google_translation_private_key_id)
14
+ config.private_key = ENV.fetch("GOOGLE_TRANSLATION_PRIVATE_KEY", :missing_google_translation_private_key)
15
+ config.client_email = ENV.fetch("GOOGLE_TRANSLATION_CLIENT_EMAIL", :missing_google_translation_client_email)
16
+ config.client_id = ENV.fetch("GOOGLE_TRANSLATION_CLIENT_ID", :missing_google_translation_client_id)
17
+ config.client_x509_cert_url = ENV.fetch("GOOGLE_TRANSLATION_CLIENT_CERT_URL", :missing_google_translation_client_cert_url)
18
+
19
+ config.type = ENV.fetch("GOOGLE_TRANSLATION_TYPE", "service_account")
20
+ config.auth_uri = ENV.fetch("GOOGLE_TRANSLATION_AUTH_URI", "https://accounts.google.com/o/oauth2/auth")
21
+ config.token_uri = ENV.fetch("GOOGLE_TRANSLATION_TOKEN_URI", "https://oauth2.googleapis.com/token")
22
+ config.auth_provider_x509_cert_url = ENV.fetch("GOOGLE_TRANSLATION_AUTH_PROVIDER_CERT_URL", "https://www.googleapis.com/oauth2/v1/certs")
23
+ config.universe_domain = ENV.fetch("GOOGLE_TRANSLATION_UNIVERSE_DOMAIN", "googleapis.com")
14
24
  end
15
25
 
16
26
  3. Add to your models:
17
- translates :name, :description, into: [:es, :fr]
27
+ translates :name, :description, into: :all
18
28
 
19
29
  ===============================================================================
metadata CHANGED
@@ -1,10 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_translation
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.3
5
5
  platform: ruby
6
6
  authors:
7
- - Sean Hogge
7
+ - Talentronic
8
8
  bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
@@ -13,30 +13,42 @@ dependencies:
13
13
  name: rails
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - "~>"
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '7.0'
19
+ - - "<"
17
20
  - !ruby/object:Gem::Version
18
- version: '7'
21
+ version: '9'
19
22
  type: :runtime
20
23
  prerelease: false
21
24
  version_requirements: !ruby/object:Gem::Requirement
22
25
  requirements:
23
- - - "~>"
26
+ - - ">="
24
27
  - !ruby/object:Gem::Version
25
- version: '7'
28
+ version: '7.0'
29
+ - - "<"
30
+ - !ruby/object:Gem::Version
31
+ version: '9'
26
32
  - !ruby/object:Gem::Dependency
27
33
  name: activerecord
28
34
  requirement: !ruby/object:Gem::Requirement
29
35
  requirements:
30
- - - "~>"
36
+ - - ">="
37
+ - !ruby/object:Gem::Version
38
+ version: '7.0'
39
+ - - "<"
31
40
  - !ruby/object:Gem::Version
32
- version: '7'
41
+ version: '9'
33
42
  type: :runtime
34
43
  prerelease: false
35
44
  version_requirements: !ruby/object:Gem::Requirement
36
45
  requirements:
37
- - - "~>"
46
+ - - ">="
47
+ - !ruby/object:Gem::Version
48
+ version: '7.0'
49
+ - - "<"
38
50
  - !ruby/object:Gem::Version
39
- version: '7'
51
+ version: '9'
40
52
  - !ruby/object:Gem::Dependency
41
53
  name: faraday
42
54
  requirement: !ruby/object:Gem::Requirement
@@ -44,6 +56,9 @@ dependencies:
44
56
  - - "~>"
45
57
  - !ruby/object:Gem::Version
46
58
  version: '2.0'
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: 2.7.0
47
62
  type: :runtime
48
63
  prerelease: false
49
64
  version_requirements: !ruby/object:Gem::Requirement
@@ -51,6 +66,9 @@ dependencies:
51
66
  - - "~>"
52
67
  - !ruby/object:Gem::Version
53
68
  version: '2.0'
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: 2.7.0
54
72
  - !ruby/object:Gem::Dependency
55
73
  name: googleauth
56
74
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +76,9 @@ dependencies:
58
76
  - - "~>"
59
77
  - !ruby/object:Gem::Version
60
78
  version: '1.0'
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: 1.4.0
61
82
  type: :runtime
62
83
  prerelease: false
63
84
  version_requirements: !ruby/object:Gem::Requirement
@@ -65,9 +86,12 @@ dependencies:
65
86
  - - "~>"
66
87
  - !ruby/object:Gem::Version
67
88
  version: '1.0'
89
+ - - ">="
90
+ - !ruby/object:Gem::Version
91
+ version: 1.4.0
68
92
  description: Easily translate specific attributes of any ActiveRecord model
69
93
  email:
70
- - sean@seanhogge.com
94
+ - devs@talentronic.com
71
95
  executables: []
72
96
  extensions: []
73
97
  extra_rdoc_files: []
@@ -96,13 +120,13 @@ files:
96
120
  - lib/generators/active_translation/templates/active_translation.rb
97
121
  - lib/generators/active_translation/templates/create_translations.rb
98
122
  - lib/tasks/active_translation_tasks.rake
99
- homepage: https://github.com/seanhogge/active_translation
123
+ homepage: https://github.com/talentronic/active_translation
100
124
  licenses:
101
125
  - MIT
102
126
  metadata:
103
- homepage_uri: https://github.com/seanhogge/active_translation
104
- source_code_uri: https://github.com/seanhogge/active_translation
105
- changelog_uri: https://github.com/seanhogge/active_translation
127
+ homepage_uri: https://github.com/talentronic/active_translation
128
+ source_code_uri: https://github.com/talentronic/active_translation
129
+ changelog_uri: https://github.com/talentronic/active_translation
106
130
  rdoc_options: []
107
131
  require_paths:
108
132
  - lib