מדריך למתחילים בנושא תוספים ל-Google Docs Editor
במדריך למתחילים הזה תלמדו איך ליצור תוסף ל-Google Docs Editor שמתרגם טקסט שנבחר במסמך.
מטרות
- מגדירים את הסקריפט.
- מריצים את הסקריפט.
דרישות מוקדמות
כדי להשתמש בדוגמה הזו, צריך את הדרישות המוקדמות הבאות:
- חשבון Google (יכול להיות שחשבונות Google Workspace ידרשו אישור מהאדמין).
- דפדפן אינטרנט עם גישה לאינטרנט.
הגדרת הסקריפט
- יוצרים מסמך ב-Google Docs בכתובת docs.new.
- לוחצים על תוספים > Apps Script.
- לוחצים על Untitled project.
- משנים את השם של פרויקט Apps Script ל-Translate Docs ולוחצים על Rename.
- לצד הקובץ
Code.gs
, לוחצים על סמל האפשרויות הנוספות more_vert
> שינוי שם. נותנים לקובץ את השם translate
.
- לוחצים על 'הוספת קובץ' add
> HTML. נותנים לקובץ את השם
sidebar
.
מחליפים את התוכן של כל קובץ בקוד התואם הבא, ואז לוחצים על 'שמירה'
.
מריצים את הסקריפט
- במסמך ב-Docs, טוענים מחדש את הדף.
- לוחצים על תוספים >
Translate Docs
> התחלה.
- כשמוצגת בקשה, מאשרים את התוסף.
לאחר האישור, התוסף יופעל מחדש.
- מקלידים טקסט כלשהו במסמך ובוחרים אותו.
- בתוסף, לוחצים על תרגום. כדי להחליף את הטקסט במסמך, לוחצים על הוספה.
השלבים הבאים
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-02-14 (שעון UTC).
[null,null,["עדכון אחרון: 2025-02-14 (שעון UTC)."],[[["This quickstart guide demonstrates how to build a Google Docs add-on using Apps Script that translates selected text within a document."],["The 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."],["Users need a Google Account and a web browser to utilize this add-on, which involves setting up a script, running it, and authorizing permissions."],["The add-on provides a user interface within a sidebar in Google Docs for easy interaction and language selection."],["Further resources are available for extending Google Docs functionality with Apps Script and exploring the Document service for more advanced customizations."]]],[]]