Class: Google::Cloud::Translate::Language

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/translate/language.rb

Overview

Language

Represents a supported languages query result. Returned by Api#languages.

Examples:

require "google/cloud"

gcloud = Google::Cloud.new
translate = gcloud.translate

languages = translate.languages "en"

languages.size #=> 104
languages[0].code #=> "af"
languages[0].name #=> "Afrikaans"

See Also:

Instance Attribute Summary collapse

Instance Attribute Details

#codeString (readonly)

The language code. This is an ISO 639-1 language code.

Returns:

  • (String)


47
48
49
# File 'lib/google/cloud/translate/language.rb', line 47

def code
  @code
end

#nameString (readonly)

The localized name of the language, if available.

Returns:

  • (String)


53
54
55
# File 'lib/google/cloud/translate/language.rb', line 53

def name
  @name
end