Get User Locale
Endpoint
gethttps://<REGION>.cloud.appwrite.io/v1/locale
Description
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.
Required scopes
Authentication
setProject(). No signed-in user or server API key is required.Locale
User IP address.
Country code in ISO 3166-1 two-character format
Country name. This field support localization.
Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
Continent name. This field support localization.
True if country is part of the Europian Union.
Currency code in ISO 4217-1 three-character format
import Appwrite
func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID let locale = Locale(client) let locale = try await locale.get()
print(String(describing: locale)}Localization
Get User Locale
Endpoint
gethttps://<REGION>.cloud.appwrite.io/v1/locale
Description
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.
Required scopes
Authentication
setProject(). No signed-in user or server API key is required.Locale
User IP address.
Country code in ISO 3166-1 two-character format
Country name. This field support localization.
Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.
Continent name. This field support localization.
True if country is part of the Europian Union.
Currency code in ISO 4217-1 three-character format
import Appwrite
func main() async throws { let client = Client() .setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint .setProject("5df5acd0d48c2") // Your project ID let locale = Locale(client) let locale = try await locale.get()
print(String(describing: locale)}