The target language into which the text was translated.
Returns
(String)
#model
defmodel()->String
The translation model. Can be either base for the Phrase-Based Machine Translation (PBMT) model, or nmt
for the Neural Machine Translation (NMT) model. If you did not include a model parameter with your request,
then this field is not included in the response.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Cloud Translation V2 API - Class Google::Cloud::Translate::V2::Translation (v1.1.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.1.0 (latest)](/ruby/docs/reference/google-cloud-translate-v2/latest/Google-Cloud-Translate-V2-Translation)\n- [1.0.1](/ruby/docs/reference/google-cloud-translate-v2/1.0.1/Google-Cloud-Translate-V2-Translation)\n- [0.5.1](/ruby/docs/reference/google-cloud-translate-v2/0.5.1/Google-Cloud-Translate-V2-Translation)\n- [0.4.1](/ruby/docs/reference/google-cloud-translate-v2/0.4.1/Google-Cloud-Translate-V2-Translation)\n- [0.3.1](/ruby/docs/reference/google-cloud-translate-v2/0.3.1/Google-Cloud-Translate-V2-Translation) \nReference documentation and code samples for the Cloud Translation V2 API class Google::Cloud::Translate::V2::Translation.\n\nTranslation\n-----------\n\nRepresents a translation query result. Returned by [Api#translate](/ruby/docs/reference/google-cloud-translate-v2/latest/Google-Cloud-Translate-V2-Api#Google__Cloud__Translate__V2__Api_translate_instance_ \"Google::Cloud::Translate::V2::Api#translate (method)\"). \n\nInherits\n--------\n\n- Object\n\nExample\n-------\n\n```ruby\nrequire \"google/cloud/translate/v2\"\n\ntranslate = Google::Cloud::Translate::V2.new\n\ntranslation = translate.translate \"Hello world!\", to: \"la\"\n\ntranslation.to_s #=\u003e \"Salve mundi!\"\n\ntranslation.from #=\u003e \"en\"\ntranslation.origin #=\u003e \"Hello world!\"\ntranslation.to #=\u003e \"la\"\ntranslation.text #=\u003e \"Salve mundi!\"\n```\n\nMethods\n-------\n\n### #detected?\n\n def detected?() -\u003e Boolean\n\nDetermines if the source language was detected by the Google Cloud Cloud Translation API. \n**Returns**\n\n- (Boolean) --- `true` if the source language was detected by the Cloud Translation API, `false` if the source language was provided in the request\n\n### #from\n\n def from() -\u003e String\n\n**Aliases**\n\n- [#source](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_source_instance_) \nThe source language from which the text was translated. \n**Returns**\n\n- (String)\n\n### #language\n\n def language() -\u003e String\n\n**Alias Of** : [#to](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_to_instance_) \nThe target language into which the text was translated. \n**Returns**\n\n- (String)\n\n### #model\n\n def model() -\u003e String\n\nThe translation model. Can be either `base` for the Phrase-Based Machine Translation (PBMT) model, or `nmt`\nfor the Neural Machine Translation (NMT) model. If you did not include a model parameter with your request,\nthen this field is not included in the response. \n**Returns**\n\n- (String)\n\n### #origin\n\n def origin() -\u003e String\n\nThe original query text that was translated. \n**Returns**\n\n- (String)\n\n### #source\n\n def source() -\u003e String\n\n**Alias Of** : [#from](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_from_instance_) \nThe source language from which the text was translated. \n**Returns**\n\n- (String)\n\n### #target\n\n def target() -\u003e String\n\n**Alias Of** : [#to](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_to_instance_) \nThe target language into which the text was translated. \n**Returns**\n\n- (String)\n\n### #text\n\n def text() -\u003e String\n\n**Aliases**\n\n- [#to_s](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_to_s_instance_)\n- [#to_str](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_to_str_instance_) \nThe translated result. \n**Returns**\n\n- (String)\n\n### #to\n\n def to() -\u003e String\n\n**Aliases**\n\n- [#language](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_language_instance_)\n- [#target](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_target_instance_) \nThe target language into which the text was translated. \n**Returns**\n\n- (String)\n\n### #to_s\n\n def to_s() -\u003e String\n\n**Alias Of** : [#text](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_text_instance_) \nThe translated result. \n**Returns**\n\n- (String)\n\n### #to_str\n\n def to_str() -\u003e String\n\n**Alias Of** : [#text](./Google-Cloud-Translate-V2-Translation#Google__Cloud__Translate__V2__Translation_text_instance_) \nThe translated result. \n**Returns**\n\n- (String)"]]