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

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

Overview

Language

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

Examples:

require "google/cloud/translate/v2"

translate = Google::Cloud::Translate::V2.new

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)


44
45
46
# File 'lib/google/cloud/translate/v2/language.rb', line 44

def code
  @code
end

#nameString (readonly)

The localized name of the language, if available.

Returns:

  • (String)


50
51
52
# File 'lib/google/cloud/translate/v2/language.rb', line 50

def name
  @name
end