google-cloud-translate 3.9.1 → 3.10.1
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 +4 -4
- data/README.md +5 -11
- data/lib/google/cloud/translate/helpers.rb +31 -8
- data/lib/google/cloud/translate/version.rb +1 -1
- metadata +3 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c900d0400d549fffda0001b4c82909aacd5a8673cbde7a921867cd291c26e682
|
|
4
|
+
data.tar.gz: f9ba1c7887bdcf04cfa8b3697703fe542e2abdf5fb6e1ff8b3b5ad882d0974c6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 805817b8127ee793b0bbb0b87d7df17aae1fed3018ceeba9a525bc981843aad4d98a09bb2a72c2bf5e50f0a7f73fd65f68dfc9bfdac20163159b5abe97fb07d1
|
|
7
|
+
data.tar.gz: 3b9e96e215fe4726171ea956a271c428ea669743845fb752e443b8d3ccf02713e58e21f56cce3f4bbbbd4903e16e27e5e9ab365ba86c582dbbe96ddc1d105897
|
data/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
# Ruby Client for the Cloud Translation API
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Integrates text translation into your website or application.
|
|
4
4
|
|
|
5
|
-
Cloud Translation can dynamically translate text between thousands of language pairs. Translation lets websites and programs programmatically integrate with the translation service.
|
|
6
5
|
|
|
7
6
|
Actual client classes for the various versions of this API are defined in
|
|
8
7
|
_versioned_ client gems, with names of the form `google-cloud-translate-v*`.
|
|
@@ -19,9 +18,6 @@ client gems:
|
|
|
19
18
|
[google-cloud-translate-v2](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v2/latest),
|
|
20
19
|
[google-cloud-translate-v3](https://cloud.google.com/ruby/docs/reference/google-cloud-translate-v3/latest).
|
|
21
20
|
|
|
22
|
-
See also the [Product Documentation](https://cloud.google.com/translate)
|
|
23
|
-
for more usage information.
|
|
24
|
-
|
|
25
21
|
## Quick Start
|
|
26
22
|
|
|
27
23
|
```
|
|
@@ -86,12 +82,10 @@ working, try updating the versioned clients in your bundle or installed gems:
|
|
|
86
82
|
|
|
87
83
|
This library is supported on Ruby 3.2+.
|
|
88
84
|
|
|
89
|
-
Google provides official support for Ruby versions
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
|
|
94
|
-
support schedule.
|
|
85
|
+
Google provides official support for Ruby versions as described in the
|
|
86
|
+
[Supported Ruby versions](https://docs.cloud.google.com/ruby/getting-started/supported-ruby-versions)
|
|
87
|
+
policy. Older versions of Ruby _may_ still work, but are unsupported and not
|
|
88
|
+
recommended.
|
|
95
89
|
|
|
96
90
|
## Which client should I use?
|
|
97
91
|
|
|
@@ -47,6 +47,8 @@ module Google
|
|
|
47
47
|
# @param [Integer] timeout Default timeout to use in requests. Optional.
|
|
48
48
|
# @param [String] endpoint Override of the endpoint host name. Optional. If the param is nil, uses the default
|
|
49
49
|
# endpoint.
|
|
50
|
+
# @param [String] universe_domain Override of the universe domain. Optional. If the param is nil, uses the
|
|
51
|
+
# configured `universe_domain`, `ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"]`, or `"googleapis.com"`.
|
|
50
52
|
#
|
|
51
53
|
# @return [Google::Cloud::Translate::V2::Api]
|
|
52
54
|
#
|
|
@@ -93,15 +95,36 @@ module Google
|
|
|
93
95
|
scope: nil,
|
|
94
96
|
retries: nil,
|
|
95
97
|
timeout: nil,
|
|
96
|
-
endpoint: nil
|
|
98
|
+
endpoint: nil,
|
|
99
|
+
universe_domain: nil
|
|
97
100
|
require "google/cloud/translate/v2"
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
101
|
+
options = {
|
|
102
|
+
project_id: project_id,
|
|
103
|
+
credentials: credentials,
|
|
104
|
+
key: key,
|
|
105
|
+
scope: scope,
|
|
106
|
+
retries: retries,
|
|
107
|
+
timeout: timeout,
|
|
108
|
+
endpoint: endpoint
|
|
109
|
+
}
|
|
110
|
+
# `Translate::V2.new` shares `Google::Cloud.configure.translate` (via
|
|
111
|
+
# `V2.translation_config`) and `ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"]`.
|
|
112
|
+
# Forward explicit `universe_domain` arguments verbatim, and forward
|
|
113
|
+
# non-default configured/ENV universes so `google-cloud-translate-v2 <= 1.2.1`
|
|
114
|
+
# fails closed with `ArgumentError` instead of silently routing to
|
|
115
|
+
# `googleapis.com`, while keeping GDU callers (unset or `"googleapis.com"`)
|
|
116
|
+
# compatible with older V2 gems.
|
|
117
|
+
if universe_domain.nil?
|
|
118
|
+
configured_universe = configure.universe_domain
|
|
119
|
+
configured_universe = ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"]&.strip if configured_universe.nil?
|
|
120
|
+
if !configured_universe.nil? && !configured_universe.empty? && configured_universe != "googleapis.com"
|
|
121
|
+
options[:universe_domain] = configured_universe
|
|
122
|
+
end
|
|
123
|
+
else
|
|
124
|
+
options[:universe_domain] = universe_domain
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
Google::Cloud::Translate::V2.new(**options)
|
|
105
128
|
end
|
|
106
129
|
|
|
107
130
|
# Additional config keys used by V2
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: google-cloud-translate
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.10.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Google LLC
|
|
@@ -63,9 +63,7 @@ dependencies:
|
|
|
63
63
|
- - "<"
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
65
|
version: 2.a
|
|
66
|
-
description:
|
|
67
|
-
language pairs. Translation lets websites and programs programmatically integrate
|
|
68
|
-
with the translation service.
|
|
66
|
+
description: Integrates text translation into your website or application.
|
|
69
67
|
email: googleapis-packages@google.com
|
|
70
68
|
executables: []
|
|
71
69
|
extensions: []
|
|
@@ -100,5 +98,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
100
98
|
requirements: []
|
|
101
99
|
rubygems_version: 3.6.9
|
|
102
100
|
specification_version: 4
|
|
103
|
-
summary:
|
|
101
|
+
summary: Integrates text translation into your website or application.
|
|
104
102
|
test_files: []
|