Metode PickerBuilder.setLocale
Menetapkan lokalitas untuk pemilih. Lokalitas adalah kode bahasa ISO 639. Jika bahasa tidak didukung, maka en-US akan digunakan.
Contoh
Penggunaan dasar
const builder = new google.pickerPickerBuilder()
.setLocale('ES_419');
Menyetel lokalitas dari bahasa navigator
const builder = new google.pickerPickerBuilder()
.setLocale(navigator.languages[0]);
Lihat
Navigator.languages
untuk mengetahui informasi selengkapnya.
Tanda Tangan
setLocale(locale: Locales): PickerBuilder;
Detail
Opsional |
Tidak |
Final |
Tidak |
Dengan kontrasepsi |
Tidak |
Statis |
Tidak |
Parameter
Nama |
Jenis |
Opsional |
Deskripsi |
locale |
Locales |
Tidak |
|
Hasil
PickerBuilder
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-11-07 UTC.
[null,null,["Terakhir diperbarui pada 2024-11-07 UTC."],[[["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."]]],[]]