روش PickerBuilder.setLocale، روش PickerBuilder.setLocale
محلی را برای انتخابگر تنظیم کنید. منطقه یک کد زبان ISO 639 است. اگر زبان پشتیبانی نمی شود، از en-US استفاده می شود.
نمونه ها
استفاده اساسی
const builder = new google.pickerPickerBuilder()
.setLocale('ES_419');
تنظیم محلی از زبان های ناوبر
const builder = new google.pickerPickerBuilder()
.setLocale(navigator.languages[0]);
برای اطلاعات بیشتر به Navigator.languages مراجعه کنید.
امضا
setLocale(locale: Locales): PickerBuilder;
جزئیات
اختیاری | خیر |
---|
نهایی | خیر |
---|
محافظت شده است | خیر |
---|
استاتیک | خیر |
---|
پارامترها
نام | تایپ کنید | اختیاری | توضیحات |
---|
locale | Locales | خیر | |
برمی گرداند
PickerBuilder
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-11-17 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-11-17 بهوقت ساعت هماهنگ جهانی."],[[["The `setLocale` method configures the language for the Google Picker using an ISO 639 language code, defaulting to en-US if the specified language isn't supported."],["Developers can utilize the `navigator.languages` property to dynamically set the locale based on the user's browser preferences."],["The method accepts a single parameter, `locale`, which should be a valid locale identifier as defined in the Locales documentation."],["Calling `setLocale` returns the `PickerBuilder` instance, enabling method chaining for further configuration."]]],[]]