View Source Appwrite.Services.Locale (appwrite v0.2.1)
The Locale service allows you to customize your app based on your users' location.
Using this service, you can get your users' location, IP address, list of countries and continents names, phone codes, currencies, and more.
The locale service supports multiple locales. This feature allows you to fetch countries and continents information in your app's language.
Summary
Functions
Get the current user's locale.
List all locale codes classified by ISO 639-1.
List all continents.
List all countries.
List all countries in the European Union.
List all countries' phone dial codes.
List all currencies.
List all languages classified by ISO 639-1.
Functions
@spec get() :: {:ok, Appwrite.Types.Locale.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
Get the current user's locale.
Retrieves the location based on the request IP. Returns country code, country name, continent name, continent code, IP address, and suggested currency.
Returns
{:ok, Locale.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_codes() :: {:ok, Appwrite.Types.LocaleCodeList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all locale codes classified by ISO 639-1.
Returns
{:ok, LocaleCodeList.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_continents() :: {:ok, Appwrite.Types.ContinentList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all continents.
Returns
{:ok, ContinentList.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_countries() :: {:ok, Appwrite.Types.CountryList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all countries.
Returns
{:ok, CountryList.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_countries_eu() :: {:ok, Appwrite.Types.CountryList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all countries in the European Union.
Returns
{:ok, CountryList.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_countries_phones() :: {:ok, Appwrite.Types.PhoneList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all countries' phone dial codes.
Returns
{:ok, PhoneList.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_currencies() :: {:ok, Appwrite.Types.CurrencyList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all currencies.
Returns
{:ok, CurrencyList.t()}on success.{:error, AppwriteException.t()}on failure.
@spec list_languages() :: {:ok, Appwrite.Types.LanguageList.t()} | {:error, Appwrite.Exceptions.AppwriteException.t()}
List all languages classified by ISO 639-1.
Returns
{:ok, LanguageList.t()}on success.{:error, AppwriteException.t()}on failure.