Method PickerBuilder.setLocale
Set the locale for the picker. The locale is an ISO 639 language code. If the
language is not supported, en-US is used.
Examples
Basic usage
const builder = new google.pickerPickerBuilder()
.setLocale('ES_419');
Set locale from navigator languages
const builder = new google.pickerPickerBuilder()
.setLocale(navigator.languages[0]);
See
Navigator.languages
for more information.
Signature
setLocale(locale: Locales): PickerBuilder;
Details
Optional |
No |
Final |
No |
Protected |
No |
Static |
No |
Parameters
Name |
Type |
Optional |
Description |
locale |
Locales |
No |
|
Returns
PickerBuilder
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-23 UTC.
[null,null,["Last updated 2024-09-23 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."]]],[]]