Cloud Translation V2 API - Class Google::Cloud::Translate::V2::Language (v0.4.1)

Reference documentation and code samples for the Cloud Translation V2 API class Google::Cloud::Translate::V2::Language.

Language

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

Inherits

  • Object

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"

Methods

#code

def code() -> String

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

Returns
  • (String)

#name

def name() -> String

The localized name of the language, if available.

Returns
  • (String)