Selektor metod tworzenia.setLocale
Ustaw język selektora. Język jest określony za pomocą kodu języka w formacie ISO 639. Jeśli język nie jest obsługiwany, używany jest język angielski (USA).
Przykłady
Podstawowe użycie
const builder = new google.pickerPickerBuilder()
.setLocale('ES_419');
Ustaw ustawienia regionalne z języków nawigacji
const builder = new google.pickerPickerBuilder()
.setLocale(navigator.languages[0]);
Więcej informacji znajdziesz w Navigator.languages.
Podpis
setLocale(locale: Locales): PickerBuilder;
Szczegóły
Opcjonalnie |
Nie |
Finał |
Nie |
Chroniony |
Nie |
Statyczny |
Nie |
Parametry
Nazwa |
Typ |
Opcjonalnie |
Opis |
locale |
Locales |
Nie |
|
Zwroty
PickerBuilder
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-11-07 UTC.
[null,null,["Ostatnia aktualizacja: 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."]]],[]]