بدء استخدام إضافة "أداة تحرير مستندات Google" بسرعة
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
ينشئ هذا الدليل السريع إضافة لمحرّر "مستندات Google" تترجم النص المحدّد في المستند.
الأهداف
- إعداد النص البرمجي
- شغِّل النص البرمجي.
المتطلبات الأساسية
لاستخدام هذا النموذج، يجب استيفاء المتطلبات الأساسية التالية:
- حساب Google (قد تتطلّب حسابات Google Workspace موافقة المشرف).
- متصفّح ويب يمكنه الوصول إلى الإنترنت
إعداد النص البرمجي
- أنشئ مستند Google على docs.new.
- انقر على الإضافات > برمجة تطبيقات Google.
- انقر على مشروع بلا عنوان.
- أعِد تسمية مشروع Apps Script Translate Docs وانقر على إعادة تسمية.
- بجانب الملف
Code.gs
، انقر على رمز المزيد more_vert
> إعادة تسمية. أدخِل اسم الملف translate
.
- انقر على "إضافة ملف" add
> HTML. أدخِل اسم الملف
sidebar
.
استبدِل محتوى كل ملف بالرمز التالي المناسب، ثم انقر على "حفظ"
.
تشغيل النص البرمجي
- في مستند "مستندات Google"، أعِد تحميل الصفحة.
- انقر على الإضافات >
ترجمة مستندات Google
> بدء.
- امنح الإذن للإضافة عندما يُطلب منك ذلك.
بعد الحصول على الإذن، ستتم إعادة تشغيل الإضافة.
- اكتب بعض النص في المستند واختَره.
- في الإضافة، انقر على ترجمة. لاستبدال النص في المستند، انقر على إدراج.
الخطوات التالية
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-31 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-31 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\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,[]]