Method PickerBuilder.setLocale
Stay organized with collections
Save and categorize content based on your preferences.
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 2025-06-20 UTC.
[null,null,["Last updated 2025-06-20 UTC."],[],[],null,["# Method PickerBuilder.setLocale\n\nSet the locale for the picker. The locale is an ISO 639 language code. If the\nlanguage is not supported, en-US is used.\n\nExamples\n--------\n\nBasic usage \n\n const builder = new google.pickerPickerBuilder()\n .setLocale('ES_419');\n\nSet locale from navigator languages \n\n const builder = new google.pickerPickerBuilder()\n .setLocale(navigator.languages[0]);\n\nSee\n[Navigator.languages](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorLanguage/languages)\nfor more information.\n\nSignature\n---------\n\n setLocale(locale: Locales): PickerBuilder;\n\nDetails\n-------\n\n| Optional | No |\n| Final | No |\n| Protected | No |\n| Static | No |\n|-----------|----|\n\nParameters\n----------\n\n| Name | Type | Optional | Description |\n|----------|-----------------------------|----------|-------------|\n| `locale` | [Locales](./picker.locales) | No | |\n\nReturns\n-------\n\n[PickerBuilder](./picker.pickerbuilder)"]]