class Google::Cloud::Translate::V2::Language

# Language

Represents a supported languages query result. Returned by {Google::Cloud::Translate::V2::Api#languages}.

@see cloud.google.com/translation/docs/discovering-supported-languages Discovering Supported Languages

@example

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"

Attributes

code[R]

The language code. This is an [ISO 639-1](en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code.

@return [String]

name[R]

The localized name of the language, if available.

@return [String]

Public Class Methods

from_gapi(gapi) click to toggle source

@private New Language from a LanguagesResource object as defined by the Google API Client object.

# File lib/google/cloud/translate/v2/language.rb, line 61
def self.from_gapi gapi
  new gapi["language"], gapi["name"]
end
new(code, name) click to toggle source

@private Create a new object.

# File lib/google/cloud/translate/v2/language.rb, line 54
def initialize code, name
  @code = code
  @name = name
end