Google Docs Editor के ऐड-ऑन का इस्तेमाल शुरू करना
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
इस क्विकस्टार्ट में, Google Docs Editor का एक ऐड-ऑन बनाया गया है. यह ऐड-ऑन, किसी दस्तावेज़ में चुने गए टेक्स्ट का अनुवाद करता है.
मकसद
- स्क्रिप्ट सेट अप करें.
- स्क्रिप्ट चलाएं.
ज़रूरी शर्तें
इस सैंपल का इस्तेमाल करने के लिए, आपको इन ज़रूरी शर्तों को पूरा करना होगा:
- Google खाता (Google Workspace खातों के लिए, एडमिन की अनुमति ज़रूरी हो सकती है).
- इंटरनेट ऐक्सेस करने की सुविधा वाला वेब ब्राउज़र.
स्क्रिप्ट सेट अप करना
- docs.new पर जाकर, Google Docs दस्तावेज़ बनाएं.
- एक्सटेंशन > Apps Script पर क्लिक करें.
- बिना टाइटल वाला प्रोजेक्ट पर क्लिक करें.
- Apps Script प्रोजेक्ट Translate Docs का नाम बदलें और नाम बदलें पर क्लिक करें.
Code.gs
फ़ाइल के बगल में मौजूद, ज़्यादा more_vert
> नाम बदलें पर क्लिक करें. फ़ाइल को translate
नाम दें.
- फ़ाइल जोड़ें add
> एचटीएमएल पर क्लिक करें. फ़ाइल को
sidebar
नाम दें.
हर फ़ाइल के कॉन्टेंट को यहां दिए गए कोड से बदलें. इसके बाद, सेव करें
पर क्लिक करें.
स्क्रिप्ट चलाना
- अपने Docs दस्तावेज़ में, पेज को फिर से लोड करें.
- एक्सटेंशन >
Translate Docs
> शुरू करें पर क्लिक करें.
- जब आपसे कहा जाए, तब ऐड-ऑन को अनुमति दें.
अनुमति मिलने के बाद, ऐड-ऑन फिर से शुरू हो जाएगा.
- अपने दस्तावेज़ में कुछ टेक्स्ट टाइप करें और उसे चुनें.
- ऐड-ऑन में, अनुवाद करें पर क्लिक करें. दस्तावेज़ में मौजूद टेक्स्ट को बदलने के लिए, शामिल करें पर क्लिक करें.
अगले चरण
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-31 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-31 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eThis quickstart guide demonstrates how to build a Google Docs add-on using Apps Script that translates selected text within a document.\u003c/p\u003e\n"],["\u003cp\u003eThe add-on allows users to select text, choose source and target languages, and obtain the translation, with an option to insert the translated text directly into the document.\u003c/p\u003e\n"],["\u003cp\u003eUsers need a Google Account and a web browser to utilize this add-on, which involves setting up a script, running it, and authorizing permissions.\u003c/p\u003e\n"],["\u003cp\u003eThe add-on provides a user interface within a sidebar in Google Docs for easy interaction and language selection.\u003c/p\u003e\n"],["\u003cp\u003eFurther resources are available for extending Google Docs functionality with Apps Script and exploring the Document service for more advanced customizations.\u003c/p\u003e\n"]]],["This document guides the creation of a Google Docs add-on for text translation. It involves creating a new Google Docs file and an Apps Script project. You will rename files to `translate` and `sidebar`, and replace their content with provided code. The code defines functions for opening a sidebar, selecting text, translating it, and inserting the translated text back into the document. After reloading, accessing the add-on requires selecting text, choosing languages, clicking 'Translate', and finally, clicking 'Insert'.\n"],null,[]]