संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Google Workspace के ऐड-ऑन, उपयोगकर्ता की स्थानीय भाषा और टाइमज़ोन को ऐक्सेस कर सकते हैं. साथ ही, इस जानकारी का इस्तेमाल करके अपने इंटरफ़ेस और काम करने के तरीके को उपयोगकर्ता के हिसाब से बना सकते हैं. अपने ऐड-ऑन को यह जानकारी ऐक्सेस करने की अनुमति देने के लिए, आपको अपने ऐड-ऑन के मेनिफ़ेस्ट को कॉन्फ़िगर करना होगा.
ऐड-ऑन मेनिफ़ेस्ट कॉन्फ़िगर करना
उपयोगकर्ता की स्थानीय भाषा और टाइमज़ोन की जानकारी ऐक्सेस करने के लिए, अपने ऐड-ऑन को कॉन्फ़िगर किया जा सकता है. इसके लिए, यह तरीका अपनाएं:
अपने ऐड-ऑन की मेनिफ़ेस्ट फ़ाइल में, addOns.common.useLocaleFromApp फ़ील्ड को true पर सेट करें.
अगर यह पहले से मौजूद नहीं है, तो मेनिफ़ेस्ट की oauthScopes सूची में यह साफ़ तौर पर तय किया गया स्कोप जोड़ें:
https://www.googleapis.com/auth/script.locale
अगर आपने ऐड-ऑन की oauthScope सूची में कोई स्कोप जोड़ा है, तो अगली बार ऐड-ऑन खोलने पर, उपयोगकर्ताओं को उसे फिर से अनुमति देनी होगी.
स्थानीय भाषा और टाइमज़ोन की जानकारी पाना
सही तरीके से कॉन्फ़िगर किए जाने पर, इवेंट ऑब्जेक्ट में उपयोगकर्ता की स्थानीय भाषा की जानकारी होती है. ये फ़ील्ड, इवेंट ऑब्जेक्ट के commonEventObject सबस्ट्रक्चर में दिखते हैं:
commonEventObject.userLocale—उपयोगकर्ता की भाषा और देश/इलाके का आइडेंटिफ़ायर. उदाहरण के लिए, en-US.
commonEventObject.timeZone.offset—उपयोगकर्ता के टाइमज़ोन का ऑफ़सेट, कोऑर्डिनेटेड यूनिवर्सल टाइम (यूटीसी) से मिले मिलिसेकंड में.
commonEventObject.timeZone.id—उपयोगकर्ता के टाइमज़ोन का आइडेंटिफ़ायर.
उदाहरण के लिए, America/New_York.
commonEventObject.timeZone—उपयोगकर्ता का टाइमज़ोन आईडी और ऑफ़सेट.
जब उपयोगकर्ता आपके ऐड-ऑन से इंटरैक्ट करता है, तो इवेंट ऑब्जेक्ट को ऐक्शन कॉलबैक फ़ंक्शन और होम पेज और संदर्भ के हिसाब से ट्रिगर करने वाले फ़ंक्शन में भेजा जाता है. हर कॉलबैक या ट्रिगर फ़ंक्शन, इवेंट ऑब्जेक्ट से भाषा और टाइमज़ोन की जानकारी पढ़ सकता है और ज़रूरत के हिसाब से उसका इस्तेमाल कर सकता है.
उदाहरण के लिए, नए कार्ड पर नेविगेट करने वाला कॉलबैक फ़ंक्शन, कार्ड में कौनसा टेक्स्ट जोड़ना है, यह तय करते समय स्थानीय भाषा की स्ट्रिंग का इस्तेमाल कर सकता है.
[null,null,["आखिरी बार 2025-06-05 (UTC) को अपडेट किया गया."],[[["\u003cp\u003eGoogle Workspace add-ons can be configured to access and utilize a user's locale and timezone for customization.\u003c/p\u003e\n"],["\u003cp\u003eAdd-on developers must set \u003ccode\u003eaddOns.common.useLocaleFromApp\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e and include the \u003ccode\u003ehttps://www.googleapis.com/auth/script.locale\u003c/code\u003e scope in the manifest file for locale and timezone access.\u003c/p\u003e\n"],["\u003cp\u003eEvent objects provide the user's locale and timezone information through fields like \u003ccode\u003euserLocale\u003c/code\u003e, \u003ccode\u003etimeZone.offset\u003c/code\u003e, and \u003ccode\u003etimeZone.id\u003c/code\u003e, which add-ons can utilize in their functions.\u003c/p\u003e\n"],["\u003cp\u003eAfter adding the necessary scope, users need to re-authorize the add-on for the changes to take effect.\u003c/p\u003e\n"],["\u003cp\u003eAdd-ons should only request necessary scopes and consider removing unused ones, especially those previously used for locale and timezone access through other APIs or services.\u003c/p\u003e\n"]]],["Google Workspace add-ons can access user locale and timezone by configuring the add-on manifest. Set `addOns.common.useLocaleFromApp` to `true` and add `https://www.googleapis.com/auth/script.locale` to `oauthScopes`. This requires users to re-authorize the add-on. Event objects contain `userLocale`, `timeZone.offset`, and `timeZone.id`. Callback functions and trigger functions read this information from the event object to customize the add-on's interface and behavior, such as text on cards.\n"],null,["# Get user locale and timezone\n\nGoogle Workspace add-ons can access the locale and timezone of its user and use\nthat information to customize its interface and behavior. You must configure\nyour add-on's [manifest](/workspace/add-ons/concepts/workspace-manifests)\nto permit your add-on to access\nthis information.\n\nConfigure the add-on manifest\n-----------------------------\n\nYou can configure your add-on to access user locale and\ntimezone information\nwith the following steps:\n\n1. In your add-on's [manifest](/workspace/add-ons/concepts/workspace-manifests) file, set the `addOns.common.useLocaleFromApp` field to `true`.\n2. If it isn't present already, add the following explicit scope in the manifest's `oauthScopes` list: `https://www.googleapis.com/auth/script.locale`\n\nIf you added a scope to the add-on's `oauthScope` list,\nusers must [re-authorize](/workspace/add-ons/how-tos/authorizing-addons) the\nadd-on\nthe next time it is opened.\n| **Note:** If your add-on previously used the [Calendar API](/workspace/calendar/api/v3/reference/settings), the Apps Script [Calendar service](/apps-script/reference/calendar), or other service to access the user's locale and timezone, consider whether that service is still needed by your add-on. If not, remove any scopes that service requires from your manifest. Always limit your scope list to only those services that your add-on needs.\n\nGet locale and timezone information\n-----------------------------------\n\n[Event objects](/workspace/add-ons/concepts/event-objects)\ncarry user locale information when properly configured. The following fields\nappear in the [`commonEventObject`](/workspace/add-ons/concepts/event-objects#common_event_object)\nsubstructure of the event object:\n\n- `commonEventObject.userLocale`---The user's language and country/region identifier. For example, `en-US`.\n- `commonEventObject.timeZone.offset`---The user's timezone offset, in milliseconds, from Coordinated Universal Time (UTC).\n- `commonEventObject.timeZone.id`---The user's timezone identifier. For example, `America/New_York`.\n- `commonEventObject.timeZone`---The user's timezone ID and offset.\n\nSee [Event objects](/workspace/add-ons/concepts/event-objects)\nfor more details.\n\n[Event objects](/workspace/add-ons/concepts/event-objects) are passed to\n[action callback functions](/workspace/add-ons/concepts/actions#callback_functions)\nas the user interacts with your add-on, and to homepage\nand contextual\ntrigger functions. Each callback or trigger function can read the\nlocale and timezone information from the event object and use it as necessary.\nFor example, a callback function that is\n[navigating to a new card](/workspace/add-ons/how-tos/navigation#navigation_methods)\ncould refer to the locale string when deciding what text to add to the card."]]