google-cloud-translate-v3 0.5.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,14 +27,14 @@ module Google
27
27
  # @return [::String]
28
28
  # Required. The `glossary` to be applied for this translation.
29
29
  #
30
- # The format depends on glossary:
30
+ # The format depends on the glossary:
31
31
  #
32
- # - User provided custom glossary:
32
+ # - User-provided custom glossary:
33
33
  # `projects/{project-number-or-id}/locations/{location-id}/glossaries/{glossary-id}`
34
34
  # @!attribute [rw] ignore_case
35
35
  # @return [::Boolean]
36
- # Optional. Indicates match is case-insensitive.
37
- # Default value is false if missing.
36
+ # Optional. Indicates match is case insensitive. The default value is `false`
37
+ # if missing.
38
38
  class TranslateTextGlossaryConfig
39
39
  include ::Google::Protobuf::MessageExts
40
40
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -44,23 +44,22 @@ module Google
44
44
  # @!attribute [rw] contents
45
45
  # @return [::Array<::String>]
46
46
  # Required. The content of the input in string format.
47
- # We recommend the total content be less than 30k codepoints. The max length
48
- # of this field is 1024.
49
- # Use BatchTranslateText for larger text.
47
+ # We recommend the total content be less than 30,000 codepoints. The max
48
+ # length of this field is 1024. Use BatchTranslateText for larger text.
50
49
  # @!attribute [rw] mime_type
51
50
  # @return [::String]
52
51
  # Optional. The format of the source text, for example, "text/html",
53
52
  # "text/plain". If left blank, the MIME type defaults to "text/html".
54
53
  # @!attribute [rw] source_language_code
55
54
  # @return [::String]
56
- # Optional. The BCP-47 language code of the input text if
55
+ # Optional. The ISO-639 language code of the input text if
57
56
  # known, for example, "en-US" or "sr-Latn". Supported language codes are
58
57
  # listed in Language Support. If the source language isn't specified, the API
59
58
  # attempts to identify the source language automatically and returns the
60
59
  # source language within the response.
61
60
  # @!attribute [rw] target_language_code
62
61
  # @return [::String]
63
- # Required. The BCP-47 language code to use for translation of the input
62
+ # Required. The ISO-639 language code to use for translation of the input
64
63
  # text, set to one of the language codes listed in Language Support.
65
64
  # @!attribute [rw] parent
66
65
  # @return [::String]
@@ -161,7 +160,7 @@ module Google
161
160
  # `projects/{project-number}/locations/{location-id}/models/general/nmt`.
162
161
  # @!attribute [rw] detected_language_code
163
162
  # @return [::String]
164
- # The BCP-47 language code of source text in the initial request, detected
163
+ # The ISO-639 language code of source text in the initial request, detected
165
164
  # automatically, if no source language was passed within the initial
166
165
  # request. If the source language was passed, auto-detection of the language
167
166
  # does not occur and this field is empty.
@@ -233,7 +232,7 @@ module Google
233
232
  # The response message for language detection.
234
233
  # @!attribute [rw] language_code
235
234
  # @return [::String]
236
- # The BCP-47 language code of source content in the request, detected
235
+ # The ISO-639 language code of the source content in the request, detected
237
236
  # automatically.
238
237
  # @!attribute [rw] confidence
239
238
  # @return [::Float]
@@ -309,19 +308,19 @@ module Google
309
308
  # @!attribute [rw] language_code
310
309
  # @return [::String]
311
310
  # Supported language code, generally consisting of its ISO 639-1
312
- # identifier, for example, 'en', 'ja'. In certain cases, BCP-47 codes
311
+ # identifier, for example, 'en', 'ja'. In certain cases, ISO-639 codes
313
312
  # including language and region identifiers are returned (for example,
314
- # 'zh-TW' and 'zh-CN')
313
+ # 'zh-TW' and 'zh-CN').
315
314
  # @!attribute [rw] display_name
316
315
  # @return [::String]
317
- # Human readable name of the language localized in the display language
316
+ # Human-readable name of the language localized in the display language
318
317
  # specified in the request.
319
318
  # @!attribute [rw] support_source
320
319
  # @return [::Boolean]
