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/translate"

translate = Google::Cloud::Translate.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)


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

def code
  @code
end

#nameString (readonly)

The localized name of the language, if available.

Returns:

  • (String)


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

def name
  @name
end