Class LanguageApp
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
ভাষা অ্যাপ ভাষা পরিষেবা পাঠ্যের স্বয়ংক্রিয় অনুবাদ গণনা করার জন্য স্ক্রিপ্টগুলিকে একটি উপায় প্রদান করে।
// The code below will write "Esta es una prueba" to the log.
const spanish = LanguageApp.translate('This is a test', 'en', 'es');
Logger.log(spanish);
বিস্তারিত ডকুমেন্টেশন
translate(text, sourceLanguage, targetLanguage)
একটি উৎস ভাষা থেকে একটি গন্তব্য ভাষায় কিছু পাঠ্য স্বয়ংক্রিয়ভাবে অনুবাদ করে।
// The code below will write "Esta es una prueba" to the log.
const spanish = LanguageApp.translate('This is a test', 'en', 'es');
Logger.log(spanish);
ভাষার কোডের একটি তালিকা
এখানে পাওয়া যায়।
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
text | String | অনুবাদ করার জন্য পাঠ্য |
source Language | String | যে ভাষা কোডে পাঠ্য লেখা হয়। যদি এটি খালি স্ট্রিং-এ সেট করা হয়, উৎস ভাষা কোড স্বয়ংক্রিয়ভাবে সনাক্ত করা হবে |
target Language | String | যে ভাষা কোডে পাঠ্য অনুবাদ করা উচিত |
প্রত্যাবর্তন
String
- অনুবাদিত পাঠ্য
translate(text, sourceLanguage, targetLanguage, advancedArgs)
একটি উৎস ভাষা থেকে একটি গন্তব্য ভাষায় কিছু পাঠ্য স্বয়ংক্রিয়ভাবে অনুবাদ করে।
// The code below will write "Esta es una <strong>prueba</strong>" to the log.
const spanish = LanguageApp.translate(
'This is a <strong>test</strong>',
'en',
'es',
{contentType: 'html'},
);
Logger.log(spanish);
ভাষার কোডের একটি তালিকা
এখানে পাওয়া যায়।
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
text | String | অনুবাদ করার জন্য পাঠ্য |
source Language | String | যে ভাষা কোডে পাঠ্য লেখা হয়। যদি এটি খালি স্ট্রিং-এ সেট করা হয়, উৎস ভাষা কোড স্বয়ংক্রিয়ভাবে সনাক্ত করা হবে |
target Language | String | যে ভাষা কোডে পাঠ্য অনুবাদ করা উচিত |
advanced Args | Object | ঐচ্ছিক জাভাস্ক্রিপ্ট অবজেক্ট ক্ষেত্র |
উন্নত পরামিতি
নাম | টাইপ | বর্ণনা |
---|
content Type | String | পাঠ্যের বিষয়বস্তুর প্রকার; সমর্থিত মান হল 'টেক্সট' (ডিফল্ট) এবং 'html' |
প্রত্যাবর্তন
String
- অনুবাদিত পাঠ্য
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eThe Language service automatically translates text between languages using the \u003ccode\u003etranslate()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify the source and target languages using language codes, with auto-detection available for the source language.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003etranslate()\u003c/code\u003e method supports optional advanced arguments for handling different content types like HTML.\u003c/p\u003e\n"],["\u003cp\u003eA comprehensive list of supported language codes can be found in the documentation.\u003c/p\u003e\n"]]],[],null,["# Class LanguageApp\n\nLanguageApp\n\nThe Language service provides scripts a way to compute automatic translations of text.\n\n```javascript\n// The code below will write \"Esta es una prueba\" to the log.\nconst spanish = LanguageApp.translate('This is a test', 'en', 'es');\nLogger.log(spanish);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|----------------------------------------------------------------------------------------------------------|-------------|--------------------------------------------------------------------------------------|\n| [translate(text, sourceLanguage, targetLanguage)](#translate(String,String,String)) | `String` | Automatically translates some text from a source language to a destination language. |\n| [translate(text, sourceLanguage, targetLanguage, advancedArgs)](#translate(String,String,String,Object)) | `String` | Automatically translates some text from a source language to a destination language. |\n\nDetailed documentation\n----------------------\n\n### `translate(text, sourceLanguage, targetLanguage)`\n\nAutomatically translates some text from a source language to a destination language.\n\n```javascript\n// The code below will write \"Esta es una prueba\" to the log.\nconst spanish = LanguageApp.translate('This is a test', 'en', 'es');\nLogger.log(spanish);\n```\nA list of language codes is available [here](/translate/docs/languages).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------------|----------|------------------------------------------------------------------------------------------------------------------------------|\n| `text` | `String` | the text to translate |\n| `source``Language` | `String` | the language code in which text is written. If it is set to the empty string, the source language code will be auto-detected |\n| `target``Language` | `String` | the language code to which the text should be translated |\n\n#### Return\n\n\n`String` --- the translated text\n\n*** ** * ** ***\n\n### `translate(text, sourceLanguage, targetLanguage, advancedArgs)`\n\nAutomatically translates some text from a source language to a destination language.\n\n```javascript\n// The code below will write \"Esta es una \u003cstrong\u003eprueba\u003c/strong\u003e\" to the log.\nconst spanish = LanguageApp.translate(\n 'This is a <strong>test</strong>',\n 'en',\n 'es',\n {contentType: 'html'},\n);\nLogger.log(spanish);\n```\nA list of language codes is available [here](/translate/docs/languages).\n\n#### Parameters\n\n| Name | Type | Description |\n|--------------------|----------|------------------------------------------------------------------------------------------------------------------------------|\n| `text` | `String` | the text to translate |\n| `source``Language` | `String` | the language code in which text is written. If it is set to the empty string, the source language code will be auto-detected |\n| `target``Language` | `String` | the language code to which the text should be translated |\n| `advanced``Args` | `Object` | optional JavaScript object fields |\n\n#### Advanced parameters\n\n| Name | Type | Description |\n|-----------------|----------|--------------------------------------------------------------------------------|\n| `content``Type` | `String` | the content type of the text; supported values are 'text' (default) and 'html' |\n\n#### Return\n\n\n`String` --- the translated text"]]