321
- # Can be used as source language.
320
+ # Can be used as a source language.
322
321
  # @!attribute [rw] support_target
323
322
  # @return [::Boolean]
324
- # Can be used as target language.
323
+ # Can be used as a target language.
325
324
  class SupportedLanguage
326
325
  include ::Google::Protobuf::MessageExts
327
326
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -419,7 +418,7 @@ module Google
419
418
  # Since index.csv will be keeping updated during the process, please make
420
419
  # sure there is no custom retention policy applied on the output bucket
421
420
  # that may avoid file updating.
422
- # (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
421
+ # (https://cloud.google.com/storage/docs/bucket-lock#retention-policy)
423
422
  #
424
423
  # The format of translations_file (for target language code 'trg') is:
425
424
  # `gs://translation_test/a_b_c_'trg'_translations.[extension]`
@@ -564,7 +563,7 @@ module Google
564
563
  # location-id), otherwise an INVALID_ARGUMENT (400) error is returned.
565
564
  # @!attribute [rw] source_language_code
566
565
  # @return [::String]
567
- # Optional. The BCP-47 language code of the input document if known, for
566
+ # Optional. The ISO-639 language code of the input document if known, for
568
567
  # example, "en-US" or "sr-Latn". Supported language codes are listed in
569
568
  # Language Support. If the source language isn't specified, the API attempts
570
569
  # to identify the source language automatically and returns the source
@@ -572,7 +571,7 @@ module Google
572
571
  # request contains a glossary or a custom model.
573
572
  # @!attribute [rw] target_language_code
574
573
  # @return [::String]
575
- # Required. The BCP-47 language code to use for translation of the input
574
+ # Required. The ISO-639 language code to use for translation of the input
576
575
  # document, set to one of the language codes listed in Language Support.
577
576
  # @!attribute [rw] document_input_config
578
577
  # @return [::Google::Cloud::Translate::V3::DocumentInputConfig]
@@ -615,6 +614,22 @@ module Google
615
614
  #
616
615
  # See https://cloud.google.com/translate/docs/advanced/labels for more
617
616
  # information.
617
+ # @!attribute [rw] customized_attribution
618
+ # @return [::String]
619
+ # Optional. This flag is to support user customized attribution.
620
+ # If not provided, the default is `Machine Translated by Google`.
621
+ # Customized attribution should follow rules in
622
+ # https://cloud.google.com/translate/attribution#attribution_and_logos
623
+ # @!attribute [rw] is_translate_native_pdf_only
624
+ # @return [::Boolean]
625
+ # Optional. If true, the page limit of online native pdf translation is 300
626
+ # and only native pdf pages will be translated.
627
+ # @!attribute [rw] enable_shadow_removal_native_pdf
628
+ # @return [::Boolean]
629
+ # Optional. If true, use the text removal to remove the shadow text on
630
+ # background image for native pdf translation.
631
+ # Shadow removal feature can only be enabled when
632
+ # is_translate_native_pdf_only is false
618
633
  class TranslateDocumentRequest
619
634
  include ::Google::Protobuf::MessageExts
620
635
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -856,10 +871,10 @@ module Google
856
871
  #
857
872
  # For unidirectional glossaries:
858
873
  #
859
- # - TSV/CSV (`.tsv`/`.csv`): 2 column file, tab- or comma-separated.
874
+ # - TSV/CSV (`.tsv`/`.csv`): Two column file, tab- or comma-separated.
860
875
  # The first column is source text. The second column is target text.
861
- # The file must not contain headers. That is, the first row is data, not
862
- # column names.
876
+ # No headers in this file. The first row contains data and not column
877
+ # names.
863
878
  #
864
879
  # - TMX (`.tmx`): TMX file with parallel data defining source/target term
865
880
  # pairs.
@@ -874,7 +889,7 @@ module Google
874
889
  extend ::Google::Protobuf::MessageExts::ClassMethods
875
890
  end
876
891
 
877
- # Represents a glossary built from user provided data.
892
+ # Represents a glossary built from user-provided data.
878
893
  # @!attribute [rw] name
879
894
  # @return [::String]
880
895
  # Required. The resource name of the glossary. Glossary names have the form
