Locale
Request location, countries, languages, currencies, continents and phone codes.
Request location, countries, languages, currencies, continents and phone codes.
Class Locale: 8 methods (8 in @owbase/web, 8 in @owbase/node). The examples use the object form of the parameters; replace the values between < and > with your own.
Get user locale
GET /locale · method page
SDK: @owbase/web and @owbase/node
Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.
No parameters.
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.get();
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.get();listCodes
Section titled “listCodes”List locale codes
GET /locale/codes · method page
SDK: @owbase/web and @owbase/node
List of all locale codes in ISO 639-1.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listCodes({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listCodes({ total: false, // optional});listContinents
Section titled “listContinents”List continents
GET /locale/continents · method page
SDK: @owbase/web and @owbase/node
List of all continents. You can use the locale header to get the data in a supported language.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listContinents({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listContinents({ total: false, // optional});listCountries
Section titled “listCountries”List countries
GET /locale/countries · method page
SDK: @owbase/web and @owbase/node
List of all countries. You can use the locale header to get the data in a supported language.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listCountries({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listCountries({ total: false, // optional});listCountriesEU
Section titled “listCountriesEU”List EU countries
GET /locale/countries/eu · method page
SDK: @owbase/web and @owbase/node
List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listCountriesEU({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listCountriesEU({ total: false, // optional});listCountriesPhones
Section titled “listCountriesPhones”List countries phone codes
GET /locale/countries/phones · method page
SDK: @owbase/web and @owbase/node
List of all countries phone codes. You can use the locale header to get the data in a supported language.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listCountriesPhones({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listCountriesPhones({ total: false, // optional});listCurrencies
Section titled “listCurrencies”List currencies
GET /locale/currencies · method page
SDK: @owbase/web and @owbase/node
List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listCurrencies({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listCurrencies({ total: false, // optional});listLanguages
Section titled “listLanguages”List languages
GET /locale/languages · method page
SDK: @owbase/web and @owbase/node
List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.
| Parameter | Type | Required | Description |
|---|---|---|---|
total |
boolean |
no | When set to false, the total count returned will be 0 and will not be calculated. |
Access: API key with the locale.read scope or no key or session: the project ID is enough.
import { Client, Locale } from '@owbase/web';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>'); // Your project ID
const locale = new Locale(client);
const result = await locale.listLanguages({ total: false, // optional});
console.log(result);import { Client, Locale } from '@owbase/node';
const client = new Client() .setEndpoint('https://cloud.owbase.dev/v1') // Your API Endpoint .setProject('<YOUR_PROJECT_ID>') // Your project ID .setSession(''); // The user session to authenticate with
const locale = new Locale(client);
const result = await locale.listLanguages({ total: false, // optional});The descriptions on this page come from the server API specification (BSD-3-Clause license), and the examples come from the SDK generator (MIT license). The full notices are in the NOTICE file of the @owbase/web and @owbase/node packages.