@@ -898,6 +913,9 @@ module Google
898
913
  # @!attribute [r] end_time
899
914
  # @return [::Google::Protobuf::Timestamp]
900
915
  # Output only. When the glossary creation was finished.
916
+ # @!attribute [rw] display_name
917
+ # @return [::String]
918
+ # Optional. The display name of the glossary.
901
919
  class Glossary
902
920
  include ::Google::Protobuf::MessageExts
903
921
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -905,11 +923,11 @@ module Google
905
923
  # Used with unidirectional glossaries.
906
924
  # @!attribute [rw] source_language_code
907
925
  # @return [::String]
908
- # Required. The BCP-47 language code of the input text, for example,
926
+ # Required. The ISO-639 language code of the input text, for example,
909
927
  # "en-US". Expected to be an exact match for GlossaryTerm.language_code.
910
928
  # @!attribute [rw] target_language_code
911
929
  # @return [::String]
912
- # Required. The BCP-47 language code for translation output, for example,
930
+ # Required. The ISO-639 language code for translation output, for example,
913
931
  # "zh-CN". Expected to be an exact match for GlossaryTerm.language_code.
914
932
  class LanguageCodePair
915
933
  include ::Google::Protobuf::MessageExts
@@ -919,7 +937,7 @@ module Google
919
937
  # Used with equivalent term set glossaries.
920
938
  # @!attribute [rw] language_codes
921
939
  # @return [::Array<::String>]
922
- # The BCP-47 language code(s) for terms defined in the glossary.
940
+ # The ISO-639 language code(s) for terms defined in the glossary.
923
941
  # All entries are unique. The list contains at least two entries.
924
942
  # Expected to be an exact match for GlossaryTerm.language_code.
925
943
  class LanguageCodesSet
@@ -1120,12 +1138,12 @@ module Google
1120
1138
  # error is returned.
1121
1139
  # @!attribute [rw] source_language_code
1122
1140
  # @return [::String]
1123
- # Required. The BCP-47 language code of the input document if known, for
1141
+ # Required. The ISO-639 language code of the input document if known, for
1124
1142
  # example, "en-US" or "sr-Latn". Supported language codes are listed in
1125
- # Language Support (https://cloud.google.com/translate/docs/languages).
1143
+ # [Language Support](https://cloud.google.com/translate/docs/languages).
1126
1144
  # @!attribute [rw] target_language_codes
1127
1145
  # @return [::Array<::String>]
1128
- # Required. The BCP-47 language code to use for translation of the input
1146
+ # Required. The ISO-639 language code to use for translation of the input
1129
1147
  # document. Specify up to 10 language codes here.
1130
1148
  # @!attribute [rw] input_configs
1131
1149
  # @return [::Array<::Google::Cloud::Translate::V3::BatchDocumentInputConfig>]
@@ -1170,6 +1188,12 @@ module Google
1170
1188
  #
1171
1189
  # If nothing specified, output files will be in the same format as the
1172
1190
  # original file.
1191
+ # @!attribute [rw] customized_attribution
1192
+ # @return [::String]
1193
+ # Optional. This flag is to support user customized attribution.
1194
+ # If not provided, the default is `Machine Translated by Google`.
1195
+ # Customized attribution should follow rules in
1196
+ # https://cloud.google.com/translate/attribution#attribution_and_logos
1173
1197
  class BatchTranslateDocumentRequest
1174
1198
  include ::Google::Protobuf::MessageExts
1175
1199
  extend ::Google::Protobuf::MessageExts::ClassMethods
@@ -1263,7 +1287,7 @@ module Google
1263
1287
  # Since index.csv will be keeping updated during the process, please make
1264
1288
  # sure there is no custom retention policy applied on the output bucket
1265
1289
  # that may avoid file updating.
1266
- # (https://cloud.google.com/storage/docs/bucket-lock?hl=en#retention-policy)
1290
+ # (https://cloud.google.com/storage/docs/bucket-lock#retention-policy)
1267
1291
  #
1268
1292
  # The naming format of translation output files follows (for target
1269
1293
  # language code [trg]): `translation_output`:
@@ -43,8 +43,12 @@ module Google
43
43
  # if (any.is(Foo.class)) {
44
44
  # foo = any.unpack(Foo.class);
45
45
  # }
46
+ # // or ...
47
+ # if (any.isSameTypeAs(Foo.getDefaultInstance())) {
48
+ # foo = any.unpack(Foo.getDefaultInstance());
49
+ # }
46
50
  #
47
- # Example 3: Pack and unpack a message in Python.
51
+ # Example 3: Pack and unpack a message in Python.
48
52
  #
49
53
  # foo = Foo(...)
50
54
  # any = Any()
@@ -54,7 +58,7 @@ module Google
54
58
  # any.Unpack(foo)
55
59
  # ...
56
60
  #
57
- # Example 4: Pack and unpack a message in Go
61
+ # Example 4: Pack and unpack a message in Go
58
62
  #
59
63
  # foo := &pb.Foo{...}
60
64
  # any, err := anypb.New(foo)
@@ -73,9 +77,8 @@ module Google
73
77
  # in the type URL, for example "foo.bar.com/x/y.z" will yield type
74
78
  # name "y.z".
75
79
  #
76
- #
77
80
  # JSON
78
- #
81
+ # ====
79
82
  # The JSON representation of an `Any` value uses the regular
80
83
  # representation of the deserialized, embedded message, with an
81
84
  # additional field `@type` which contains the type URL. Example:
@@ -69,7 +69,6 @@ module Google
69
69
  # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
70
70
  # .setNanos((int) ((millis % 1000) * 1000000)).build();
71
71
  #
72
- #
73
72
  # Example 5: Compute Timestamp from Java `Instant.now()`.
74
73
  #
75
74
  # Instant now = Instant.now();
@@ -78,7 +77,6 @@ module Google
78
77
  # Timestamp.newBuilder().setSeconds(now.getEpochSecond())
79
78
  # .setNanos(now.getNano()).build();
80
79
  #
81
- #
82
80
  # Example 6: Compute Timestamp from current time in Python.
83
81
  #
84
82
  # timestamp = Timestamp()
@@ -108,7 +106,7 @@ module Google
108
106
  # [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
109
107
  # the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
110
108
  # the Joda Time's [`ISODateTimeFormat.dateTime()`](
111
- # http://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
109
+ # http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
112
110
  # ) to obtain a formatter capable of generating timestamps in this format.
113
111
  # @!attribute [rw] seconds
114
112
  # @return [::Integer]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-translate-v3
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-02-17 00:00:00.000000000 Z
11
+ date: 2023-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.17.1
19
+ version: 0.19.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.17.1
29
+ version: 0.19.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -172,11 +172,16 @@ files:
172
172
  - README.md
173
173
  - lib/google-cloud-translate-v3.rb
174
174
  - lib/google/cloud/translate/v3.rb
175
+ - lib/google/cloud/translate/v3/rest.rb
175
176
  - lib/google/cloud/translate/v3/translation_service.rb
176
177
  - lib/google/cloud/translate/v3/translation_service/client.rb
177
178
  - lib/google/cloud/translate/v3/translation_service/credentials.rb
178
179
  - lib/google/cloud/translate/v3/translation_service/operations.rb
179
180
  - lib/google/cloud/translate/v3/translation_service/paths.rb
181
+ - lib/google/cloud/translate/v3/translation_service/rest.rb
182
+ - lib/google/cloud/translate/v3/translation_service/rest/client.rb
183
+ - lib/google/cloud/translate/v3/translation_service/rest/operations.rb
184
+ - lib/google/cloud/translate/v3/translation_service/rest/service_stub.rb
180
185
  - lib/google/cloud/translate/v3/translation_service_pb.rb
181
186
  - lib/google/cloud/translate/v3/translation_service_services_pb.rb
182
187
  - lib/google/cloud/translate/v3/version.rb
@@ -214,5 +219,5 @@ requirements: []
214
219
  rubygems_version: 3.4.2
215
220
  signing_key:
216
221
  specification_version: 4
217
- summary: API Client library for the Cloud Translation V3 API
222
+ summary: Integrates text translation into your website or application.
218
223
  test_files: []